[kune-commits] r1811 - in trunk: . debian img/icons script src/main/java/cc/kune/barters/client src/main/java/cc/kune/barters/client/actions src/main/java/cc/kune/barters/server src/main/java/cc/kune/barters/shared src/main/java/cc/kune/blogs/client src/main/java/cc/kune/blogs/client/actions src/main/java/cc/kune/blogs/server src/main/java/cc/kune/blogs/shared src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/chat/server src/main/java/cc/kune/chat/shared src/main/java/cc/kune/common/client/actions/ui/descrip src/main/java/cc/kune/core/client/actions src/main/java/cc/kune/core/client/actions/xml src/main/java/cc/kune/core/client/dnd src/main/java/cc/kune/core/client/registry src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/client/services src/main/java/cc/kune/core/client/state/impl src/main/java/cc/kune/core/client/ws src/main/java/cc/kune/core/public src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/manager/file src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/server/state src/main/java/cc/kune/core/server/tool src/main/java/cc/kune/core/shared src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/core/shared/utils src/main/java/cc/kune/docs/client src/main/java/cc/kune/docs/client/actions src/main/java/cc/kune/docs/server src/main/java/cc/kune/docs/shared src/main/java/cc/kune/domain src/main/java/cc/kune/events/client src/main/java/cc/kune/events/client/actions src/main/java/cc/kune/events/server src/main/java/cc/kune/events/shared src/main/java/cc/kune/gallery/server src/main/java/cc/kune/gallery/shared src/main/java/cc/kune/gspace/client src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/armor src/main/java/cc/kune/gspace/client/armor/impl src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/lists/client src/main/java/cc/kune/lists/client/actions src/main/java/cc/kune/lists/server src/main/java/cc/kune/lists/shared src/main/java/cc/kune/tasks/client src/main/java/cc/kune/tasks/client/actions src/main/java/cc/kune/tasks/server src/main/java/cc/kune/tasks/shared 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 src/main/java/cc/kune/wiki/client src/main/java/cc/kune/wiki/client/actions src/main/java/cc/kune/wiki/server src/main/java/cc/kune/wiki/shared src/main/java/com/google/wave/splash/web/template src/main/resources src/main/webapp/others src/test/java/cc/kune/core/client/actions src/test/java/cc/kune/core/server src/test/java/cc/kune/core/server/integration src/test/java/cc/kune/core/server/integration/content src/test/java/cc/kune/core/server/manager src/test/java/cc/kune/core/server/mapper src/test/java/cc/kune/core/shared/utils src/test/java/cc/kune/docs src/test/java/cc/kune/gspace/client src/test/java/cc/kune/selenium/spaces
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sat Mar 31 19:43:12 CEST 2012
Author: vjrj_
Date: 2012-03-31 19:43:11 +0200 (Sat, 31 Mar 2012)
New Revision: 1811
Added:
trunk/src/main/java/cc/kune/gspace/client/actions/ActionUtils.java
trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.java
trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.ui.xml
trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.java
trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.ui.xml
trunk/src/main/java/cc/kune/trash/server/TrashServerUtils.java
trunk/src/main/webapp/others/defuser.jpg
trunk/src/main/webapp/others/unknown.png
trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java
trunk/src/test/java/cc/kune/gspace/client/armor/
Removed:
trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java
trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml
trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeBorrarTest.java
Modified:
trunk/TODO
trunk/debian/changelog
trunk/debian/files
trunk/debian/kune.init
trunk/img/icons/from-private-to-public.svg
trunk/script/server.sh
trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java
trunk/src/main/java/cc/kune/barters/shared/BartersToolConstants.java
trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java
trunk/src/main/java/cc/kune/blogs/shared/BlogsToolConstants.java
trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java
trunk/src/main/java/cc/kune/chat/shared/ChatToolConstants.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescCollection.java
trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/dnd/FolderContainerDropController.java
trunk/src/main/java/cc/kune/core/client/registry/AbstractContentRegistry.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java
trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
trunk/src/main/java/cc/kune/core/server/content/ContentManager.java
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPCMock.java
trunk/src/main/java/cc/kune/core/server/state/StateAbstract.java
trunk/src/main/java/cc/kune/core/server/state/StateContainer.java
trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java
trunk/src/main/java/cc/kune/core/shared/FileConstants.java
trunk/src/main/java/cc/kune/core/shared/dto/ContainerDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/StateAbstractDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java
trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java
trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/cc/kune/docs/shared/DocsToolConstants.java
trunk/src/main/java/cc/kune/domain/Container.java
trunk/src/main/java/cc/kune/domain/Content.java
trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
trunk/src/main/java/cc/kune/events/server/EventsServerTool.java
trunk/src/main/java/cc/kune/events/shared/EventsToolConstants.java
trunk/src/main/java/cc/kune/gallery/server/GalleryServerTool.java
trunk/src/main/java/cc/kune/gallery/shared/GalleryToolConstants.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
trunk/src/main/java/cc/kune/gspace/client/actions/CopyContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java
trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java
trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
trunk/src/main/java/cc/kune/lists/shared/ListsToolConstants.java
trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java
trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
trunk/src/main/java/cc/kune/tasks/server/TaskServerTool.java
trunk/src/main/java/cc/kune/tasks/shared/TasksToolConstants.java
trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java
trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.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/ParticipantUtils.java
trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
trunk/src/main/java/cc/kune/wiki/server/WikiServerTool.java
trunk/src/main/java/cc/kune/wiki/shared/WikiToolConstants.java
trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
trunk/src/main/resources/wave-server-production.properties
trunk/src/main/webapp/others/unknown.jpg
trunk/src/test/java/cc/kune/core/server/PersistencePreLoadedDataTest.java
trunk/src/test/java/cc/kune/core/server/TestHelper.java
trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java
trunk/src/test/java/cc/kune/core/server/manager/ContainerManagerDefaultTest.java
trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java
trunk/src/test/java/cc/kune/core/shared/utils/SharedFileDownloadUtilsTest.java
trunk/src/test/java/cc/kune/docs/DocumentToolTest.java
trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
Log:
NEW - # 222: Create a trash folder icon and improve contents delete functionality
http://kune.ourproject.org/issues/ticket/222
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/TODO 2012-03-31 17:43:11 UTC (rev 1811)
@@ -12,6 +12,10 @@
nick == assigned to
* SHORT-TERM (URGENT)
+** setui/root/port 80
+ [ ] http://wiki.eclipse.org/Jetty/Howto/Port80#Configuring_Jetty.27s_SetUID_Feature
+ [ ] https://github.com/disconnect/apache-websocket
+ [ ] SSL + proxy normal
** tutorials
*** via btn
*** via hash (future) #tuto(token,slide)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/debian/changelog 2012-03-31 17:43:11 UTC (rev 1811)
@@ -1,3 +1,9 @@
+kune (0.1.0+b3) oneiric; urgency=low
+
+ * Several changes (cache of SN and events, minor style changes, etc). See ChangeLog
+
+ -- Vicente J. Ruiz Jurado <vjrj at ourproject.org> Fri, 30 Mar 2012 20:18:19 +0200
+
kune (0.1.0+b2) unstable; urgency=low
* Perms in daemon. SIGHUP to reload. Other minor changes
Modified: trunk/debian/files
===================================================================
--- trunk/debian/files 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/debian/files 2012-03-31 17:43:11 UTC (rev 1811)
@@ -1 +1 @@
-kune_0.1.0+b2_all.deb java optional
+kune_0.1.0+b3_all.deb java optional
Modified: trunk/debian/kune.init
===================================================================
--- trunk/debian/kune.init 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/debian/kune.init 2012-03-31 17:43:11 UTC (rev 1811)
@@ -12,6 +12,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kune server"
NAME=kune
+USER=kune
DAEMON=/usr/share/kune/bin/server.sh
# Arguments to run the daemon with (see server.sh -h)
DAEMON_ARGS="-j /usr/share/kune/lib/kune-complete.jar -a"
@@ -51,9 +52,9 @@
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE -d /usr/share/kune/ -c $NAME:$NAME -b --exec $DAEMON --test > /dev/null \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE -d /usr/share/kune/ -c $USER:$USER -b --exec $DAEMON --test > /dev/null \
|| return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE -d /usr/share/kune/ -c $NAME:$NAME -b --exec $DAEMON -- \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE -d /usr/share/kune/ -c $USER:$USER -b --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
@@ -103,7 +104,7 @@
log_daemon_msg "Reloading kune"
# Seems that dont works if the user/group is not the same:
# http://stackoverflow.com/questions/4147288/how-to-trap-a-signal-in-a-java-application-initialized-using-a-bash-script
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --user $NAME --group $NAME --name $NAME
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --user $USER --group $USER --name $NAME
return 0
}
Modified: trunk/img/icons/from-private-to-public.svg
===================================================================
--- trunk/img/icons/from-private-to-public.svg 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/img/icons/from-private-to-public.svg 2012-03-31 17:43:11 UTC (rev 1811)
@@ -25,7 +25,7 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="0.66041902"
+ inkscape:zoom="0.67942388"
inkscape:cx="372.04724"
inkscape:cy="526.18109"
inkscape:document-units="px"
@@ -896,5 +896,56 @@
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
+ <rect
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/webapp/others/unknown.png"
+ y="68.119125"
+ x="423.80432"
+ height="90"
+ width="90"
+ id="rect14554"
+ style="opacity:0.82999998;color:#000000;fill:#ffffff;fill-opacity:0.94901961;fill-rule:nonzero;stroke:none;stroke-width:1.40678155;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/webapp/others/unknown.png"
+ sodipodi:type="arc"
+ style="color:#000000;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#666666;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path14558"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
+ transform="matrix(1.9,0,0,3.8,297.80431,-9.8571688)" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:#e6e6e6;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu"
+ x="453.29498"
+ y="138.63554"
+ id="text14573"
+ sodipodi:linespacing="125%"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/webapp/others/unknown.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><tspan
+ sodipodi:role="line"
+ id="tspan14575"
+ x="453.29498"
+ y="138.63554"
+ style="font-size:72px;font-weight:bold;fill:#333333;stroke:none">?</tspan></text>
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/webapp/others/unknown.png"
+ transform="matrix(1.9,0,0,3.8,297.80431,-9.8571688)"
+ d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
+ sodipodi:cx="90"
+ id="path14566"
+ style="color:#000000;fill:none;stroke:#999999;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
</g>
</svg>
Modified: trunk/script/server.sh
===================================================================
--- trunk/script/server.sh 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/script/server.sh 2012-03-31 17:43:11 UTC (rev 1811)
@@ -36,7 +36,7 @@
# See src/main/resources/jaas.config in svn
JAAS_CONFIG=$KUNE_HOME/jaas.config
# See src/main/resources/log4j.properties in svn
-LOGJ4_CONFIG=$KUNE_HOME/log4j.properties
+LOGJ4_CONFIG=file://$KUNE_HOME/log4j.properties
SUSPEND="n"
DEBUG=""
Modified: trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.barters.client;
-import static cc.kune.barters.shared.BartersToolConstants.NAME;
+import static cc.kune.barters.shared.BartersToolConstants.TOOL_NAME;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_BARTER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_FOLDER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_ROOT;
@@ -43,7 +43,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_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(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
@@ -63,7 +63,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.barters.client.actions;
+import static cc.kune.barters.shared.BartersToolConstants.TOOL_NAME;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_BARTER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_FOLDER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_ROOT;
@@ -37,9 +38,12 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -66,34 +70,38 @@
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<RefreshContentMenuItem> refresh, final Provider<CopyContentMenuItem> copyContent,
final Provider<WriteToParticipantsMenuItem> writeToParticipants) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newBartersBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newBartersBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
}
@Override
Modified: trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.barters.server;
-import static cc.kune.barters.shared.BartersToolConstants.NAME;
+import static cc.kune.barters.shared.BartersToolConstants.TOOL_NAME;
import static cc.kune.barters.shared.BartersToolConstants.ROOT_NAME;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_BARTER;
import static cc.kune.barters.shared.BartersToolConstants.TYPE_FOLDER;
@@ -57,7 +57,7 @@
public BarterServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_BARTER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_BARTER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER),
Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER), contentManager,
containerManager, creationService, configurationManager, i18n, ServerToolTarget.forUsers);
gadgetUrl = UrlUtils.of(BARTER_GADGET);
Modified: trunk/src/main/java/cc/kune/barters/shared/BartersToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/shared/BartersToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/barters/shared/BartersToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,11 +21,11 @@
public final class BartersToolConstants {
- public static final String NAME = "barters";
+ public static final String TOOL_NAME = "barters";
public static final String ROOT_NAME = "barters";
- public static final String TYPE_BARTER = NAME + "." + "barter";
- public static final String TYPE_FOLDER = NAME + "." + "folder";
- public static final String TYPE_ROOT = NAME + "." + "root";
+ public static final String TYPE_BARTER = TOOL_NAME + "." + "barter";
+ public static final String TYPE_FOLDER = TOOL_NAME + "." + "folder";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
private BartersToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.blogs.client;
-import static cc.kune.blogs.shared.BlogsToolConstants.NAME;
+import static cc.kune.blogs.shared.BlogsToolConstants.TOOL_NAME;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_BLOG;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_POST;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_ROOT;
@@ -44,7 +44,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_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(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
@@ -64,7 +64,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.blogs.client.actions;
+import static cc.kune.blogs.shared.BlogsToolConstants.TOOL_NAME;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_BLOG;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_POST;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_ROOT;
@@ -41,10 +42,13 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -76,38 +80,42 @@
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<CopyContentMenuItem> copyContent,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<WriteToParticipantsMenuItem> writeToParticipants,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newPostIconBtn, noRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, blogNewMenu, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, postNewMenu, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newPostItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newBlogBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newPostIconBtn, noRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, blogNewMenu, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, postNewMenu, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newPostItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newBlogBtn, TYPE_ROOT);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, chatAbout, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
newMenusRegistry.register(TYPE_POST,
(MenuDescriptor) postNewMenu.get().withText(i18n.t("Add Gadget")));
Modified: trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.blogs.server;
-import static cc.kune.blogs.shared.BlogsToolConstants.NAME;
+import static cc.kune.blogs.shared.BlogsToolConstants.TOOL_NAME;
import static cc.kune.blogs.shared.BlogsToolConstants.ROOT_NAME;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_BLOG;
import static cc.kune.blogs.shared.BlogsToolConstants.TYPE_POST;
@@ -46,7 +46,7 @@
public BlogServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST, TYPE_UPLOADEDFILE),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST, TYPE_UPLOADEDFILE),
Arrays.asList(TYPE_BLOG), Arrays.asList(TYPE_BLOG), Arrays.asList(TYPE_ROOT), contentManager,
containerManager, creationService, configurationManager, i18n, ServerToolTarget.forBoth);
}
Modified: trunk/src/main/java/cc/kune/blogs/shared/BlogsToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/shared/BlogsToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/blogs/shared/BlogsToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -23,12 +23,12 @@
public final class BlogsToolConstants {
- public static final String NAME = "blogs";
+ public static final String TOOL_NAME = "blogs";
public static final String ROOT_NAME = "blogs";
- public static final String TYPE_BLOG = NAME + "." + "blog";
- public static final String TYPE_POST = NAME + "." + "post";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
+ public static final String TYPE_BLOG = TOOL_NAME + "." + "blog";
+ public static final String TYPE_POST = TOOL_NAME + "." + "post";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
+ public static final String TYPE_UPLOADEDFILE = TOOL_NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
private BlogsToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.chat.client;
-import static cc.kune.chat.shared.ChatToolConstants.NAME;
+import static cc.kune.chat.shared.ChatToolConstants.TOOL_NAME;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOM;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOT;
import cc.kune.chat.client.resources.ChatResources;
@@ -45,7 +45,7 @@
final ChatResources res, final IconicResources icons) {
// FIXME: change this in ChatConstants and in db via migration
super(
- NAME,
+ TOOL_NAME,
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)",
@@ -58,7 +58,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.chat.client.actions;
+import static cc.kune.chat.shared.ChatToolConstants.TOOL_NAME;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOM;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOT;
import cc.kune.core.client.actions.ActionRegistryByType;
@@ -51,14 +52,14 @@
final Provider<OpenRoomBtn> openRoomBtn, final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newRoomBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, openRoomBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomArchiveMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newRoomBtn, TYPE_ROOT);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, openRoomBtn, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openRoomMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openRoomArchiveMenuItem, containersNoRoot);
}
@Override
Modified: trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.chat.server;
-import static cc.kune.chat.shared.ChatToolConstants.NAME;
+import static cc.kune.chat.shared.ChatToolConstants.TOOL_NAME;
import static cc.kune.chat.shared.ChatToolConstants.ROOT_NAME;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOM;
import static cc.kune.chat.shared.ChatToolConstants.TYPE_ROOT;
@@ -49,7 +49,7 @@
final ContentManager contentManager, final ContainerManager containerManager,
final ChatManagerDefault chatManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Collections.<String> emptyList(),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Collections.<String> emptyList(),
Collections.<String> emptyList(), Arrays.asList(TYPE_ROOM), Arrays.asList(TYPE_ROOT),
contentManager, containerManager, creationService, configurationManager, i18n,
ServerToolTarget.forGroups);
Modified: trunk/src/main/java/cc/kune/chat/shared/ChatToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/shared/ChatToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/chat/shared/ChatToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,11 +21,11 @@
public final class ChatToolConstants {
- public static final String NAME = "chats";
+ public static final String TOOL_NAME = "chats";
public static final String ROOT_NAME = "chats";
- public static final String TYPE_CHAT = NAME + "." + "chat";
- public static final String TYPE_ROOM = NAME + "." + "room";
- public static final String TYPE_ROOT = NAME + "." + "root";
+ public static final String TYPE_CHAT = TOOL_NAME + "." + "chat";
+ public static final String TYPE_ROOM = TOOL_NAME + "." + "room";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
private ChatToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescCollection.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescCollection.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescCollection.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -24,6 +24,7 @@
// @PMD:REVIEWED:AtLeastOneConstructor: by vjrj on 26/05/09 12:31
public class GuiActionDescCollection extends ArrayList<GuiActionDescrip> {
+ public static final GuiActionDescCollection EMPTY = new GuiActionDescCollection();
private static final long serialVersionUID = 6759723760404227737L;
public void add(final GuiActionDescrip... descriptors) {
Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -57,12 +57,13 @@
collection.add(descrip);
}
- public void addAction(final Provider<? extends GuiActionDescrip> action) {
- addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
- }
+ // public void addAction(final Provider<? extends GuiActionDescrip> action) {
+ // addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
+ // }
- public void addAction(final String actionsGroupId, final GuiActionDescrip descrip, final String typeId) {
- addAction(actionsGroupId, new Provider<GuiActionDescrip>() {
+ public void addAction(@Nonnull final String tool, final String actionsGroupId,
+ final GuiActionDescrip descrip, final String typeId) {
+ addAction(tool, actionsGroupId, new Provider<GuiActionDescrip>() {
@Override
public GuiActionDescrip get() {
return descrip;
@@ -70,34 +71,35 @@
}, typeId);
}
- public void addAction(@Nonnull final String actionsGroupId,
+ public void addAction(@Nonnull final String tool, @Nonnull final String actionsGroupId,
final Provider<? extends GuiActionDescrip> action) {
- addAction(actionsGroupId, action, GENERIC_TYPE_ID);
+ addAction(tool, actionsGroupId, action, GENERIC_TYPE_ID);
}
- public void addAction(@Nonnull final String actionsGroupId,
+ public void addAction(@Nonnull final String tool, @Nonnull final String actionsGroupId,
final @Nonnull Provider<? extends GuiActionDescrip> action, final ContentStatus status,
@Nonnull final String... typeIds) {
for (final String typeId : typeIds) {
- addAction(actionsGroupId, action, IdGenerator.generate(typeId, status.toString()));
+ addAction(tool, actionsGroupId, action, IdGenerator.generate(typeId, status.toString()));
}
}
- public void addAction(@Nonnull final String actionsGroupId,
+ public void addAction(@Nonnull final String tool, @Nonnull final String actionsGroupId,
final @Nonnull Provider<? extends GuiActionDescrip> action, @Nonnull final String... typeIds) {
for (final String typeId : typeIds) {
- final GuiActionDescProviderCollection actionColl = getActions(actionsGroupId, typeId);
+ final GuiActionDescProviderCollection actionColl = getActions(tool, actionsGroupId, typeId);
actionColl.add(action);
- actions.put(genKey(actionsGroupId, typeId), actionColl);
+ actions.put(genKey(tool, actionsGroupId, typeId), actionColl);
}
}
- private String genKey(final String actionsGroupId, final String typeId) {
- return actionsGroupId + KEY_SEPARATOR + typeId;
+ private String genKey(final String tool, final String actionsGroupId, final String typeId) {
+ return tool + KEY_SEPARATOR + actionsGroupId + KEY_SEPARATOR + typeId;
}
- private GuiActionDescProviderCollection getActions(final String actionsGroupId, final String typeId) {
- final String key = genKey(actionsGroupId, typeId);
+ private GuiActionDescProviderCollection getActions(final String tool, final String actionsGroupId,
+ final String typeId) {
+ final String key = genKey(tool, actionsGroupId, typeId);
GuiActionDescProviderCollection actionColl = actions.get(key);
if (actionColl == null) {
actionColl = new GuiActionDescProviderCollection();
@@ -106,20 +108,22 @@
return actionColl;
}
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
- final AccessRights rights, @Nullable final String actionsGroup) {
- return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
+ public GuiActionDescCollection getCurrentActions(final String tool, final Object targetItem,
+ final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroup) {
+ return getCurrentActions(tool, targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
}
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights) {
- return getCurrentActions(targetItem, typeId, isLogged, rights, null);
+ public GuiActionDescCollection getCurrentActions(@Nonnull final String tool, final Object targetItem,
+ final String typeId, final boolean isLogged, final AccessRights rights) {
+ return getCurrentActions(tool, targetItem, typeId, isLogged, rights, null);
}
- public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroupId) {
+ public <T> GuiActionDescCollection getCurrentActions(final String tool, final Object targetItem,
+ final String typeId, final boolean isLogged, final AccessRights rights,
+ @Nullable final String actionsGroupId) {
final GuiActionDescCollection collection = new GuiActionDescCollection();
- for (final Provider<? extends GuiActionDescrip> descripProv : getActions(actionsGroupId, typeId)) {
+ for (final Provider<? extends GuiActionDescrip> descripProv : getActions(tool, actionsGroupId,
+ typeId)) {
final GuiActionDescrip descrip = descripProv.get();
final AbstractAction action = descrip.getAction();
if (action instanceof RolAction) {
@@ -133,13 +137,13 @@
return collection;
}
- public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final ContentStatus status, final boolean isLogged, final AccessRights rights,
- @Nullable final String actionsGroupId) {
+ public <T> GuiActionDescCollection getCurrentActions(@Nonnull final String tool,
+ final Object targetItem, final String typeId, final ContentStatus status, final boolean isLogged,
+ final AccessRights rights, @Nullable final String actionsGroupId) {
final GuiActionDescCollection collection = new GuiActionDescCollection();
- collection.addAll(getCurrentActions(targetItem, typeId, isLogged, rights, actionsGroupId));
- collection.addAll(getCurrentActions(targetItem, IdGenerator.generate(typeId, status.toString()),
- isLogged, rights, actionsGroupId));
+ collection.addAll(getCurrentActions(tool, targetItem, typeId, isLogged, rights, actionsGroupId));
+ collection.addAll(getCurrentActions(tool, targetItem,
+ IdGenerator.generate(typeId, status.toString()), isLogged, rights, actionsGroupId));
return collection;
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -98,11 +98,11 @@
}
private Provider<GuiActionDescrip> createMenuItem(final XMLGuiActionDescriptor descrip,
- final String origTypeId, final AbstractAction action) {
+ final String tool, final String origTypeId, final AbstractAction action) {
final String path = descrip.getPath();
final MenuDescriptor menu = newMenusRegistry.get(origTypeId);
assert menu != null;
- final SubMenuDescriptor submenu = getSubMenu(menu, origTypeId, path);
+ final SubMenuDescriptor submenu = getSubMenu(menu, tool, origTypeId, path);
final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
@Override
public GuiActionDescrip get() {
@@ -118,8 +118,8 @@
return menuItemProvider;
}
- private SubMenuDescriptor getSubMenu(final MenuDescriptor menu, final String typeId,
- final String parentS) {
+ private SubMenuDescriptor getSubMenu(final MenuDescriptor menu, final String tool,
+ final String typeId, final String parentS) {
final String[] path = parentS.split(SEP);
SubMenuDescriptor current = null;
for (int i = 0; i < path.length; i++) {
@@ -132,7 +132,7 @@
subMenuDescriptor = new SubMenuDescriptor(parent, false, i18n.t(name));
// subMenuDescriptor.setVisible(false);
submenus.put(subpathId, subMenuDescriptor);
- actionRegistry.addAction(ActionGroups.TOPBAR, subMenuDescriptor, typeId);
+ actionRegistry.addAction(tool, ActionGroups.TOPBAR, subMenuDescriptor, typeId);
}
current = subMenuDescriptor;
}
@@ -160,6 +160,7 @@
assert extension != null;
for (final XMLTypeId typeId : descrip.getTypeIds()) {
final String origTypeId = typeId.getOrigTypeId();
+ final String tool = origTypeId.split("\\.")[0];
final String contentIntro = descrip.getNewContentTextIntro();
final String destTypeId = typeId.getDestTypeId();
AbstractAction action;
@@ -175,8 +176,9 @@
extension.getExtName(), destTypeId, extension.getIconUrl(),
descrip.getNewContentTitle(), TextUtils.empty(contentIntro) ? "" : contentIntro);
}
- final Provider<GuiActionDescrip> menuItemProvider = createMenuItem(descrip, origTypeId, action);
- actionRegistry.addAction(ActionGroups.TOPBAR, menuItemProvider, origTypeId);
+ final Provider<GuiActionDescrip> menuItemProvider = createMenuItem(descrip, tool, origTypeId,
+ action);
+ actionRegistry.addAction(tool, ActionGroups.TOPBAR, menuItemProvider, origTypeId);
}
}
}
Modified: trunk/src/main/java/cc/kune/core/client/dnd/FolderContainerDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/FolderContainerDropController.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/dnd/FolderContainerDropController.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -104,7 +104,7 @@
} else if (getTarget() instanceof ToolSelectorItemPanel) {
destToken = new StateToken(session.getCurrentGroupShortName(),
((ToolSelectorItemPanel) getTarget()).getName());
- if (!destToken.getTool().equals(TrashToolConstants.NAME)) {
+ if (!destToken.getTool().equals(TrashToolConstants.TOOL_NAME)) {
// By now only move to trash
notImplemented();
return;
Modified: trunk/src/main/java/cc/kune/core/client/registry/AbstractContentRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/AbstractContentRegistry.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/registry/AbstractContentRegistry.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -22,30 +22,34 @@
import java.util.ArrayList;
public abstract class AbstractContentRegistry {
- private final ArrayList<String> registry;
+ private final ArrayList<String> registry;
- public AbstractContentRegistry() {
- registry = new ArrayList<String>();
- }
+ public AbstractContentRegistry() {
+ registry = new ArrayList<String>();
+ }
- public boolean contains(String typeId) {
- return registry.contains(typeId);
- }
+ public String[] asArray() {
+ return registry.toArray(new String[registry.size()]);
+ }
- public void register(String... typeIds) {
- for (String typeId : typeIds) {
- registry.add(typeId);
- }
- }
+ public boolean contains(final String typeId) {
+ return registry.contains(typeId);
+ }
- @Override
- public String toString() {
- return "registry: " + registry;
+ public void register(final String... typeIds) {
+ for (final String typeId : typeIds) {
+ registry.add(typeId);
}
+ }
- public void unregister(String... typeIds) {
- for (String typeId : typeIds) {
- registry.remove(typeId);
- }
+ @Override
+ public String toString() {
+ return "registry: " + registry;
+ }
+
+ public void unregister(final String... typeIds) {
+ for (final String typeId : typeIds) {
+ registry.remove(typeId);
}
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -77,6 +77,10 @@
StateContainerDTO moveContent(String userHash, StateToken contentToken, StateToken newContainerToken)
throws DefaultException;
+ StateContainerDTO purgeContainer(String userHash, StateToken token);
+
+ StateContainerDTO purgeContent(String userHash, StateToken token);
+
RateResult rateContent(String userHash, StateToken token, Double value) throws DefaultException;
void removeAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -77,6 +77,10 @@
void moveContent(String userHash, StateToken contentToken, StateToken newContainerToken,
AsyncCallback<StateContainerDTO> asyncCallback);
+ void purgeContainer(String userHash, StateToken token, AsyncCallback<StateContainerDTO> callback);
+
+ void purgeContent(String userHash, StateToken token, AsyncCallback<StateContainerDTO> callback);
+
void rateContent(String userHash, StateToken token, Double value,
AsyncCallback<RateResult> asyncCallback);
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-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -126,4 +126,35 @@
}
});
}
+
+ public void purgeContent(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().purgeContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ // Should we do something with
+ // ContainerNotEmptyException?
+ super.onFailure(caught);
+ NotifyUser.hideProgress();
+ }
+
+ @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/client/services/ClientFileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -32,13 +32,11 @@
public class ClientFileDownloadUtils extends SharedFileDownloadUtils {
- private final ImageUtils imageUtils;
private final Session session;
@Inject
- public ClientFileDownloadUtils(final Session session, final ImageUtils imageUtils) {
+ public ClientFileDownloadUtils(final Session session) {
this.session = session;
- this.imageUtils = imageUtils;
}
private String calculateUrl(final StateToken token, final boolean download, final boolean useHash) {
@@ -81,17 +79,6 @@
return calculateUrl(token, false, true);
}
- public String getLogoAvatarHtml(final StateToken groupToken, final boolean groupHasLogo,
- final boolean isPersonal, final int size, final int hvspace) {
- if (groupHasLogo) {
- return "<img hspace='" + hvspace + "' vspace='" + hvspace + "' align='left' style='width: " + size
- + "px; height: " + size + "px;' src='" + getLogoImageUrl(groupToken.getGroup()) + "'>";
- } else {
- return isPersonal ? imageUtils.getImageHtml(ImageDescriptor.personDef)
- : imageUtils.getImageHtml(ImageDescriptor.groupDefIcon);
- }
- }
-
public String getUrl(final StateToken token) {
return calculateUrl(token, false, false);
}
Modified: trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -79,6 +79,7 @@
private final HistoryWrapper history;
private StateToken previousGroupToken;
private String previousHash;
+ private String previousTool;
/**
* When a historyChanged is interrupted (for instance because you are editing
* something), the new history token is stored here
@@ -100,6 +101,7 @@
this.history = history;
this.signIn = signIn;
this.previousGroupToken = null;
+ this.previousTool = null;
this.previousHash = null;
this.resumedHistoryToken = null;
tokenMatcher.init(GwtWaverefEncoder.INSTANCE);
@@ -154,7 +156,7 @@
GroupChangedEvent.fire(eventBus, previousGroup, newGroup);
}
final String previousToolName = getPreviousTool();
- final String newTokenTool = newState.getStateToken().getTool();
+ final String newTokenTool = newState.getToolName();
final String newToolName = newTokenTool == null ? "" : newTokenTool;
if (startingUp() || previousToolName == null || !previousToolName.equals(newToolName)) {
ToolChangedEvent.fire(eventBus, previousGroupToken, newState.getStateToken());
@@ -245,7 +247,7 @@
}
private String getPreviousTool() {
- final String previousTool = startingUp() ? "" : previousGroupToken.getTool();
+ final String previousTool = startingUp() ? "" : this.previousTool;
return previousTool;
}
@@ -545,6 +547,7 @@
StateChangedEvent.fire(eventBus, newState);
checkGroupAndToolChange(newState);
previousGroupToken = newToken.copy();
+ previousTool = newState.getToolName();
eventBus.fireEvent(new ProgressHideEvent());
}
Modified: trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,7 +21,7 @@
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.impl.StateManagerDefault;
-import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
+import cc.kune.gspace.client.armor.GSpaceArmorDefault;
import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
import com.google.gwt.core.client.GWT;
@@ -35,7 +35,7 @@
*/
public class CoreViewImpl extends ViewImpl implements CorePresenter.CoreView {
- private final GSpaceArmorImpl armor;
+ private final GSpaceArmorDefault armor;
/**
* Instantiates a new core view.
@@ -44,7 +44,7 @@
* the body
*/
@Inject
- public CoreViewImpl(final GSpaceArmorImpl armor, final StateManagerDefault stateManager) {
+ public CoreViewImpl(final GSpaceArmorDefault armor, final StateManagerDefault stateManager) {
this.armor = armor;
GWT.<CoreResources> create(CoreResources.class).css().ensureInjected();
GWT.<GSpaceArmorResources> create(GSpaceArmorResources.class).style().ensureInjected();
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2012-03-31 17:43:11 UTC (rev 1811)
@@ -730,6 +730,7 @@
.k-publicspace-description {
font-size: 14px;
display: table-cell;
+ padding-right: 20px;
}
.k-publicspace-actions {
Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -41,6 +41,8 @@
Container moveContainer(Container container, Container newContainer);
+ Container purgeContainer(Container container);
+
Container renameFolder(Group group, Container container, String newName) throws DefaultException;
SearchResult<Container> search(String search);
Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -42,8 +42,10 @@
import cc.kune.domain.I18nLanguage;
import cc.kune.domain.finders.ContainerFinder;
import cc.kune.domain.finders.ContentFinder;
+import cc.kune.trash.server.TrashServerUtils;
import cc.kune.trash.shared.TrashToolConstants;
+import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@@ -120,16 +122,36 @@
}
if (container.isRoot()) {
// Cannot move root container
- throw new AccessViolationException();
+ throw new AccessViolationException("Trying to delete a root folder: " + container);
}
final Container oldContainer = container.getParent();
oldContainer.removeChild(container);
newContainer.addChild(container);
container.setParent(newContainer);
+ container.setToolName(newContainer.getToolName());
return persist(container);
}
@Override
+ public Container purgeContainer(final Container container) {
+ Preconditions.checkState(TrashServerUtils.inTrash(container),
+ "Trying to purge a not deleted container: " + container);
+ Preconditions.checkState(!container.isRoot(), "Trying to purge a root folder: " + container);
+ Preconditions.checkState(container.getChilds().size() == 0, "Container has folder childs");
+ Preconditions.checkState(container.getContents().size() == 0, "Container has content childs");
+ final Container parent = container.getParent();
+ parent.removeChild(container);
+ container.setParent(null);
+ persist(parent);
+ container.setOwner(null);
+ // persist(parent);
+ // merge(container);
+ // flush();
+ remove(container);
+ return parent;
+ }
+
+ @Override
public Container renameFolder(final Group group, final Container container, final String newName)
throws DefaultException {
FilenameUtils.checkBasicFilename(newName);
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManager.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManager.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -70,6 +70,8 @@
Content moveContent(Content content, Container newContainer);
+ Container purgeContent(Content content);
+
RateResult rateContent(User rater, Long contentId, Double value) throws DefaultException;
void removeAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -42,6 +42,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.xml.XMLWaveExtension;
+import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.I18nNotFoundException;
import cc.kune.core.client.errors.MoveOnSameContainerException;
@@ -60,7 +61,6 @@
import cc.kune.core.server.utils.FilenameUtils;
import cc.kune.core.shared.domain.ContentStatus;
import cc.kune.core.shared.domain.RateResult;
-import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
@@ -75,6 +75,7 @@
import cc.kune.domain.finders.UserFinder;
import cc.kune.events.server.utils.EventsCache;
import cc.kune.events.shared.EventsToolConstants;
+import cc.kune.trash.server.TrashServerUtils;
import cc.kune.wave.server.KuneWaveServerUtils;
import cc.kune.wave.server.ParticipantUtils;
import cc.kune.wave.server.kspecific.KuneWaveService;
@@ -82,6 +83,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import com.google.wave.api.Participants;
@Singleton
public class ContentManagerDefault extends DefaultManager<Content, Long> implements ContentManager {
@@ -183,15 +185,11 @@
}
private void clearEventsCacheIfNecessary(final Container previousParent) {
- if (previousParent.getToolName().equals(EventsToolConstants.NAME)) {
+ if (previousParent.getToolName().equals(EventsToolConstants.TOOL_NAME)) {
eventsCache.remove(previousParent);
}
}
- private void clearEventsCacheIfNecessary(final StateToken token) {
- clearEventsCacheIfNecessary(finder.getContainer(token.getFolder()));
- }
-
@Override
public Content copyContent(final User user, final Container destination, final Content contentToCopy) {
try {
@@ -324,7 +322,31 @@
return persist(content);
}
+ /**
+ * Purge content (permanent delete)
+ *
+ * @param content
+ * the content to purge
+ */
@Override
+ public Container purgeContent(final Content content) {
+ if (!TrashServerUtils.inTrash(content)) {
+ throw new AccessViolationException("Trying to purge a not deleted content:" + content);
+ }
+ if (content.isWave()) {
+ final WaveRef waveRef = KuneWaveServerUtils.getWaveRef(content);
+ final String author = getContentAuthor(content);
+ final Participants participants = kuneWaveManager.getParticipants(waveRef, author);
+ kuneWaveManager.delParticipants(waveRef, author, participantUtils.arrayFrom(participants));
+ }
+ content.authorsClear();
+ final Container container = content.getContainer();
+ container.removeContent(content);
+ remove(content);
+ return container;
+ }
+
+ @Override
public RateResult rateContent(final User rater, final Long contentId, final Double value)
throws DefaultException {
final Content content = finder.getContent(contentId);
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -49,6 +49,7 @@
private final InputStream groupLogo;
GroupManager groupManager;
private final InputStream personLogo;
+ private final InputStream unknownLogo;
@Inject
public EntityLogoDownloadManager(@Named(CoreSettings.RESOURCE_BASES) final List<String> resourceBases,
@@ -58,6 +59,8 @@
FileConstants.PERSON_NO_AVATAR_IMAGE);
groupLogo = FileDownloadManagerUtils.searchFileInResourcBases(resourceBases,
FileConstants.GROUP_NO_AVATAR_IMAGE);
+ unknownLogo = FileDownloadManagerUtils.searchFileInResourcBases(resourceBases,
+ FileConstants.NO_RESULT_AVATAR_IMAGE);
}
@Override
@@ -65,14 +68,19 @@
throws ServletException, IOException {
final StateToken stateToken = new StateToken(req.getParameter(FileConstants.TOKEN));
-
+ final String onlyUserS = req.getParameter(FileConstants.ONLY_USERS);
+ final boolean onlyUsers = Boolean.parseBoolean(onlyUserS);
Group group = Group.NO_GROUP;
try {
group = groupManager.findByShortName(stateToken.getGroup());
if (group == Group.NO_GROUP) {
- throw new NoResultException("Group not found trying to get the logo");
+ unknownResult(resp);
+ return;
}
-
+ if (onlyUsers && !group.isPersonal()) {
+ unknownResult(resp);
+ return;
+ }
if (!group.hasLogo()) {
FileDownloadManagerUtils.returnFile((group.isPersonal() ? personLogo : groupLogo),
resp.getOutputStream());
@@ -87,9 +95,12 @@
resp.getOutputStream().write(logo);
}
} catch (final NoResultException e) {
- FileDownloadManagerUtils.returnNotFound404(resp);
- return;
+ unknownResult(resp);
}
}
+ private void unknownResult(final HttpServletResponse resp) throws IOException {
+ FileDownloadManagerUtils.returnFile(unknownLogo, resp.getOutputStream());
+ }
+
}
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-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -75,8 +75,7 @@
import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
-import cc.kune.events.server.utils.EventsCache;
-import cc.kune.trash.shared.TrashToolConstants;
+import cc.kune.trash.server.TrashServerUtils;
import com.google.inject.Inject;
@@ -87,7 +86,6 @@
private final ContainerManager containerManager;
private final ContentManager contentManager;
private final CreationService creationService;
- private final EventsCache eventsCache;
private final FinderService finderService;
private final GroupManager groupManager;
private final Mapper mapper;
@@ -103,8 +101,7 @@
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final ContentManager contentManager,
final ContainerManager containerManager, final TagUserContentManager tagManager,
- final Mapper mapper, final ChatManager chatManager, final KuneWaveManager waveManager,
- final EventsCache eventsCache) {
+ final Mapper mapper, final ChatManager chatManager, final KuneWaveManager waveManager) {
this.finderService = finderService;
this.userSession = userSession;
this.accessService = accessService;
@@ -118,7 +115,6 @@
this.mapper = mapper;
this.chatManager = chatManager;
this.waveManager = waveManager;
- this.eventsCache = eventsCache;
}
@Override
@@ -134,7 +130,7 @@
@Override
@Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Administrator, mustCheckMembership = false)
@KuneTransactional
public StateContentDTO addContent(final String userHash, final StateToken parentToken,
final String title, final String typeId) throws DefaultException {
@@ -407,7 +403,10 @@
public StateContainerDTO moveContent(final String userHash, final StateToken movedToken,
final StateToken newContainerToken) throws DefaultException {
final User user = getCurrentUser();
- final boolean toTrash = newContainerToken.getTool().equals(TrashToolConstants.NAME);
+ final boolean toTrash = TrashServerUtils.isTrash(newContainerToken);
+
+ // FIXME: this not should be here ... should be in the managers
+
// Search the container id (because sometimes we get only #group.tool
// tokens)
final Long newContainerId = newContainerToken.hasGroupToolAndFolder() ? ContentUtils.parseId(newContainerToken.getFolder())
@@ -453,6 +452,28 @@
@Override
@Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Administrator)
+ @KuneTransactional
+ public StateContainerDTO purgeContainer(final String userHash, final StateToken token) {
+ final User user = getCurrentUser();
+ final Long containerId = ContentUtils.parseId(token.getFolder());
+ final Container container = containerManager.purgeContainer(finderService.getContainer(containerId));
+ return mapState(stateService.create(user, container), user);
+ }
+
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.content, accessRolRequired = AccessRol.Administrator)
+ @KuneTransactional
+ public StateContainerDTO purgeContent(final String userHash, final StateToken token) {
+ final User user = getCurrentUser();
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final Container container = contentManager.purgeContent(finderService.getContent(contentId));
+ return mapState(stateService.create(user, container), user);
+ }
+
+ @Override
+ @Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer)
@KuneTransactional
public RateResult rateContent(final String userHash, final StateToken token, final Double value)
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPCMock.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPCMock.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPCMock.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -132,6 +132,18 @@
}
@Override
+ public StateContainerDTO purgeContainer(final String userHash, final StateToken token) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public StateContainerDTO purgeContent(final String userHash, final StateToken token) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
public RateResult rateContent(final String userHash, final StateToken token, final Double value)
throws DefaultException {
// TODO Auto-generated method stub
Modified: trunk/src/main/java/cc/kune/core/server/state/StateAbstract.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateAbstract.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/state/StateAbstract.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -23,6 +23,7 @@
import cc.kune.core.shared.domain.utils.AccessRights;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Container;
import cc.kune.domain.Group;
import cc.kune.domain.ParticipationData;
import cc.kune.domain.SocialNetwork;
@@ -31,74 +32,92 @@
public abstract class StateAbstract {
- private List<String> enabledTools;
- private Group group;
- private StateToken stateToken;
- private String title;
- private SocialNetworkData socialNetworkData;
+ private List<String> enabledTools;
+ private Group group;
+ private Container rootContainer;
+ private SocialNetworkData socialNetworkData;
+ private StateToken stateToken;
+ private String title;
+ private String toolName;
- public StateAbstract() {
- }
+ public StateAbstract() {
+ }
- public List<String> getEnabledTools() {
- return enabledTools;
- }
+ public List<String> getEnabledTools() {
+ return enabledTools;
+ }
- public Group getGroup() {
- return group;
- }
+ public Group getGroup() {
+ return group;
+ }
- public SocialNetwork getGroupMembers() {
- return socialNetworkData.getGroupMembers();
- }
+ public SocialNetwork getGroupMembers() {
+ return socialNetworkData.getGroupMembers();
+ }
- public AccessRights getGroupRights() {
- return socialNetworkData.getGroupRights();
- }
+ public AccessRights getGroupRights() {
+ return socialNetworkData.getGroupRights();
+ }
- public ParticipationData getParticipation() {
- return socialNetworkData.getUserParticipation();
- }
+ public ParticipationData getParticipation() {
+ return socialNetworkData.getUserParticipation();
+ }
- public SocialNetworkData getSocialNetworkData() {
- return socialNetworkData;
- }
+ public Container getRootContainer() {
+ return rootContainer;
+ }
- public StateToken getStateToken() {
- return stateToken;
- }
+ public SocialNetworkData getSocialNetworkData() {
+ return socialNetworkData;
+ }
- public String getTitle() {
- return title;
- }
+ public StateToken getStateToken() {
+ return stateToken;
+ }
- public UserBuddiesData getUserBuddies() {
- return socialNetworkData.getUserBuddies();
- }
+ public String getTitle() {
+ return title;
+ }
- public void setEnabledTools(List<String> enabledTools) {
- this.enabledTools = enabledTools;
- }
+ public String getToolName() {
+ return toolName;
+ }
- public void setGroup(Group group) {
- this.group = group;
- }
+ public UserBuddiesData getUserBuddies() {
+ return socialNetworkData.getUserBuddies();
+ }
- public void setSocialNetworkData(SocialNetworkData socialNetworkData) {
- this.socialNetworkData = socialNetworkData;
- }
+ public void setEnabledTools(final List<String> enabledTools) {
+ this.enabledTools = enabledTools;
+ }
- public void setStateToken(StateToken stateToken) {
- this.stateToken = stateToken;
- }
+ public void setGroup(final Group group) {
+ this.group = group;
+ }
- public void setTitle(String title) {
- this.title = title;
- }
+ public void setRootContainer(final Container rootContainer) {
+ this.rootContainer = rootContainer;
+ }
- @Override
- public String toString() {
- return "State[" + getStateToken() + "]";
- }
+ public void setSocialNetworkData(final SocialNetworkData socialNetworkData) {
+ this.socialNetworkData = socialNetworkData;
+ }
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
+ }
+
+ @Override
+ public String toString() {
+ return "State[" + getStateToken() + "]";
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateContainer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateContainer.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/state/StateContainer.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,6 @@
*/
package cc.kune.core.server.state;
-
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.utils.AccessRights;
import cc.kune.domain.AccessLists;
@@ -29,97 +28,79 @@
public class StateContainer extends StateAbstract {
- private I18nLanguage language;
- private String typeId;
- private String toolName;
- private Container container;
- private Container rootContainer;
- private AccessRights containerRights;
- private License license;
- private TagCloudResult tagCloudResult;
- private AccessLists accessLists;
+ private AccessLists accessLists;
+ private Container container;
+ private AccessRights containerRights;
+ private I18nLanguage language;
+ private License license;
+ private TagCloudResult tagCloudResult;
+ private String typeId;
- public StateContainer() {
- }
+ public StateContainer() {
+ }
- public AccessLists getAccessLists() {
- return accessLists;
- }
+ public AccessLists getAccessLists() {
+ return accessLists;
+ }
- public Container getContainer() {
- return container;
- }
+ public Container getContainer() {
+ return container;
+ }
- public AccessRights getContainerRights() {
- return containerRights;
- }
+ public AccessRights getContainerRights() {
+ return containerRights;
+ }
- public I18nLanguage getLanguage() {
- return language;
- }
+ public I18nLanguage getLanguage() {
+ return language;
+ }
- public License getLicense() {
- return license;
- }
+ public License getLicense() {
+ return license;
+ }
- public Container getRootContainer() {
- return rootContainer;
- }
+ public TagCloudResult getTagCloudResult() {
+ return tagCloudResult;
+ }
- public TagCloudResult getTagCloudResult() {
- return tagCloudResult;
- }
+ public String getTypeId() {
+ return typeId;
+ }
- public String getToolName() {
- return toolName;
- }
+ public boolean isType(final String type) {
+ return getTypeId().equals(type);
+ }
- public String getTypeId() {
- return typeId;
- }
+ public void setAccessLists(final AccessLists accessLists) {
+ this.accessLists = accessLists;
+ }
- public boolean isType(String type) {
- return getTypeId().equals(type);
- }
+ public void setContainer(final Container container) {
+ this.container = container;
+ }
- public void setAccessLists(AccessLists accessLists) {
- this.accessLists = accessLists;
- }
+ public void setContainerRights(final AccessRights containerRights) {
+ this.containerRights = containerRights;
+ }
- public void setContainer(Container container) {
- this.container = container;
- }
+ public void setLanguage(final I18nLanguage language) {
+ this.language = language;
+ }
- public void setContainerRights(AccessRights containerRights) {
- this.containerRights = containerRights;
- }
+ public void setLicense(final License license) {
+ this.license = license;
+ }
- public void setLanguage(I18nLanguage language) {
- this.language = language;
- }
+ public void setTagCloudResult(final TagCloudResult tagCloudResult) {
+ this.tagCloudResult = tagCloudResult;
+ }
- public void setLicense(License license) {
- this.license = license;
- }
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
- public void setRootContainer(Container rootContainer) {
- this.rootContainer = rootContainer;
- }
-
- public void setTagCloudResult(TagCloudResult tagCloudResult) {
- this.tagCloudResult = tagCloudResult;
- }
-
- public void setToolName(String toolName) {
- this.toolName = toolName;
- }
-
- public void setTypeId(String typeId) {
- this.typeId = typeId;
- }
-
- @Override
- public String toString() {
- return "State[" + getStateToken() + "/" + getTypeId() + "]";
- }
+ @Override
+ public String toString() {
+ return "State[" + getStateToken() + "/" + getTypeId() + "]";
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -25,7 +25,6 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.server.access.AccessRightsService;
-import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.SocialNetworkManager;
import cc.kune.core.server.manager.TagUserContentManager;
@@ -46,7 +45,6 @@
@Singleton
public class StateServiceDefault implements StateService {
public static final Log LOG = LogFactory.getLog(StateServiceDefault.class);
- private final ContentManager contentManager;
private final GroupManager groupManager;
private final I18nTranslationService i18n;
private final KuneWaveService kuneWaveManager;
@@ -56,12 +54,11 @@
@Inject
public StateServiceDefault(final GroupManager groupManager,
- final SocialNetworkManager socialNetworkManager, final ContentManager contentManager,
- final TagUserContentManager tagManager, final AccessRightsService rightsService,
- final I18nTranslationService i18n, final KuneWaveService kuneWaveManager) {
+ final SocialNetworkManager socialNetworkManager, final TagUserContentManager tagManager,
+ final AccessRightsService rightsService, final I18nTranslationService i18n,
+ final KuneWaveService kuneWaveManager) {
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
- this.contentManager = contentManager;
this.tagManager = tagManager;
this.rightsService = rightsService;
this.i18n = i18n;
@@ -80,7 +77,6 @@
state.setTypeId(container.getTypeId());
state.setLanguage(container.getLanguage());
state.setStateToken(container.getStateToken());
- state.setRootContainer(calculateRootContainer(container));
state.setLicense(container.getOwner().getDefaultLicense());
state.setAccessLists(container.getAccessLists());
final Group group = container.getOwner();
@@ -139,7 +135,7 @@
state.setTitle(revision.getTitle());
}
final Container container = content.getContainer();
- state.setRootContainer(calculateRootContainer(container));
+
final License license = content.getLicense();
final Group group = container.getOwner();
state.setLicense(license == null ? group.getDefaultLicense() : license);
@@ -173,7 +169,9 @@
private void setCommon(final StateContainer state, final User userLogged, final Group group,
final Container container) {
- state.setToolName(container.getToolName());
+ final Container root = calculateRootContainer(container);
+ state.setRootContainer(root);
+ state.setToolName(root.getToolName());
state.setGroup(group);
state.setContainer(container);
state.setContainerRights(rightsService.get(userLogged, container.getAccessLists()));
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-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -89,7 +89,7 @@
public void register(final ServerTool tool) {
final String name = tool.getName();
final String rootName = tool.getRootName();
- if (tool.getName().equals(TrashToolConstants.NAME)) {
+ if (tool.getName().equals(TrashToolConstants.TOOL_NAME)) {
tools.put(name, tool);
// Trash is a special tool but we don't register it fully
return;
Modified: trunk/src/main/java/cc/kune/core/shared/FileConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -38,7 +38,9 @@
public final static int LOGO_MIN_HEIGHT = 28;
public final static int LOGO_MIN_WIDTH = 468;
public static final String LOGODOWNLOADSERVLET = ASITE_PREFIX + "servlets/EntityLogoDownloadManager";
- public final static String PERSON_NO_AVATAR_IMAGE = "others/unknown.jpg";
+ public static final String NO_RESULT_AVATAR_IMAGE = "others/unknown.jpg";
+ public final static String ONLY_USERS = "onlyusers";
+ public final static String PERSON_NO_AVATAR_IMAGE = "others/defuser.jpg";
public final static String TOKEN = "token";
public final static String TUTORIALS_PREFIX = "/tutorials/";
public final static String TYPE_ID = "typeid";
Modified: trunk/src/main/java/cc/kune/core/shared/dto/ContainerDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/ContainerDTO.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/dto/ContainerDTO.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -42,10 +42,20 @@
return absolutePath;
}
+ /**
+ * Gets the child folders.
+ *
+ * @return the childs
+ */
public List<ContainerSimpleDTO> getChilds() {
return childs;
}
+ /**
+ * Gets the child contents.
+ *
+ * @return the contents
+ */
public List<ContentSimpleDTO> getContents() {
return contents;
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,28 +19,32 @@
*/
package cc.kune.core.shared.dto;
+import cc.kune.core.shared.domain.utils.StateToken;
+
/**
* A item can be both a container or a content
*
*/
public class ContainerSimpleDTO extends AbstractContentSimpleDTO {
private String name;
- private Long parentFolderId;
+ private StateToken parentToken;
+ @Override
public String getName() {
return name;
}
- public Long getParentFolderId() {
- return parentFolderId;
+ public StateToken getParentToken() {
+ return parentToken;
}
+ @Override
public void setName(final String name) {
this.name = name;
}
- public void setParentFolderId(final Long parentFolderId) {
- this.parentFolderId = parentFolderId;
+ public void setParentToken(final StateToken parentToken) {
+ this.parentToken = parentToken;
}
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/StateAbstractDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/StateAbstractDTO.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/dto/StateAbstractDTO.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -27,75 +27,92 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public abstract class StateAbstractDTO implements IsSerializable {
+ private List<String> enabledTools;
+ private GroupDTO group;
+ private ContainerDTO rootContainer;
+ private SocialNetworkDataDTO socialNetworkData;
+ private StateToken stateToken;
+ private String title;
+ private String toolName;
- private List<String> enabledTools;
- private GroupDTO group;
- private StateToken stateToken;
- private String title;
- private SocialNetworkDataDTO socialNetworkData;
+ public StateAbstractDTO() {
+ }
- public StateAbstractDTO() {
- }
+ public List<String> getEnabledTools() {
+ return enabledTools;
+ }
- public List<String> getEnabledTools() {
- return enabledTools;
- }
+ public GroupDTO getGroup() {
+ return group;
+ }
- public GroupDTO getGroup() {
- return group;
- }
+ public SocialNetworkDTO getGroupMembers() {
+ return socialNetworkData.getGroupMembers();
+ }
- public SocialNetworkDTO getGroupMembers() {
- return socialNetworkData.getGroupMembers();
- }
+ public AccessRights getGroupRights() {
+ return socialNetworkData.getGroupRights();
+ }
- public AccessRights getGroupRights() {
- return socialNetworkData.getGroupRights();
- }
+ public ParticipationDataDTO getParticipation() {
+ return socialNetworkData.getUserParticipation();
+ }
- public ParticipationDataDTO getParticipation() {
- return socialNetworkData.getUserParticipation();
- }
+ public ContainerDTO getRootContainer() {
+ return rootContainer;
+ }
- public SocialNetworkDataDTO getSocialNetworkData() {
- return socialNetworkData;
- }
+ public SocialNetworkDataDTO getSocialNetworkData() {
+ return socialNetworkData;
+ }
- public StateToken getStateToken() {
- return stateToken;
- }
+ public StateToken getStateToken() {
+ return stateToken;
+ }
- public String getTitle() {
- return title;
- }
+ public String getTitle() {
+ return title;
+ }
- public UserBuddiesDataDTO getUserBuddies() {
- return socialNetworkData.getUserBuddies();
- }
+ public String getToolName() {
+ return toolName;
+ }
- public void setEnabledTools(final List<String> enabledTools) {
- this.enabledTools = enabledTools;
- }
+ public UserBuddiesDataDTO getUserBuddies() {
+ return socialNetworkData.getUserBuddies();
+ }
- public void setGroup(final GroupDTO group) {
- this.group = group;
- }
+ public void setEnabledTools(final List<String> enabledTools) {
+ this.enabledTools = enabledTools;
+ }
- public void setSocialNetworkData(final SocialNetworkDataDTO socialNetworkData) {
- this.socialNetworkData = socialNetworkData;
- }
+ public void setGroup(final GroupDTO group) {
+ this.group = group;
+ }
- public void setStateToken(final StateToken stateToken) {
- this.stateToken = stateToken;
- }
+ public void setRootContainer(final ContainerDTO rootContainer) {
+ this.rootContainer = rootContainer;
+ }
- public void setTitle(final String title) {
- this.title = title;
- }
+ public void setSocialNetworkData(final SocialNetworkDataDTO socialNetworkData) {
+ this.socialNetworkData = socialNetworkData;
+ }
- @Override
- public String toString() {
- return "StateDTO[" + getStateToken() + "]";
- }
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
+ }
+
+ @Override
+ public String toString() {
+ return "StateDTO[" + getStateToken() + "]";
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -31,9 +31,7 @@
private AccessRights containerRights;
private I18nLanguageDTO language;
private LicenseDTO license;
- private ContainerDTO rootContainer;
private TagCloudResult tagCloudResult;
- private String toolName;
private String typeId;
public StateContainerDTO() {
@@ -43,6 +41,7 @@
return accessLists;
}
+ @Override
public ContainerDTO getContainer() {
return container;
}
@@ -59,18 +58,10 @@
return license;
}
- public ContainerDTO getRootContainer() {
- return rootContainer;
- }
-
public TagCloudResult getTagCloudResult() {
return tagCloudResult;
}
- public String getToolName() {
- return toolName;
- }
-
@Override
public String getTypeId() {
return typeId;
@@ -100,18 +91,10 @@
this.license = license;
}
- public void setRootContainer(final ContainerDTO rootContainer) {
- this.rootContainer = rootContainer;
- }
-
public void setTagCloudResult(final TagCloudResult tagCloudResult) {
this.tagCloudResult = tagCloudResult;
}
- public void setToolName(final String toolName) {
- this.toolName = toolName;
- }
-
@Override
public void setTypeId(final String typeId) {
this.typeId = typeId;
Modified: trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -58,7 +58,8 @@
public String getLogoImageUrl(final String groupName) {
return prefix
- + new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, groupName)).toString();
+ + new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, groupName),
+ new UrlParam(FileConstants.ONLY_USERS, false)).toString();
}
public String getPrefix() {
@@ -71,7 +72,8 @@
public String getUserAvatar(final String username) {
return prefix
- + new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, username)).toString();
+ + new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, username),
+ new UrlParam(FileConstants.ONLY_USERS, true)).toString();
}
public String getUserAvatar(final UserSimpleDTO user) {
Modified: trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.docs.client;
-import static cc.kune.docs.shared.DocsToolConstants.NAME;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_FOLDER;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_ROOT;
@@ -45,7 +45,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_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(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
@@ -65,7 +65,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.docs.client.actions;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_FOLDER;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_ROOT;
@@ -41,10 +42,13 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -78,40 +82,44 @@
final Provider<SetAsHomePageMenuItem> setAsHomePage,
final Provider<CopyContentMenuItem> copyContent,
final Provider<WriteToParticipantsMenuItem> writeToParticipants,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final NewMenusForTypeIdsRegistry newMenusRegistry, final DocsFolderNewMenu foldersNewMenu,
final DocsNewMenu docsNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newDocIconBtn, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, foldersNewMenu, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, docsNewMenu, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newDocMenuItem, containers);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newFolderMenuItem, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newDocIconBtn, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, foldersNewMenu, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, docsNewMenu, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newDocMenuItem, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newFolderMenuItem, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, chatAbout, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
newMenusRegistry.register(TYPE_FOLDER, foldersNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, foldersNewMenu.get());
newMenusRegistry.register(TYPE_DOCUMENT,
Modified: trunk/src/main/java/cc/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/server/DocumentServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/docs/server/DocumentServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.docs.server;
-import static cc.kune.docs.shared.DocsToolConstants.NAME;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.ROOT_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_FOLDER;
@@ -49,7 +49,7 @@
public DocumentServerTool(final ContentManager contentManager,
final ContainerManager containerManager, final ToolConfigurationManager configurationManager,
final I18nTranslationService i18n, final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_DOCUMENT, TYPE_UPLOADEDFILE), Arrays.asList(
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_DOCUMENT, TYPE_UPLOADEDFILE), Arrays.asList(
TYPE_ROOT, TYPE_FOLDER), Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER),
contentManager, containerManager, creationService, configurationManager, i18n,
ServerToolTarget.forBoth);
Modified: trunk/src/main/java/cc/kune/docs/shared/DocsToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/shared/DocsToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/docs/shared/DocsToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -23,12 +23,12 @@
public final class DocsToolConstants {
- public static final String NAME = "docs";
+ public static final String TOOL_NAME = "docs";
public static final String ROOT_NAME = "documents";
- public static final String TYPE_DOCUMENT = NAME + "." + "doc";
- public static final String TYPE_FOLDER = NAME + "." + "folder";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
+ public static final String TYPE_DOCUMENT = TOOL_NAME + "." + "doc";
+ public static final String TYPE_FOLDER = TOOL_NAME + "." + "folder";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
+ public static final String TYPE_UPLOADEDFILE = TOOL_NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
private DocsToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/domain/Container.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Container.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/domain/Container.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -99,7 +99,7 @@
private String name;
@IndexedEmbedded(depth = 1, prefix = "owner_")
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne
private Group owner;
// Parent/Child pattern:
@@ -271,8 +271,9 @@
}
public void removeChild(final Container child) {
- child.setParent(null);
+ childs.size();
childs.remove(child);
+ // child.setParent(null);
}
public void removeContent(final Content content) {
Modified: trunk/src/main/java/cc/kune/domain/Content.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Content.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/domain/Content.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -168,6 +168,10 @@
}
}
+ public void authorsClear() {
+ authors.clear();
+ }
+
@Transient
public AccessLists getAccessLists() {
return hasAccessList() ? accessLists : getContainer().getAccessLists();
Modified: trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.events.client;
-import static cc.kune.events.shared.EventsToolConstants.NAME;
+import static cc.kune.events.shared.EventsToolConstants.TOOL_NAME;
import static cc.kune.events.shared.EventsToolConstants.ROOT_NAME;
import static cc.kune.events.shared.EventsToolConstants.TYPE_MEETING;
import static cc.kune.events.shared.EventsToolConstants.TYPE_ROOT;
@@ -41,7 +41,7 @@
public EventsClientTool(final I18nTranslationService i18n, final ToolSelector toolSelector,
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
- super(NAME, i18n.t(ROOT_NAME), i18n.t("A calendar to schedule activities and events"),
+ super(TOOL_NAME, i18n.t(ROOT_NAME), i18n.t("A calendar to schedule activities and events"),
icons.events(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
@@ -60,7 +60,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.events.client.actions;
+import static cc.kune.events.shared.EventsToolConstants.TOOL_NAME;
import static cc.kune.events.shared.EventsToolConstants.TYPE_MEETING;
import static cc.kune.events.shared.EventsToolConstants.TYPE_ROOT;
import cc.kune.core.client.actions.ActionRegistryByType;
@@ -36,9 +37,12 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -71,45 +75,52 @@
final Provider<EventRemoveMenuItem> eventRemoveMenuItem,
final Provider<CopyContentMenuItem> copyContent, final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<WriteToParticipantsMenuItem> writeToParticipants,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<ExportCalendarMenuItem> export, final Provider<CalendarGoNextBtn> calNextBtn,
final CalendarOnOverMenu onOverMenu, final Provider<CalendarGoTodayBtn> goToday,
final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, goToday, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, calPrevBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, cal1DayBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, cal3DaysBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, cal7DaysBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, calMonthBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, calNextBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, export, all);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, goToday, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, calPrevBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, cal1DayBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, cal3DaysBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, cal7DaysBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, calMonthBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, calNextBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, export, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
// On over calendar menu
- actionsRegistry.addAction(ActionGroups.TOPBAR, onOverMenu, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, onOverMenu, containers);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
eventOpenMenuItem.get();
eventAddMenuItem.get();
eventRemoveMenuItem.get();
- actionsRegistry.addAction(ActionGroups.TOPBAR, newEventBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newEventBtn, containers);
// For now, commented:
- // actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem,
+ // actionsRegistry.addAction(NAME, ActionGroups.ITEM_MENU,
+ // openContentMenuItem,
// contents);
- // actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem,
+ // actionsRegistry.addAction(NAME, ActionGroups.ITEM_MENU,
+ // openContentMenuItem,
// containersNoRoot);
- // actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem,
+ // actionsRegistry.addAction(NAME, ActionGroups.ITEM_MENU,
+ // delContentMenuItem,
// contents);
}
Modified: trunk/src/main/java/cc/kune/events/server/EventsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/EventsServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/events/server/EventsServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.events.server;
-import static cc.kune.events.shared.EventsToolConstants.NAME;
+import static cc.kune.events.shared.EventsToolConstants.TOOL_NAME;
import static cc.kune.events.shared.EventsToolConstants.ROOT_NAME;
import static cc.kune.events.shared.EventsToolConstants.TYPE_MEETING;
import static cc.kune.events.shared.EventsToolConstants.TYPE_ROOT;
@@ -59,7 +59,7 @@
public EventsServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService, final EventsCache eventsCache) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_MEETING), Arrays.asList(TYPE_ROOT),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_MEETING), Arrays.asList(TYPE_ROOT),
Collections.<String> emptyList(), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
creationService, configurationManager, i18n, ServerToolTarget.forBoth);
this.eventsCache = eventsCache;
Modified: trunk/src/main/java/cc/kune/events/shared/EventsToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/events/shared/EventsToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,11 +21,11 @@
public final class EventsToolConstants {
- public static final String NAME = "events";
+ public static final String TOOL_NAME = "events";
public static final String ROOT_NAME = "events";
- public static final String TYPE_MEETING = NAME + "." + "meeting";
+ public static final String TYPE_MEETING = TOOL_NAME + "." + "meeting";
public static final String TYPE_MEETING_DEF_GADGETNAME = "massmob";
- public static final String TYPE_ROOT = NAME + "." + "root";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
private EventsToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/gallery/server/GalleryServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gallery/server/GalleryServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gallery/server/GalleryServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.gallery.server;
-import static cc.kune.gallery.shared.GalleryToolConstants.NAME;
+import static cc.kune.gallery.shared.GalleryToolConstants.TOOL_NAME;
import static cc.kune.gallery.shared.GalleryToolConstants.ROOT_NAME;
import static cc.kune.gallery.shared.GalleryToolConstants.TYPE_ALBUM;
import static cc.kune.gallery.shared.GalleryToolConstants.TYPE_ROOT;
@@ -46,7 +46,7 @@
public GalleryServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_UPLOADEDFILE), Arrays.asList(TYPE_ROOT,
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_UPLOADEDFILE), Arrays.asList(TYPE_ROOT,
TYPE_ALBUM), Arrays.asList(TYPE_ALBUM), Arrays.asList(TYPE_ROOT, TYPE_ALBUM), contentManager,
containerManager, creationService, configurationManager, i18n, ServerToolTarget.forBoth);
}
Modified: trunk/src/main/java/cc/kune/gallery/shared/GalleryToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/gallery/shared/GalleryToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gallery/shared/GalleryToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -22,11 +22,11 @@
import cc.kune.core.shared.ToolConstants;
public final class GalleryToolConstants {
- public static final String NAME = "gallery";
+ public static final String TOOL_NAME = "gallery";
public static final String ROOT_NAME = "gallery";
- public static final String TYPE_ALBUM = NAME + "." + "album";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
+ public static final String TYPE_ALBUM = TOOL_NAME + "." + "album";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
+ public static final String TYPE_UPLOADEDFILE = TOOL_NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
private GalleryToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.gspace.client;
-import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
+import cc.kune.gspace.client.armor.GSpaceArmorDefault;
import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
import com.google.gwt.core.client.EntryPoint;
@@ -35,7 +35,7 @@
resources.style().ensureInjected();
final RootLayoutPanel rootPanel = RootLayoutPanel.get();
- final GSpaceArmorImpl armor = new GSpaceArmorImpl(null);
+ final GSpaceArmorDefault armor = new GSpaceArmorDefault(null);
final InlineLabel icons = new InlineLabel("Icons");
final InlineLabel login = new InlineLabel("Login");
final InlineLabel logo = new InlineLabel("Logo");
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -26,13 +26,14 @@
import cc.kune.core.client.sn.AllMembersGroupSNDropController;
import cc.kune.core.client.sn.CollabsGroupSNDropController;
import cc.kune.core.client.sn.actions.WriteToBuddyHeaderButton;
+import cc.kune.gspace.client.actions.ActionUtils;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ContentViewerOptionsShareSubMenu;
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.armor.GSpaceArmor;
-import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
+import cc.kune.gspace.client.armor.GSpaceArmorDefault;
import cc.kune.gspace.client.i18n.I18nTranslator;
import cc.kune.gspace.client.i18n.I18nTranslatorPanel;
import cc.kune.gspace.client.i18n.I18nTranslatorPresenter;
@@ -141,6 +142,7 @@
*/
@Override
protected void configure() {
+ requestStaticInjection(ActionUtils.class);
s(PathToolbarUtils.class);
s(FolderViewerUtils.class);
s(ContentDropController.class);
@@ -151,8 +153,8 @@
EntityLicensePanel.class, EntityLicensePresenter.EntityLicenseProxy.class);
bindPresenter(TagsSummaryPresenter.class, TagsSummaryPresenter.TagsSummaryView.class,
TagsSummaryPanel.class, TagsSummaryPresenter.TagsSummaryProxy.class);
- bind(GSpaceArmorImpl.class).in(Singleton.class);
- bind(GSpaceArmor.class).to(GSpaceArmorImpl.class).in(Singleton.class);
+ bind(GSpaceArmorDefault.class).in(Singleton.class);
+ bind(GSpaceArmor.class).to(GSpaceArmorDefault.class).in(Singleton.class);
bind(GSpaceParts.class).asEagerSingleton();
bindPresenter(ToolSelectorPresenter.class, ToolSelectorPresenter.ToolSelectorView.class,
ToolSelectorPanel.class, ToolSelectorPresenter.ToolSelectorProxy.class);
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,14 +21,28 @@
/**
* A group of actions that must be grouped and showed in some perspective (on
- * edit, etc)
+ * edit, etc).
*/
public final class ActionGroups {
+
+ /**
+ * The Constant BOTTOMBAR identifies actions in the bottom bar, below the
+ * content.
+ */
public final static String BOTTOMBAR = "bottombar";
- public final static String EDIT = "edit";
+
+ /**
+ * The Constant ITEM_MENU identifies actions in the menu of each item of a
+ * folder list.
+ */
public final static String ITEM_MENU = "menu-item";
+
+ /** The Constant TOPBAR identifies actions in the top bar, above the content. */
public final static String TOPBAR = "topbar";
+ /**
+ * Instantiates a new action groups.
+ */
private ActionGroups() {
}
}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/ActionUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2012 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class ActionUtils {
+ @Inject
+ private static Session session;
+
+ public static StateToken getActionToken(final ActionEvent event) {
+ final boolean inContent = session.getCurrentStateToken().hasAll();
+ final StateToken token = inContent ? session.getCurrentStateToken()
+ : ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
+ return token;
+ }
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/CopyContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/CopyContentMenuItem.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/CopyContentMenuItem.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -30,7 +30,6 @@
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.AbstractContentSimpleDTO;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.StateContentDTO;
@@ -58,9 +57,8 @@
@Override
public void actionPerformed(final ActionEvent event) {
NotifyUser.showProgress(i18n.t("Copying"));
+ final StateToken token = ActionUtils.getActionToken(event);
final boolean inContent = session.getCurrentStateToken().hasAll();
- final StateToken token = inContent ? session.getCurrentStateToken()
- : ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
final StateToken parentToken = inContent ? session.getContentState().getContainer().getStateToken()
: session.getCurrentStateToken();
contentService.copyContent(session.getUserHash(), parentToken, token,
Added: trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentBtn.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.i18n.I18n;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+import com.google.inject.Inject;
+
+public class PurgeContentBtn extends ButtonDescriptor {
+
+ public static class PurgeContentAction extends RolAction {
+
+ private final ContentServiceHelper contentService;
+
+ @Inject
+ public PurgeContentAction(final ContentServiceHelper contentService, final CoreResources res) {
+ super(AccessRolDTO.Administrator, true);
+ this.contentService = contentService;
+ this.withText(I18n.t("Delete permanently")).withIcon(res.cancel());
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ contentService.purgeContent(ActionUtils.getActionToken(event));
+ }
+
+ }
+
+ @Inject
+ public PurgeContentBtn(final PurgeContentAction action) {
+ super(action);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/PurgeContentMenuItem.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.gspace.client.actions.PurgeContentBtn.PurgeContentAction;
+
+import com.google.inject.Inject;
+
+public class PurgeContentMenuItem extends MenuItemDescriptor {
+
+ @Inject
+ public PurgeContentMenuItem(final I18nTranslationService i18n, final PurgeContentAction action,
+ final CoreResources res) {
+ super(action);
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.java (from rev 1806, trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,314 @@
+/*
+ *
+ * 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.gspace.client.armor;
+
+import org.cobogw.gwt.user.client.CSS;
+
+import cc.kune.common.client.actions.ui.ActionFlowPanel;
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+import cc.kune.common.shared.utils.Pair;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.SplitLayoutPanel;
+import com.google.gwt.user.client.ui.TabLayoutPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GSpaceArmorDefault extends Composite implements GSpaceArmor {
+
+ interface GSpaceArmorDefaultUiBinder extends UiBinder<Widget, GSpaceArmorDefault> {
+ }
+ private static final int CENTER_NORTH_HEIGHT = 153;
+ private static final int CENTER_SOUTH_HEIGHT = 36;
+ private static final int EAST_WIDTH = 220;
+
+ private static GSpaceArmorDefaultUiBinder uiBinder = GWT.create(GSpaceArmorDefaultUiBinder.class);
+
+ @UiField
+ VerticalPanel centerNorth;
+ @UiField
+ ScrollPanel centerScroll;
+ @UiField
+ FlowPanel docContainer;
+ @UiField
+ DockLayoutPanel docContainerParent;
+ @UiField
+ FlowPanel docFooter;
+ private final ActionFlowPanel docFooterToolbar;
+ @UiField
+ FlowPanel docHeader;
+ @UiField
+ FlowPanel docSubheader;
+ @UiField
+ FlowPanel entityFooter;
+ private final ActionFlowPanel entityFooterToolbar;
+ @UiField
+ FlowPanel entityHeader;
+ @UiField
+ FlowPanel entityToolsCenter;
+ @UiField
+ FlowPanel entityToolsContainer;
+ @UiField
+ FlowPanel entityToolsNorth;
+ @UiField
+ FlowPanel entityToolsSouth;
+ @UiField
+ SplitLayoutPanel groupSpace;
+ @UiField
+ SimplePanel groupSpaceWrapper;
+ private final ActionFlowPanel headerToolbar;
+ @UiField
+ SimplePanel homeSpace;
+ @UiField
+ DockLayoutPanel mainpanel;
+ @UiField
+ SimplePanel publicSpace;
+ @UiField
+ FlowPanel sitebar;
+ @UiField
+ DockLayoutPanel splitCenter;
+ @UiField
+ DockLayoutPanel splitEast;
+ private final ActionFlowPanel subheaderToolbar;
+ @UiField
+ TabLayoutPanel tabs;
+ private final ActionFlowPanel toolsSouthToolbar;
+ @UiField
+ FlowPanel userSpace;
+
+ @Inject
+ public GSpaceArmorDefault(final Provider<ActionFlowPanel> toolbarProv) {
+ initWidget(uiBinder.createAndBindUi(this));
+ groupSpace.setWidgetMinSize(splitEast, 150);
+ DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
+ "visible");
+ DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsContainer),
+ "overflow", "visible");
+ docFooterToolbar = toolbarProv.get();
+ headerToolbar = toolbarProv.get();
+ subheaderToolbar = toolbarProv.get();
+ toolsSouthToolbar = toolbarProv.get();
+ entityFooterToolbar = toolbarProv.get();
+ getDocHeader().add(headerToolbar);
+ getDocSubheader().add(subheaderToolbar);
+ getDocFooter().add(docFooterToolbar);
+ getEntityToolsSouth().add(toolsSouthToolbar);
+ getEntityFooter().add(entityFooterToolbar);
+ entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
+ // entityToolsSouth.setVisible(false);
+ mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
+ enableCenterScroll(true);
+ }
+
+ @Override
+ public void clearBackImage() {
+ final String bodyProp = "#FFFFFF";
+ DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
+ }
+
+ @Override
+ public void enableCenterScroll(final boolean enable) {
+ // TODO use here Element.getStyle()...
+ if (enable) {
+ centerScroll.setAlwaysShowScrollBars(false);
+ DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
+ DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
+ "relative");
+ } else {
+ centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
+ DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
+ DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
+ }
+ }
+
+ @Override
+ public ForIsWidget getDocContainer() {
+ return docContainer;
+ }
+
+ @Override
+ public Pair<Integer, Integer> getDocContainerSize() {
+ return Pair.create(centerScroll.getOffsetHeight(), centerScroll.getOffsetWidth());
+ }
+
+ @Override
+ public ForIsWidget getDocFooter() {
+ return docFooter;
+ }
+
+ @Override
+ public IsActionExtensible getDocFooterToolbar() {
+ return docFooterToolbar;
+ }
+
+ @Override
+ public ForIsWidget getDocHeader() {
+ return docHeader;
+ }
+
+ @Override
+ public ForIsWidget getDocSubheader() {
+ return docSubheader;
+ }
+
+ @Override
+ public ForIsWidget getEntityFooter() {
+ return entityFooter;
+ }
+
+ @Override
+ public IsActionExtensible getEntityFooterToolbar() {
+ return entityFooterToolbar;
+ }
+
+ @Override
+ public ForIsWidget getEntityHeader() {
+ return entityHeader;
+ }
+
+ @Override
+ public ForIsWidget getEntityToolsCenter() {
+ return entityToolsCenter;
+ }
+
+ @Override
+ public ForIsWidget getEntityToolsNorth() {
+ return entityToolsNorth;
+ }
+
+ @Override
+ public ForIsWidget getEntityToolsSouth() {
+ return entityToolsSouth;
+ }
+
+ @Override
+ public IsActionExtensible getHeaderToolbar() {
+ return headerToolbar;
+ }
+
+ @Override
+ public SimplePanel getHomeSpace() {
+ return homeSpace;
+ }
+
+ @Override
+ public IsWidget getMainpanel() {
+ return mainpanel;
+ }
+
+ @Override
+ public SimplePanel getPublicSpace() {
+ return publicSpace;
+ }
+
+ @Override
+ public ForIsWidget getSitebar() {
+ return sitebar;
+ }
+
+ @Override
+ public IsActionExtensible getSubheaderToolbar() {
+ return subheaderToolbar;
+ }
+
+ @Override
+ public IsActionExtensible getToolsSouthToolbar() {
+ return toolsSouthToolbar;
+ }
+
+ @Override
+ public ForIsWidget getUserSpace() {
+ return userSpace;
+ }
+
+ @Override
+ public void selectGroupSpace() {
+ tabs.selectTab(groupSpaceWrapper);
+ }
+
+ @Override
+ public void selectHomeSpace() {
+ tabs.selectTab(homeSpace);
+ }
+
+ @Override
+ public void selectPublicSpace() {
+ tabs.selectTab(publicSpace);
+ }
+
+ @Override
+ public void selectUserSpace() {
+ tabs.selectTab(userSpace);
+ }
+
+ @Override
+ public void setBackImage(final String url) {
+ final String bodyProp = "#FFFFFF url('" + url + "') fixed top left";
+ DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
+ }
+
+ @Override
+ public void setMaximized(final boolean maximized) {
+ // setMaximized(docFooter.getParent(), maximized);
+ // setMaximized(entityFooter.getParent(), maximized);
+ // setMaximized(entityHeader.getParent(), maximized);
+ // setMaximized(entityToolsContainer, maximized);
+ // splitCenter.setWidgetSize(centerScroll, getAbsoluteLeft())
+ // setMaximized(splitCenter.getWidget(0), maximized);
+ // setMaximized(splitCenter.getWidget(2), maximized);
+ // setMaximized(splitEast, maximized);
+ groupSpace.setWidgetSize(splitEast, maximized ? 0 : EAST_WIDTH);
+ splitCenter.setWidgetSize(centerNorth, maximized ? 7 : CENTER_NORTH_HEIGHT);
+ splitCenter.setWidgetSize(entityFooter, maximized ? 7 : CENTER_SOUTH_HEIGHT);
+ }
+
+ private void setMaximized(final Widget widget, final boolean maximized) {
+ widget.setVisible(!maximized);
+ if (maximized) {
+ // // $((Widget) gsArmor.getHeaderToolbar()).as(Effects).
+ // $(widget).as(Effects).slideDown(new Function() {
+ // @Override
+ // public void f() {
+ // }
+ // });
+ } else {
+ // $(widget).parent().as(Effects).slideUp(new Function() {
+ // @Override
+ // public void f() {
+ // }
+ // });
+ }
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.ui.xml (from rev 1806, trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmorDefault.ui.xml 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,126 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:co="urn:import:cc.kune.core.client" xmlns:kp="urn:import:cc.kune.pspace.client"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:with field='res'
+ type='cc.kune.gspace.client.armor.resources.GSpaceArmorResources'/>
+ <ui:style>
+ .frame {
+ border: 0px;
+ margin: 0px;
+ }
+ </ui:style>
+ <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
+ unit="PX">
+ <g:north size="23">
+ <g:FlowPanel ui:field="sitebar" height="23px"
+ styleName='{res.style.siteBar}'>
+ </g:FlowPanel>
+ </g:north>
+ <g:center>
+ <g:TabLayoutPanel width="100%" height="100%"
+ barUnit='PX' barHeight='0' ui:field="tabs">
+ <g:tab>
+ <g:header size='0'/>
+ <g:SimplePanel styleName="k-space" ui:field="homeSpace"
+ width="100%" height="100%"></g:SimplePanel>
+ </g:tab>
+ <g:tab>
+ <g:header size='0'/>
+ <g:FlowPanel ui:field="userSpace" styleName="k-space"
+ width="100%" height="100%">
+ <!-- <g:Frame url="/" styleName="{style.frame}" -->
+ <!-- ui:field="frame" width="100%" height="100%" /> -->
+ </g:FlowPanel>
+ </g:tab>
+ <g:tab>
+ <g:header size='0'/>
+ <g:SimplePanel ui:field="groupSpaceWrapper"
+ styleName="k-group-space">
+ <g:SplitLayoutPanel width="100%" height="100%"
+ styleName="k-space" ui:field="groupSpace">
+ <g:center size="1.0">
+ <g:DockLayoutPanel unit="PX" ui:field="splitCenter"
+ styleName="{res.style.entityCentralContainer}">
+ <g:north size="153">
+ <g:VerticalPanel width="100%" ui:field="centerNorth"
+ height="153px">
+ <g:FlowPanel height="70px" width="100%"
+ styleName="{res.style.entityHeader}" ui:field="entityHeader">
+ <!--<g:RichTextArea width="100%" height="70px" /> -->
+ </g:FlowPanel>
+ <g:FlowPanel width="100%" height="38px"
+ styleName="{res.style.docHeader}" ui:field="docHeader">
+ </g:FlowPanel>
+ <g:HTMLPanel ui:field="arrow"
+ styleName="{res.style.docSubheaderArrow}"/>
+ <g:FlowPanel width="100%" height="45px"
+ styleName="{res.style.docSubheader}" ui:field="docSubheader">
+ </g:FlowPanel>
+ </g:VerticalPanel>
+ </g:north>
+ <g:center>
+ <g:DockLayoutPanel unit="PX"
+ styleName="{res.style.docEditorMargin}" ui:field="docContainerParent">
+ <g:west size="10">
+ <g:SimplePanel/>
+ </g:west>
+ <g:east size="10">
+ <g:SimplePanel/>
+ </g:east>
+ <g:center>
+ <g:ScrollPanel ui:field="centerScroll"
+ styleName="{res.style.docEditor}">
+ <g:FlowPanel width="auto" height="auto"
+ styleName="{res.style.docEditorContainer}"
+ ui:field="docContainer"/>
+ </g:ScrollPanel>
+ </g:center>
+ <g:south size="33.0">
+ <g:VerticalPanel height="33px"
+ width="100%" styleName="{res.style.docFooter}">
+ <g:FlowPanel width="100%" height="33"
+ ui:field="docFooter">
+ </g:FlowPanel>
+ </g:VerticalPanel>
+ </g:south>
+ </g:DockLayoutPanel>
+ </g:center>
+ <g:south size="36">
+ <g:FlowPanel height="36px" width="100%"
+ styleName="{res.style.entityFooter}" ui:field="entityFooter">
+ </g:FlowPanel>
+ </g:south>
+ </g:DockLayoutPanel>
+ </g:center>
+ <!-- east to RTL (plus css changes in corners and menus) -->
+ <g:west size="202.0">
+ <g:DockLayoutPanel unit="PX"
+ styleName="{res.style.entityTools}" ui:field="splitEast">
+ <g:center>
+ <g:FlowPanel ui:field="entityToolsContainer">
+ <g:FlowPanel width="100%" ui:field="entityToolsNorth"
+ styleName="{res.style.entityToolsNorth}"></g:FlowPanel>
+ <g:FlowPanel width="100%" ui:field="entityToolsCenter"
+ styleName="{res.style.entityToolsCenter}">
+ </g:FlowPanel>
+ </g:FlowPanel>
+ </g:center>
+ <g:south size="98">
+ <g:FlowPanel styleName="{res.style.entityToolsSouth}"
+ ui:field="entityToolsSouth" width="100%"/>
+ </g:south>
+ </g:DockLayoutPanel>
+ </g:west>
+ </g:SplitLayoutPanel>
+ </g:SimplePanel>
+ </g:tab>
+ <g:tab>
+ <g:header size='0'/>
+ <g:SimplePanel ui:field="publicSpace" width="100%"
+ styleName="k-space" height="100%"></g:SimplePanel>
+ </g:tab>
+ </g:TabLayoutPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+</ui:UiBinder>
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,69 @@
+/*
+ *
+ * Copyright (C) 2007-2012 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.gspace.client.armor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class GSpaceCenterPanel extends Composite {
+
+ interface GSpaceCenterPanelUiBinder extends UiBinder<Widget, GSpaceCenterPanel> {
+ }
+ private static GSpaceCenterPanelUiBinder uiBinder = GWT.create(GSpaceCenterPanelUiBinder.class);
+ @UiField
+ ScrollPanel centerScroll;
+ @UiField
+ DeckPanel deck;
+ @UiField
+ FlowPanel infoPanel;
+ @UiField
+ FlowPanel mainPanel;
+
+ public GSpaceCenterPanel() {
+ initWidget(uiBinder.createAndBindUi(this));
+ }
+
+ public void enableCenterScroll(final boolean enable) {
+ // TODO use here Element.getStyle()...
+ if (enable) {
+ // Move up???
+ centerScroll.setAlwaysShowScrollBars(false);
+ DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
+ DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
+ "relative");
+ } else {
+ centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
+ DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
+ DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
+ }
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceCenterPanel.ui.xml 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,16 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:with field='res'
+ type='cc.kune.gspace.client.armor.resources.GSpaceArmorResources'/>
+ <ui:style>
+ </ui:style>
+ <g:ScrollPanel ui:field="centerScroll" styleName="{res.style.docEditor}">
+ <g:DeckPanel ui:field="deck" width="auto" height="auto">
+ <g:FlowPanel width="auto" height="auto"
+ styleName="{res.style.docEditorContainer}" ui:field="infoPanel"/>
+ <g:FlowPanel width="auto" height="auto"
+ styleName="{res.style.docEditorContainer}" ui:field="mainPanel"/>
+ </g:DeckPanel>
+ </g:ScrollPanel>
+</ui:UiBinder>
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -1,315 +0,0 @@
-/*
- *
- * 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.gspace.client.armor.impl;
-
-import org.cobogw.gwt.user.client.CSS;
-
-import cc.kune.common.client.actions.ui.ActionFlowPanel;
-import cc.kune.common.client.actions.ui.IsActionExtensible;
-import cc.kune.common.shared.utils.Pair;
-import cc.kune.gspace.client.armor.GSpaceArmor;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.Style.Overflow;
-import com.google.gwt.dom.client.Style.Position;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DockLayoutPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.SplitLayoutPanel;
-import com.google.gwt.user.client.ui.TabLayoutPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GSpaceArmorImpl extends Composite implements GSpaceArmor {
-
- interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
- }
- private static final int CENTER_NORTH_HEIGHT = 153;
- private static final int CENTER_SOUTH_HEIGHT = 36;
- private static final int EAST_WIDTH = 220;
-
- private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
-
- @UiField
- VerticalPanel centerNorth;
- @UiField
- ScrollPanel centerScroll;
- @UiField
- FlowPanel docContainer;
- @UiField
- DockLayoutPanel docContainerParent;
- @UiField
- FlowPanel docFooter;
- private final ActionFlowPanel docFooterToolbar;
- @UiField
- FlowPanel docHeader;
- @UiField
- FlowPanel docSubheader;
- @UiField
- FlowPanel entityFooter;
- private final ActionFlowPanel entityFooterToolbar;
- @UiField
- FlowPanel entityHeader;
- @UiField
- FlowPanel entityToolsCenter;
- @UiField
- FlowPanel entityToolsContainer;
- @UiField
- FlowPanel entityToolsNorth;
- @UiField
- FlowPanel entityToolsSouth;
- @UiField
- SplitLayoutPanel groupSpace;
- @UiField
- SimplePanel groupSpaceWrapper;
- private final ActionFlowPanel headerToolbar;
- @UiField
- SimplePanel homeSpace;
- @UiField
- DockLayoutPanel mainpanel;
- @UiField
- SimplePanel publicSpace;
- @UiField
- FlowPanel sitebar;
- @UiField
- DockLayoutPanel splitCenter;
- @UiField
- DockLayoutPanel splitEast;
- private final ActionFlowPanel subheaderToolbar;
- @UiField
- TabLayoutPanel tabs;
- private final ActionFlowPanel toolsSouthToolbar;
- @UiField
- FlowPanel userSpace;
-
- @Inject
- public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
- initWidget(uiBinder.createAndBindUi(this));
- groupSpace.setWidgetMinSize(splitEast, 150);
- DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
- "visible");
- DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsContainer),
- "overflow", "visible");
- docFooterToolbar = toolbarProv.get();
- headerToolbar = toolbarProv.get();
- subheaderToolbar = toolbarProv.get();
- toolsSouthToolbar = toolbarProv.get();
- entityFooterToolbar = toolbarProv.get();
- getDocHeader().add(headerToolbar);
- getDocSubheader().add(subheaderToolbar);
- getDocFooter().add(docFooterToolbar);
- getEntityToolsSouth().add(toolsSouthToolbar);
- getEntityFooter().add(entityFooterToolbar);
- entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
- // entityToolsSouth.setVisible(false);
- mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
- enableCenterScroll(true);
- }
-
- @Override
- public void clearBackImage() {
- final String bodyProp = "#FFFFFF";
- DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
- }
-
- @Override
- public void enableCenterScroll(final boolean enable) {
- // TODO use here Element.getStyle()...
- if (enable) {
- centerScroll.setAlwaysShowScrollBars(false);
- DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
- DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
- "relative");
- } else {
- centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
- DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
- DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
- }
- }
-
- @Override
- public ForIsWidget getDocContainer() {
- return docContainer;
- }
-
- @Override
- public Pair<Integer, Integer> getDocContainerSize() {
- return Pair.create(centerScroll.getOffsetHeight(), centerScroll.getOffsetWidth());
- }
-
- @Override
- public ForIsWidget getDocFooter() {
- return docFooter;
- }
-
- @Override
- public IsActionExtensible getDocFooterToolbar() {
- return docFooterToolbar;
- }
-
- @Override
- public ForIsWidget getDocHeader() {
- return docHeader;
- }
-
- @Override
- public ForIsWidget getDocSubheader() {
- return docSubheader;
- }
-
- @Override
- public ForIsWidget getEntityFooter() {
- return entityFooter;
- }
-
- @Override
- public IsActionExtensible getEntityFooterToolbar() {
- return entityFooterToolbar;
- }
-
- @Override
- public ForIsWidget getEntityHeader() {
- return entityHeader;
- }
-
- @Override
- public ForIsWidget getEntityToolsCenter() {
- return entityToolsCenter;
- }
-
- @Override
- public ForIsWidget getEntityToolsNorth() {
- return entityToolsNorth;
- }
-
- @Override
- public ForIsWidget getEntityToolsSouth() {
- return entityToolsSouth;
- }
-
- @Override
- public IsActionExtensible getHeaderToolbar() {
- return headerToolbar;
- }
-
- @Override
- public SimplePanel getHomeSpace() {
- return homeSpace;
- }
-
- @Override
- public IsWidget getMainpanel() {
- return mainpanel;
- }
-
- @Override
- public SimplePanel getPublicSpace() {
- return publicSpace;
- }
-
- @Override
- public ForIsWidget getSitebar() {
- return sitebar;
- }
-
- @Override
- public IsActionExtensible getSubheaderToolbar() {
- return subheaderToolbar;
- }
-
- @Override
- public IsActionExtensible getToolsSouthToolbar() {
- return toolsSouthToolbar;
- }
-
- @Override
- public ForIsWidget getUserSpace() {
- return userSpace;
- }
-
- @Override
- public void selectGroupSpace() {
- tabs.selectTab(groupSpaceWrapper);
- }
-
- @Override
- public void selectHomeSpace() {
- tabs.selectTab(homeSpace);
- }
-
- @Override
- public void selectPublicSpace() {
- tabs.selectTab(publicSpace);
- }
-
- @Override
- public void selectUserSpace() {
- tabs.selectTab(userSpace);
- }
-
- @Override
- public void setBackImage(final String url) {
- final String bodyProp = "#FFFFFF url('" + url + "') fixed top left";
- DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
- }
-
- @Override
- public void setMaximized(final boolean maximized) {
- // setMaximized(docFooter.getParent(), maximized);
- // setMaximized(entityFooter.getParent(), maximized);
- // setMaximized(entityHeader.getParent(), maximized);
- // setMaximized(entityToolsContainer, maximized);
- // splitCenter.setWidgetSize(centerScroll, getAbsoluteLeft())
- // setMaximized(splitCenter.getWidget(0), maximized);
- // setMaximized(splitCenter.getWidget(2), maximized);
- // setMaximized(splitEast, maximized);
- groupSpace.setWidgetSize(splitEast, maximized ? 0 : EAST_WIDTH);
- splitCenter.setWidgetSize(centerNorth, maximized ? 7 : CENTER_NORTH_HEIGHT);
- splitCenter.setWidgetSize(entityFooter, maximized ? 7 : CENTER_SOUTH_HEIGHT);
- }
-
- private void setMaximized(final Widget widget, final boolean maximized) {
- widget.setVisible(!maximized);
- if (maximized) {
- // // $((Widget) gsArmor.getHeaderToolbar()).as(Effects).
- // $(widget).as(Effects).slideDown(new Function() {
- // @Override
- // public void f() {
- // }
- // });
- } else {
- // $(widget).parent().as(Effects).slideUp(new Function() {
- // @Override
- // public void f() {
- // }
- // });
- }
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml 2012-03-31 17:43:11 UTC (rev 1811)
@@ -1,126 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:co="urn:import:cc.kune.core.client" xmlns:kp="urn:import:cc.kune.pspace.client"
- xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <ui:with field='res'
- type='cc.kune.gspace.client.armor.resources.GSpaceArmorResources'/>
- <ui:style>
- .frame {
- border: 0px;
- margin: 0px;
- }
- </ui:style>
- <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
- unit="PX">
- <g:north size="23">
- <g:FlowPanel ui:field="sitebar" height="23px"
- styleName='{res.style.siteBar}'>
- </g:FlowPanel>
- </g:north>
- <g:center>
- <g:TabLayoutPanel width="100%" height="100%"
- barUnit='PX' barHeight='0' ui:field="tabs">
- <g:tab>
- <g:header size='0'/>
- <g:SimplePanel styleName="k-space" ui:field="homeSpace"
- width="100%" height="100%"></g:SimplePanel>
- </g:tab>
- <g:tab>
- <g:header size='0'/>
- <g:FlowPanel ui:field="userSpace" styleName="k-space"
- width="100%" height="100%">
- <!-- <g:Frame url="/" styleName="{style.frame}" -->
- <!-- ui:field="frame" width="100%" height="100%" /> -->
- </g:FlowPanel>
- </g:tab>
- <g:tab>
- <g:header size='0'/>
- <g:SimplePanel ui:field="groupSpaceWrapper"
- styleName="k-group-space">
- <g:SplitLayoutPanel width="100%" height="100%"
- styleName="k-space" ui:field="groupSpace">
- <g:center size="1.0">
- <g:DockLayoutPanel unit="PX" ui:field="splitCenter"
- styleName="{res.style.entityCentralContainer}">
- <g:north size="153">
- <g:VerticalPanel width="100%" ui:field="centerNorth"
- height="153px">
- <g:FlowPanel height="70px" width="100%"
- styleName="{res.style.entityHeader}" ui:field="entityHeader">
- <!--<g:RichTextArea width="100%" height="70px" /> -->
- </g:FlowPanel>
- <g:FlowPanel width="100%" height="38px"
- styleName="{res.style.docHeader}" ui:field="docHeader">
- </g:FlowPanel>
- <g:HTMLPanel ui:field="arrow"
- styleName="{res.style.docSubheaderArrow}"/>
- <g:FlowPanel width="100%" height="45px"
- styleName="{res.style.docSubheader}" ui:field="docSubheader">
- </g:FlowPanel>
- </g:VerticalPanel>
- </g:north>
- <g:center>
- <g:DockLayoutPanel unit="PX"
- styleName="{res.style.docEditorMargin}" ui:field="docContainerParent">
- <g:west size="10">
- <g:SimplePanel/>
- </g:west>
- <g:east size="10">
- <g:SimplePanel/>
- </g:east>
- <g:center>
- <g:ScrollPanel ui:field="centerScroll"
- styleName="{res.style.docEditor}">
- <g:FlowPanel width="auto" height="auto"
- styleName="{res.style.docEditorContainer}"
- ui:field="docContainer"/>
- </g:ScrollPanel>
- </g:center>
- <g:south size="33.0">
- <g:VerticalPanel height="33px"
- width="100%" styleName="{res.style.docFooter}">
- <g:FlowPanel width="100%" height="33"
- ui:field="docFooter">
- </g:FlowPanel>
- </g:VerticalPanel>
- </g:south>
- </g:DockLayoutPanel>
- </g:center>
- <g:south size="36">
- <g:FlowPanel height="36px" width="100%"
- styleName="{res.style.entityFooter}" ui:field="entityFooter">
- </g:FlowPanel>
- </g:south>
- </g:DockLayoutPanel>
- </g:center>
- <!-- east to RTL (plus css changes in corners and menus) -->
- <g:west size="202.0">
- <g:DockLayoutPanel unit="PX"
- styleName="{res.style.entityTools}" ui:field="splitEast">
- <g:center>
- <g:FlowPanel ui:field="entityToolsContainer">
- <g:FlowPanel width="100%" ui:field="entityToolsNorth"
- styleName="{res.style.entityToolsNorth}"></g:FlowPanel>
- <g:FlowPanel width="100%" ui:field="entityToolsCenter"
- styleName="{res.style.entityToolsCenter}">
- </g:FlowPanel>
- </g:FlowPanel>
- </g:center>
- <g:south size="98">
- <g:FlowPanel styleName="{res.style.entityToolsSouth}"
- ui:field="entityToolsSouth" width="100%"/>
- </g:south>
- </g:DockLayoutPanel>
- </g:west>
- </g:SplitLayoutPanel>
- </g:SimplePanel>
- </g:tab>
- <g:tab>
- <g:header size='0'/>
- <g:SimplePanel ui:field="publicSpace" width="100%"
- styleName="k-space" height="100%"></g:SimplePanel>
- </g:tab>
- </g:TabLayoutPanel>
- </g:center>
- </g:DockLayoutPanel>
-</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -199,11 +199,11 @@
}
}
final GuiActionDescCollection topActions = actionsRegistry.getCurrentActions(
- stateContent.getGroup(), stateContent.getTypeId(), session.isLogged(), rights,
- ActionGroups.TOPBAR);
+ stateContent.getToolName(), stateContent.getGroup(), stateContent.getTypeId(),
+ session.isLogged(), rights, ActionGroups.TOPBAR);
final GuiActionDescCollection bottomActions = actionsRegistry.getCurrentActions(
- stateContent.getGroup(), stateContent.getTypeId(), session.isLogged(), rights,
- ActionGroups.BOTTOMBAR);
+ stateContent.getToolName(), stateContent.getGroup(), stateContent.getTypeId(),
+ session.isLogged(), rights, ActionGroups.BOTTOMBAR);
final GuiActionDescCollection pathActions = pathToolbarUtils.createPath(stateContent.getContainer(),
true);
bottomActions.addAll(pathActions);
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-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -93,9 +93,9 @@
});
}
- private void addItem(final AbstractContentSimpleDTO content, final BasicMimeTypeDTO mimeType,
- final ContentStatus status, final StateToken parentStateToken, final AccessRights rights,
- final long modifiedOn, final boolean isContainer) {
+ private void addItem(final String tool, final AbstractContentSimpleDTO content,
+ final BasicMimeTypeDTO mimeType, final ContentStatus status, final StateToken parentStateToken,
+ final AccessRights rights, final long modifiedOn, final boolean isContainer) {
final StateToken stateToken = content.getStateToken();
final String typeId = content.getTypeId();
final String name = content.getName();
@@ -104,18 +104,19 @@
final String tooltip = getTooltip(stateToken, mimeType,
capabReg.isDragable(typeId) && rights.isAdministrable());
final boolean thisTypeShouldShowDelete = capabReg.showDeleted(typeId)
- || parentStateToken.getTool().equals(TrashToolConstants.NAME);
+ || parentStateToken.getTool().equals(TrashToolConstants.TOOL_NAME);
final boolean showAllDeleted = session.getShowDeletedContent();
if (status.equals(ContentStatus.inTheDustbin) && !(thisTypeShouldShowDelete || showAllDeleted)) {
// Don't show
// NotifyUser.info("Deleted, don't show: " + parentStateToken + " " +
// thisTypeShouldShowDelete);
} else {
+ final GuiActionDescCollection currentActions = actionsRegistry.getCurrentActions(tool, content,
+ typeId, status, session.isLogged(), rights, ActionGroups.ITEM_MENU);
final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken),
genId(parentStateToken), icon, name, tooltip, status, stateToken, modifiedOn,
capabReg.isDragable(typeId) && rights.isAdministrable(), capabReg.isDropable(typeId)
- && rights.isAdministrable(), actionsRegistry.getCurrentActions(content, typeId, status,
- session.isLogged(), rights, ActionGroups.ITEM_MENU), isContainer);
+ && rights.isAdministrable(), currentActions, isContainer);
getView().addItem(item, new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -148,16 +149,16 @@
} else {
// Folders
for (final ContainerSimpleDTO childFolder : container.getChilds()) {
- addItem(childFolder, null, ContentStatus.publishedOnline,
- childFolder.getStateToken().copy().setFolder(childFolder.getParentFolderId()),
- containerRights, FolderViewerView.NO_DATE, true);
+ addItem(container.getAbsolutePath()[0].getStateToken().getTool(), childFolder, null,
+ ContentStatus.publishedOnline, childFolder.getParentToken(), containerRights,
+ FolderViewerView.NO_DATE, true);
}
// Other contents (docs, etc)
for (final ContentSimpleDTO content : container.getContents()) {
assert content != null;
- addItem(content, content.getMimeType(), content.getStatus(),
- content.getStateToken().copy().clearDocument(), content.getRights(),
- content.getModifiedOn(), false);
+ addItem(container.getAbsolutePath()[0].getStateToken().getTool(), content,
+ content.getMimeType(), content.getStatus(), content.getStateToken().copy().clearDocument(),
+ content.getRights(), content.getModifiedOn(), false);
}
}
}
@@ -202,11 +203,11 @@
final AccessRights rights = stateContainer.getContainerRights();
// NotifyUser.info("Rights: " + rights, true);
final GuiActionDescCollection topActions = actionsRegistry.getCurrentActions(
- stateContainer.getGroup(), stateContainer.getTypeId(), session.isLogged(), rights,
- ActionGroups.TOPBAR);
+ stateContainer.getToolName(), stateContainer.getGroup(), stateContainer.getTypeId(),
+ session.isLogged(), rights, ActionGroups.TOPBAR);
final GuiActionDescCollection bottomActions = actionsRegistry.getCurrentActions(
- stateContainer.getGroup(), stateContainer.getTypeId(), session.isLogged(), rights,
- ActionGroups.BOTTOMBAR);
+ stateContainer.getToolName(), stateContainer.getGroup(), stateContainer.getTypeId(),
+ session.isLogged(), rights, ActionGroups.BOTTOMBAR);
final ContainerDTO container = stateContainer.getContainer();
final GuiActionDescCollection pathActions = pathToolbarUtils.createPath(container, true);
bottomActions.addAll(pathActions);
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -28,6 +28,7 @@
import cc.kune.core.shared.FileConstants;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
@@ -60,6 +61,10 @@
initWidget(uiBinder.createAndBindUi(this));
}
+ public HasClickHandlers getCloseBtn() {
+ return closeBtn;
+ }
+
private String getTutorialLang() {
if (langs == null) {
langs = session.getInitData().getTutorialLanguages();
@@ -76,7 +81,7 @@
final String he = (height - FOOTBAR) + "px";
frame.setWidth("100%");
frame.setHeight(he);
- Log.info("Resizing to: " + height);
+ Log.debug("Resizing to: " + height);
}
}
Modified: trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.lists.client;
-import static cc.kune.lists.shared.ListsToolConstants.NAME;
+import static cc.kune.lists.shared.ListsToolConstants.TOOL_NAME;
import static cc.kune.lists.shared.ListsToolConstants.ROOT_NAME;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_LIST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_POST;
@@ -43,7 +43,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_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(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
@@ -63,7 +63,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.lists.client.actions;
+import static cc.kune.lists.shared.ListsToolConstants.TOOL_NAME;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_LIST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_POST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_ROOT;
@@ -40,10 +41,13 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -77,46 +81,50 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<CopyContentMenuItem> copyContent,
final Provider<RefreshContentMenuItem> refreshPost,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<WriteToParticipantsMenuItem> writeToParticipants, final ListsNewMenu listNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelListMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContainer, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newPostIconBtn, noRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newListBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.TOPBAR, listNewMenu, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, postNewMenu, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, subscribeBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refreshList, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refreshPost, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, listOpenessMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newPostItem, containersNoRoot);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, newListMenuItem,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContainer, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newPostIconBtn, noRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newListBtn, TYPE_ROOT);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, listNewMenu, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, postNewMenu, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, subscribeBtn, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refreshList, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refreshPost, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, listOpenessMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newPostItem, containersNoRoot);
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, newListMenuItem,
// TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, subscribersCount, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, subscribersCount, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, chatAbout, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
newMenusRegistry.register(TYPE_LIST, listNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, listNewMenu.get());
newMenusRegistry.register(TYPE_POST,
Modified: trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.lists.server;
-import static cc.kune.lists.shared.ListsToolConstants.NAME;
+import static cc.kune.lists.shared.ListsToolConstants.TOOL_NAME;
import static cc.kune.lists.shared.ListsToolConstants.ROOT_NAME;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_LIST;
import static cc.kune.lists.shared.ListsToolConstants.TYPE_POST;
@@ -59,7 +59,7 @@
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final UserSessionManager userSessionManager, final KuneWaveService waveManager,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST), Arrays.asList(TYPE_LIST),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST), Arrays.asList(TYPE_LIST),
Arrays.asList(TYPE_LIST), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
creationService, configurationManager, i18n, ServerToolTarget.forGroups);
this.userSessionManager = userSessionManager;
Modified: trunk/src/main/java/cc/kune/lists/shared/ListsToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/shared/ListsToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/lists/shared/ListsToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,11 +21,11 @@
public final class ListsToolConstants {
- public static final String NAME = "lists";
+ public static final String TOOL_NAME = "lists";
public static final String ROOT_NAME = "lists";
- public static final String TYPE_LIST = NAME + "." + "list";
- public static final String TYPE_POST = NAME + "." + "post";
- public static final String TYPE_ROOT = NAME + "." + "root";
+ public static final String TYPE_LIST = TOOL_NAME + "." + "list";
+ public static final String TYPE_POST = TOOL_NAME + "." + "post";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
private ListsToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.tasks.client;
-import static cc.kune.tasks.shared.TasksToolConstants.NAME;
+import static cc.kune.tasks.shared.TasksToolConstants.TOOL_NAME;
import static cc.kune.tasks.shared.TasksToolConstants.ROOT_NAME;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_FOLDER;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_ROOT;
@@ -45,7 +45,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_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(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
@@ -65,7 +65,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.tasks.client.actions;
+import static cc.kune.tasks.shared.TasksToolConstants.TOOL_NAME;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_FOLDER;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_ROOT;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_TASK;
@@ -41,10 +42,13 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -75,6 +79,7 @@
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<CopyContentMenuItem> copyContent,
final Provider<WriteToParticipantsMenuItem> writeToParticipants,
final TasksFolderNewMenu taskFolderNewMenu, final TasksNewMenu taskNewMenu,
@@ -82,42 +87,46 @@
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newTaskIconBtn, all);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, taskFolderNewMenu,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newTaskIconBtn, all);
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, taskFolderNewMenu,
// containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, taskNewMenu, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newFolderBtn, containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, newTaskItem, containers);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, marksAsDoneMenuItem,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, taskNewMenu, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newFolderBtn, containers);
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, newTaskItem,
+ // containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, chatAbout, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, marksAsDoneMenuItem,
ContentStatus.publishedOnline, TYPE_TASK);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, marksAsDoneMenuItem,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, marksAsDoneMenuItem,
ContentStatus.editingInProgress, TYPE_TASK);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, marksAsNotDoneMenuItem,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, marksAsNotDoneMenuItem,
ContentStatus.inTheDustbin, TYPE_TASK);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, taskFolderNewMenu.get());
Modified: trunk/src/main/java/cc/kune/tasks/server/TaskServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/server/TaskServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/tasks/server/TaskServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.tasks.server;
-import static cc.kune.tasks.shared.TasksToolConstants.NAME;
+import static cc.kune.tasks.shared.TasksToolConstants.TOOL_NAME;
import static cc.kune.tasks.shared.TasksToolConstants.ROOT_NAME;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_FOLDER;
import static cc.kune.tasks.shared.TasksToolConstants.TYPE_ROOT;
@@ -50,7 +50,7 @@
public TaskServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_TASK), Arrays.asList(TYPE_FOLDER, TYPE_ROOT),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_TASK), Arrays.asList(TYPE_FOLDER, TYPE_ROOT),
Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER), contentManager,
containerManager, creationService, configurationManager, i18n, ServerToolTarget.forBoth);
}
Modified: trunk/src/main/java/cc/kune/tasks/shared/TasksToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/shared/TasksToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/tasks/shared/TasksToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,11 +21,11 @@
public final class TasksToolConstants {
- public static final String NAME = "tasks";
+ public static final String TOOL_NAME = "tasks";
public static final String ROOT_NAME = "tasks";
- public static final String TYPE_FOLDER = NAME + "." + "folder";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_TASK = NAME + "." + "task";
+ public static final String TYPE_FOLDER = TOOL_NAME + "." + "folder";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
+ public static final String TYPE_TASK = TOOL_NAME + "." + "task";
private TasksToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.trash.client;
-import static cc.kune.trash.shared.TrashToolConstants.NAME;
+import static cc.kune.trash.shared.TrashToolConstants.TOOL_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;
@@ -41,7 +41,7 @@
public TrashClientTool(final I18nTranslationService i18n, final ToolSelector toolSelector,
final ContentCapabilitiesRegistry cntCapRegistry, final CoreResources res,
final NavResources navResources) {
- super(NAME, i18n.t(ROOT_NAME), i18n.t("You can drop here contents to delete then"),
+ super(TOOL_NAME, i18n.t(ROOT_NAME), i18n.t("You can drop here contents to delete then"),
res.trashWhite(), AccessRolDTO.Editor, toolSelector, cntCapRegistry, i18n, navResources);
this.res = res;
@@ -59,7 +59,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
*/
package cc.kune.trash.client.actions;
+import static cc.kune.trash.shared.TrashToolConstants.TOOL_NAME;
import static cc.kune.trash.shared.TrashToolConstants.TYPE_ROOT;
import cc.kune.chat.client.actions.GoParentChatBtn;
import cc.kune.core.client.actions.ActionRegistryByType;
@@ -39,7 +40,6 @@
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,
@@ -47,12 +47,8 @@
final Provider<RefreshContentMenuItem> refresh, final Provider<GoParentChatBtn> folderGoUp,
final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp,
- // DocsToolConstants.TYPE_DOCUMENT);
- // actionsRegistry.addAction(ActionGroups.ITEM_MENU, action,
- // containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
}
@Override
Modified: trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.trash.server;
-import static cc.kune.trash.shared.TrashToolConstants.NAME;
+import static cc.kune.trash.shared.TrashToolConstants.TOOL_NAME;
import static cc.kune.trash.shared.TrashToolConstants.ROOT_NAME;
import static cc.kune.trash.shared.TrashToolConstants.TYPE_ROOT;
@@ -49,7 +49,7 @@
public TrashServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Collections.<String> emptyList(), Arrays.asList(TYPE_ROOT),
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Collections.<String> emptyList(), Arrays.asList(TYPE_ROOT),
Collections.<String> emptyList(), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
creationService, configurationManager, i18n, ServerToolTarget.forBoth);
}
Added: trunk/src/main/java/cc/kune/trash/server/TrashServerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/server/TrashServerUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/server/TrashServerUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2012 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.server;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Container;
+import cc.kune.domain.Content;
+import cc.kune.trash.shared.TrashToolConstants;
+
+public class TrashServerUtils {
+
+ public static boolean inTrash(final Container container) {
+ return isTrash(container.getStateToken());
+ }
+
+ public static boolean inTrash(final Content content) {
+ return inTrash(content.getContainer());
+ }
+
+ public static boolean isTrash(final StateToken token) {
+ return token.getTool().equals(TrashToolConstants.TOOL_NAME);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -21,9 +21,9 @@
public final class TrashToolConstants {
- public static final String NAME = "trash";
+ public static final String TOOL_NAME = "trash";
public static final String ROOT_NAME = "trash";
- public static final String TYPE_ROOT = NAME + "." + "root";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
private TrashToolConstants() {
}
Modified: trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
*/
package cc.kune.wave.server;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -34,6 +35,7 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
+import com.google.wave.api.Participants;
@Singleton
public class ParticipantUtils {
@@ -49,6 +51,12 @@
superAdmin = ofImpl(databaseProperties.getAdminShortName());
}
+ public String[] arrayFrom(final Participants parts) {
+ final List<String> list = new ArrayList<String>();
+ // From the first in the list
+ return parts.toArray(new String[parts.size()]);
+ }
+
public String getAddressName(final String address) {
return address.contains(ParticipantId.DOMAIN_PREFIX) ? address.split(ParticipantId.DOMAIN_PREFIX)[0]
: address;
Modified: trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.wiki.client;
-import static cc.kune.wiki.shared.WikiToolConstants.NAME;
+import static cc.kune.wiki.shared.WikiToolConstants.TOOL_NAME;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_FOLDER;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_ROOT;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_UPLOADEDFILE;
@@ -44,7 +44,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(
- NAME,
+ TOOL_NAME,
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",
@@ -65,7 +65,7 @@
@Override
public String getName() {
- return NAME;
+ return TOOL_NAME;
}
private void registerIcons() {
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
\*/
package cc.kune.wiki.client.actions;
+import static cc.kune.wiki.shared.WikiToolConstants.TOOL_NAME;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_FOLDER;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_ROOT;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_UPLOADEDFILE;
@@ -41,10 +42,13 @@
import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.CopyContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentBtn;
+import cc.kune.gspace.client.actions.PurgeContentMenuItem;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.WriteToParticipantsMenuItem;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -72,6 +76,7 @@
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
+ final Provider<PurgeContentMenuItem> purgeMenuItem, final Provider<PurgeContentBtn> purgeBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<NewFolderBtn> newFolderBtn,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
final Provider<SetAsHomePageMenuItem> setAsHomePage,
@@ -80,40 +85,43 @@
final Provider<WriteToParticipantsMenuItem> writeToParticipants,
final WikiPageNewMenu wikipageNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.TOPBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newWikiIconBtn, all);
- actionsRegistry.addAction(ActionGroups.TOPBAR, newFolderBtn, containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, folderNewMenu,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, refresh, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newWikiIconBtn, all);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, newFolderBtn, containers);
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, folderNewMenu,
// containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, wikipageNewMenu, contents);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, newWikiMenuItem,
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, wikipageNewMenu, contents);
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, newWikiMenuItem,
// containers);
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderMenuItem,
+ // actionsRegistry.addAction(NAME, ActionGroups.TOOLBAR, newFolderMenuItem,
// containers);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.BOTTOMBAR, folderGoUp, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, shareMenuContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, tutorialBtn, containers);
- actionsRegistry.addAction(ActionGroups.TOPBAR, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.TOPBAR, writeToParticipants, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, copyContent, contents);
- actionsRegistry.addAction(ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.BOTTOMBAR, folderGoUp, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, participateBtn, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, chatAbout, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.TOPBAR, writeToParticipants, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, copyContent, contents);
+ actionsRegistry.addAction(TOOL_NAME, ActionGroups.ITEM_MENU, writeToParticipants, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.TOPBAR, purgeBtn, contents);
+ actionsRegistry.addAction(TrashToolConstants.TOOL_NAME, ActionGroups.ITEM_MENU, purgeMenuItem,
+ contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
Modified: trunk/src/main/java/cc/kune/wiki/server/WikiServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/server/WikiServerTool.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/wiki/server/WikiServerTool.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.wiki.server;
-import static cc.kune.wiki.shared.WikiToolConstants.NAME;
+import static cc.kune.wiki.shared.WikiToolConstants.TOOL_NAME;
import static cc.kune.wiki.shared.WikiToolConstants.ROOT_NAME;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_FOLDER;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_ROOT;
@@ -52,7 +52,7 @@
public WikiServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
final CreationService creationService) {
- super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_WIKIPAGE, TYPE_UPLOADEDFILE), Arrays.asList(
+ super(TOOL_NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_WIKIPAGE, TYPE_UPLOADEDFILE), Arrays.asList(
TYPE_ROOT, TYPE_FOLDER), Arrays.asList(TYPE_FOLDER), Arrays.asList(TYPE_ROOT, TYPE_FOLDER),
contentManager, containerManager, creationService, configurationManager, i18n,
ServerToolTarget.forBoth);
Modified: trunk/src/main/java/cc/kune/wiki/shared/WikiToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/shared/WikiToolConstants.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/cc/kune/wiki/shared/WikiToolConstants.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -23,12 +23,12 @@
public final class WikiToolConstants {
- public static final String NAME = "wiki";
+ public static final String TOOL_NAME = "wiki";
public static final String ROOT_NAME = "wiki";
- public static final String TYPE_FOLDER = NAME + "." + "folder";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
- public static final String TYPE_WIKIPAGE = NAME + "." + "wikipage";
+ public static final String TYPE_FOLDER = TOOL_NAME + "." + "folder";
+ public static final String TYPE_ROOT = TOOL_NAME + "." + "root";
+ public static final String TYPE_UPLOADEDFILE = TOOL_NAME + "." + ToolConstants.UPLOADEDFILE_SUFFIX;
+ public static final String TYPE_WIKIPAGE = TOOL_NAME + "." + "wikipage";
private WikiToolConstants() {
}
Modified: trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -151,7 +151,7 @@
String avatar = "";
if (address.contains(domain)) {
avatar = new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
- address.split("@")[0])).toString();
+ address.split("@")[0]), new UrlParam(FileConstants.ONLY_USERS, true)).toString();
} else {
avatar = FileConstants.PERSON_NO_AVATAR_IMAGE;
}
Modified: trunk/src/main/resources/wave-server-production.properties
===================================================================
--- trunk/src/main/resources/wave-server-production.properties 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/main/resources/wave-server-production.properties 2012-03-31 17:43:11 UTC (rev 1811)
@@ -108,10 +108,10 @@
enable_ssl = false
# Path to keystore containg the ssl certificates to server
-ssl_keystore_path = src/main/resources/wiab.ks
+ssl_keystore_path = /etc/kune/kune.ks
#Password to the keystore
-ssl_keystore_password = fafafa
+ssl_keystore_password = change_me
# Enable import of waves via /import URL. Default value: false
enable_import = false
Added: trunk/src/main/webapp/others/defuser.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/others/defuser.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/webapp/others/unknown.jpg
===================================================================
(Binary files differ)
Added: trunk/src/main/webapp/others/unknown.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/others/unknown.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeBorrarTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeBorrarTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeBorrarTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -1,64 +0,0 @@
-/*
- *
- * 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.core.client.actions;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.core.shared.domain.utils.AccessRights;
-
-import com.google.inject.Provider;
-
-public class ActionRegistryByTypeBorrarTest {
-
- private static final String OTHERACTIONGROUP = "otheractiongroup";
- private static final String SOMEACTIONGROUP = "someactiongroup";
- private GuiActionDescrip action;
- private ActionRegistryByType actionRegistryByType;
- private AccessRights allRights;
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Before
- public void before() {
- actionRegistryByType = new ActionRegistryByType();
- action = Mockito.mock(GuiActionDescrip.class);
- allRights = new AccessRights(true, true, true);
- actionRegistryByType.addAction(SOMEACTIONGROUP, new Provider() {
- @Override
- public Object get() {
- return action;
- }
- });
- }
-
- @Test
- public void testDontGetCurrentActionsOfOtherGroup() {
- assertEquals(0, actionRegistryByType.getCurrentActions(null, false, allRights, OTHERACTIONGROUP).size());
- }
-
- @Test
- public void testGetCurrentActionsOfGroup() {
- assertEquals(1, actionRegistryByType.getCurrentActions(null, false, allRights, SOMEACTIONGROUP).size());
- }
-}
Copied: trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java (from rev 1809, trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeBorrarTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -0,0 +1,70 @@
+/*
+ *
+ * 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.core.client.actions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.core.shared.domain.utils.AccessRights;
+
+import com.google.inject.Provider;
+
+public class ActionRegistryByTypeTest {
+
+ private static final String OTHERACTIONGROUP = "otheractiongroup";
+ private static final String SOMEACTIONGROUP = "someactiongroup";
+ private static final String TOOL = "tool";
+ private GuiActionDescrip action;
+ private ActionRegistryByType actionRegistryByType;
+ private AccessRights allRights;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Before
+ public void before() {
+ actionRegistryByType = new ActionRegistryByType();
+ action = Mockito.mock(GuiActionDescrip.class);
+ allRights = new AccessRights(true, true, true);
+ actionRegistryByType.addAction(TOOL, SOMEACTIONGROUP, new Provider() {
+ @Override
+ public Object get() {
+ return action;
+ }
+ });
+ }
+
+ @Test
+ public void testDontGetCurrentActionsOfOtherGroup() {
+ assertEquals(0,
+ actionRegistryByType.getCurrentActions(TOOL, null, false, allRights, OTHERACTIONGROUP).size());
+ assertEquals(
+ 0,
+ actionRegistryByType.getCurrentActions(TOOL + "other", null, false, allRights, OTHERACTIONGROUP).size());
+ }
+
+ @Test
+ public void testGetCurrentActionsOfGroup() {
+ assertEquals(1,
+ actionRegistryByType.getCurrentActions(TOOL, null, false, allRights, SOMEACTIONGROUP).size());
+ }
+}
Modified: trunk/src/test/java/cc/kune/core/server/PersistencePreLoadedDataTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/PersistencePreLoadedDataTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/PersistencePreLoadedDataTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.server;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_FOLDER;
import static org.junit.Assert.assertEquals;
@@ -121,9 +122,11 @@
contentManager.persist(content);
container = new Container();
container.setTypeId(TYPE_FOLDER);
+ container.setToolName(TOOL_NAME);
containerManager.persist(container);
otherContainer = new Container();
otherContainer.setTypeId(TYPE_FOLDER);
+ otherContainer.setToolName(TOOL_NAME);
containerManager.persist(otherContainer);
}
}
Modified: trunk/src/test/java/cc/kune/core/server/TestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/TestHelper.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/TestHelper.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -33,9 +33,18 @@
import org.waveprotocol.box.server.waveserver.WaveServerImpl;
import org.waveprotocol.wave.federation.noop.NoOpFederationModule;
+import cc.kune.barters.server.BarterServerModule;
+import cc.kune.chat.server.ChatServerModule;
import cc.kune.core.server.integration.HttpServletRequestMocked;
import cc.kune.core.server.persist.DataSourceKunePersistModule;
+import cc.kune.core.server.persist.DataSourceOpenfirePersistModule;
+import cc.kune.docs.server.DocumentServerModule;
+import cc.kune.events.server.EventsServerModule;
+import cc.kune.lists.server.ListsServerModule;
+import cc.kune.tasks.server.TaskServerModule;
+import cc.kune.trash.server.TrashServerModule;
import cc.kune.wave.server.CustomSettingsBinder;
+import cc.kune.wiki.server.WikiServerModule;
import com.google.inject.Binder;
import com.google.inject.Guice;
@@ -55,18 +64,23 @@
TestConstants.WAVE_TEST_PROPFILE, CoreSettings.class));
final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class);
final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class);
+ final DataSourceKunePersistModule kuneDataSource = new DataSourceKunePersistModule(
+ "kune.properties", TestConstants.PERSISTENCE_UNIT);
final Injector childInjector = injector.createChildInjector(wavePersistModule, new ServerModule(
- false, 1, 2, 2), new RobotApiModule(), federationModule, new DataSourceKunePersistModule(
- "kune.properties", TestConstants.PERSISTENCE_UNIT), module, new Module() {
- @Override
- public void configure(final Binder binder) {
- binder.bindScope(SessionScoped.class, Scopes.SINGLETON);
- binder.bindScope(RequestScoped.class, Scopes.SINGLETON);
- // binder.bind(KuneProperties.class).toInstance(new
- // KunePropertiesDefault(propetiesFileName));
- binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
- }
- });
+ false, 1, 2, 2), new RobotApiModule(), federationModule, new ListsServerModule(),
+ new DocumentServerModule(), new ChatServerModule(), federationModule,
+ new WikiServerModule(), new TaskServerModule(), new BarterServerModule(),
+ new EventsServerModule(), new TrashServerModule(), kuneDataSource,
+ new DataSourceOpenfirePersistModule(kuneDataSource.getKuneProperties()), module, new Module() {
+ @Override
+ public void configure(final Binder binder) {
+ binder.bindScope(SessionScoped.class, Scopes.SINGLETON);
+ binder.bindScope(RequestScoped.class, Scopes.SINGLETON);
+ // binder.bind(KuneProperties.class).toInstance(new
+ // KunePropertiesDefault(propetiesFileName));
+ binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
+ }
+ });
try {
childInjector.getInstance(WaveServerImpl.class).initialize();
} catch (final WaveServerException e) {
Modified: trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.core.server.integration;
-import static cc.kune.docs.shared.DocsToolConstants.NAME;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -94,7 +94,7 @@
@Test
public void testToolConfiguration() {
assertNotNull(defaultGroup);
- final ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(NAME);
+ final ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(TOOL_NAME);
assertNotNull(docToolConfig);
assertTrue(docToolConfig.isEnabled());
// final ToolConfiguration chatToolConfig =
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -84,11 +84,7 @@
kuneDataSource.getTransactionInterceptor());
install(kuneDataSource);
}
- },
-
- // new MyDataSourceTwoPersistModule(),
-
- new ListsServerModule(), new RobotApiModule(), new PlatformServerModule(),
+ }, new ListsServerModule(), new RobotApiModule(), new PlatformServerModule(),
new DocumentServerModule(), new ChatServerModule(), new ServerModule(false, 1, 2, 2),
federationModule, new WikiServerModule(), new TaskServerModule(), new BarterServerModule(),
new EventsServerModule(), new TrashServerModule());
Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -20,7 +20,7 @@
package cc.kune.core.server.integration.content;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
-import static cc.kune.wiki.shared.WikiToolConstants.NAME;
+import static cc.kune.wiki.shared.WikiToolConstants.TOOL_NAME;
import static cc.kune.wiki.shared.WikiToolConstants.TYPE_WIKIPAGE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -106,7 +106,7 @@
final ContainerDTO parentAgain = getSiteDefaultContent().getContainer();
final ContainerSimpleDTO child = parentAgain.getChilds().get(0);
- assertEquals(parent.getId(), child.getParentFolderId());
+ assertEquals(parent.getStateToken().getFolder(), child.getParentToken().getFolder());
assertEquals(parent.getId(), parentAgain.getId());
assertEquals(1, parentAgain.getChilds().size());
@@ -147,7 +147,7 @@
public void testAddWikiContent() throws Exception {
doLogin();
- final StateToken wikiToken = new StateToken(super.getDefSiteShortName(), NAME);
+ final StateToken wikiToken = new StateToken(super.getDefSiteShortName(), TOOL_NAME);
final StateContainerDTO wiki = (StateContainerDTO) contentService.getContent(session.getHash(),
wikiToken);
@@ -158,7 +158,7 @@
final ContainerDTO wikiContainer = added.getContainer();
final List<ContentSimpleDTO> contents = wikiContainer.getContents();
assertEquals(title, added.getTitle());
- assertEquals(2, contents.size());
+ assertEquals(1, contents.size());
doLogout();
doLoginWithDummyUser();
Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -32,6 +32,7 @@
import org.junit.Test;
import cc.kune.core.client.errors.AccessViolationException;
+import cc.kune.core.client.errors.CannotDeleteDefaultContentException;
import cc.kune.core.server.integration.IntegrationTestHelper;
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.TagCount;
@@ -43,6 +44,7 @@
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.dto.UserSimpleDTO;
import cc.kune.docs.shared.DocsToolConstants;
+import cc.kune.trash.shared.TrashToolConstants;
public class ContentServiceVariousTest extends ContentServiceIntegrationTest {
@@ -85,6 +87,7 @@
assertEquals(1, (long) tagResult.getCount());
}
+ @Ignore
@Test
public void contentRateAndRetrieve() throws Exception {
contentService.rateContent(getHash(), defaultContent.getStateToken(), 4.5);
@@ -103,6 +106,13 @@
assertEquals("es", contentRetrieved.getLanguage().getCode());
}
+ private StateContainerDTO createNewContent() {
+ final StateContainerDTO added = contentService.addContent(session.getHash(),
+ defaultContent.getStateToken(), "New Content Title", TYPE_DOCUMENT);
+ assertNotNull(added);
+ return added;
+ }
+
@Ignore
// FIXME: when State refactor do this test (with noLogin and without)
public void defAdminDontShowAsParticipation() throws Exception {
@@ -113,13 +123,68 @@
assertEquals(1, content.getParticipation().getGroupsIsAdmin().size());
}
+ @Test(expected = CannotDeleteDefaultContentException.class)
+ public void defContentRemove() throws Exception {
+ doLogin();
+ defaultContent = getSiteDefaultContent();
+ contentService.delContent(session.getHash(), defaultContent.getStateToken());
+ }
+
@Test
+ public void delAndPurgeContainer() throws Exception {
+ doLogin();
+ final StateContainerDTO state = contentService.addFolder(session.getHash(),
+ defaultContent.getStateToken(), "some folder", DocsToolConstants.TYPE_FOLDER);
+ final ContainerDTO newFolder = state.getContainer();
+
+ final StateContainerDTO trash = getTrash();
+ assertEquals(0, trash.getContainer().getContents().size());
+ assertEquals(0, trash.getContainer().getChilds().size());
+ contentService.delContent(session.getHash(), newFolder.getStateToken());
+
+ final StateContainerDTO trashAfterDel = getTrash();
+ assertEquals(0, trashAfterDel.getContainer().getContents().size());
+ assertEquals(1, trashAfterDel.getContainer().getChilds().size());
+ final StateContainerDTO deletedFolder = (StateContainerDTO) contentService.getContent(
+ session.getHash(),
+ newFolder.getStateToken().setTool(TrashToolConstants.TOOL_NAME).setFolder(
+ newFolder.getStateToken().getFolder()));
+ contentService.purgeContainer(session.getHash(), deletedFolder.getStateToken());
+ final StateContainerDTO trashAfterPurge = getTrash();
+ assertEquals(0, trashAfterPurge.getContainer().getContents().size());
+ assertEquals(0, trashAfterPurge.getContainer().getChilds().size());
+ }
+
+ @Test
+ public void delAndPurgeContent() throws Exception {
+ doLogin();
+ final StateContainerDTO trash = getTrash();
+ final StateContainerDTO added = createNewContent();
+ final StateAbstractDTO retrievedContent = contentService.getContent(session.getHash(),
+ added.getStateToken());
+ assertNotNull(retrievedContent.getStateToken());
+ final StateContainerDTO deleledContainer = contentService.delContent(session.getHash(),
+ retrievedContent.getStateToken());
+ assertEquals(1, defaultContent.getContainer().getContents().size());
+ assertEquals(1, deleledContainer.getContainer().getContents().size());
+ final StateContentDTO deletedContent = (StateContentDTO) contentService.getContent(
+ session.getHash(),
+ retrievedContent.getStateToken().setTool(TrashToolConstants.TOOL_NAME).setFolder(
+ trash.getStateToken().getFolder()));
+ assertEquals(TrashToolConstants.TOOL_NAME, deletedContent.getToolName());
+ assertEquals(1, deletedContent.getContainer().getContents().size());
+ final StateContainerDTO trashAfterPurge = contentService.purgeContent(session.getHash(),
+ deletedContent.getStateToken());
+ assertEquals(0, trashAfterPurge.getContainer().getContents().size());
+ }
+
+ @Test
public void folderRename() throws Exception {
doLogin();
defaultContent = getSiteDefaultContent();
+ String newTitle = "folder new name";
final String oldTitle = "some title";
- String newTitle = "folder new name";
final StateContainerDTO newState = contentService.addFolder(session.getHash(),
defaultContent.getStateToken(), oldTitle, DocsToolConstants.TYPE_FOLDER);
@@ -179,6 +244,14 @@
assertEquals(newTitle, folderAgain.getName());
}
+ private StateContainerDTO getTrash() {
+ final StateAbstractDTO trash = contentService.getContent(
+ session.getHash(),
+ defaultContent.getStateToken().copy().clearDocument().clearFolder().setTool(
+ TrashToolConstants.TOOL_NAME));
+ return (StateContainerDTO) trash;
+ }
+
@Before
public void init() throws Exception {
new IntegrationTestHelper(this);
@@ -209,9 +282,7 @@
doLogin();
defaultContent = getSiteDefaultContent();
- final StateContainerDTO added = contentService.addContent(session.getHash(),
- defaultContent.getStateToken(), "New Content Title", TYPE_DOCUMENT);
- assertNotNull(added);
+ final StateContainerDTO added = createNewContent();
final ContentSimpleDTO newDefContent = contentService.setAsDefaultContent(session.getHash(),
added.getStateToken());
Modified: trunk/src/test/java/cc/kune/core/server/manager/ContainerManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/ContainerManagerDefaultTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/manager/ContainerManagerDefaultTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -39,7 +39,7 @@
@Before
public void before() {
- rootFolder = containerManager.createRootFolder(user.getUserGroup(), DocsToolConstants.NAME,
+ rootFolder = containerManager.createRootFolder(user.getUserGroup(), DocsToolConstants.TOOL_NAME,
DocsToolConstants.ROOT_NAME, TYPE_FOLDER);
}
Modified: trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -110,14 +110,22 @@
}
private Container createDefContainer(final Group group) {
+ return createDefContainer(group, 0);
+ }
+
+ private Container createDefContainer(final Group group, final int increment) {
final Container container = new Container();
- container.setId(1L);
+ container.setId(1L + increment);
container.setToolName(TESTTOOL);
container.setOwner(group);
container.setName("folder");
return container;
}
+ private Container createDefContainer(final int increment) {
+ return createDefContainer(createDeGroup(), increment);
+ }
+
private Content createDefContent() {
final Container container = createDefContainer(createDeGroup());
final Content d = new Content();
@@ -242,8 +250,8 @@
final Container container = createDefContainer();
final StateToken expectedToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, 1L);
assertEquals(expectedToken, container.getStateToken());
- container.addChild(createDefContainer());
- container.addChild(createDefContainer());
+ container.addChild(createDefContainer(1));
+ container.addChild(createDefContainer(2));
container.addContent(createDefContent());
container.addContent(createDefContent());
container.addContent(createDefContent());
@@ -256,6 +264,7 @@
assertEquals(3, dto.getChilds().size());
assertEquals(3, dto.getContents().size());
assertTrue(dto.getContents().get(0) instanceof ContentSimpleDTO);
+ assertNotNull(dto.getContents().get(0).getStateToken());
assertTrue(dto.getChilds().get(0) instanceof ContainerSimpleDTO);
assertEquals(new StateToken(TESTGROUPSHORTNAME, TESTTOOL),
dto.getChilds().get(0).getStateToken().copy().clearFolder());
Modified: trunk/src/test/java/cc/kune/core/shared/utils/SharedFileDownloadUtilsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/shared/utils/SharedFileDownloadUtilsTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/core/shared/utils/SharedFileDownloadUtilsTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -55,13 +55,13 @@
assertTrue(
util.getLogoAvatarHtml(GROUP, false, true, 50, 5),
util.getLogoAvatarHtml(GROUP, false, true, 50, 5).contains(
- "http://example.org/others/unknown.jpg"));
+ "http://example.org/others/defuser.jpg"));
assertTrue(utilNoPrefix.getLogoAvatarHtml(GROUP, false, true, 50, 5),
- util.getLogoAvatarHtml(GROUP, false, true, 50, 5).contains("/others/unknown.jpg"));
+ util.getLogoAvatarHtml(GROUP, false, true, 50, 5).contains("/others/defuser.jpg"));
assertTrue(
util.getLogoAvatarHtml(GROUP, true, false, 50, 5),
util.getLogoAvatarHtml(GROUP, true, false, 50, 5).contains(
- "'http://example.org/ws/servlets/EntityLogoDownloadManager?token=groupname"));
+ "'http://example.org/ws/servlets/EntityLogoDownloadManager?token=groupname&onlyusers=false"));
}
assertTrue(
@@ -73,12 +73,11 @@
@Test
public void testUserAvatar() {
- assertEquals("http://example.org" + FileConstants.LOGODOWNLOADSERVLET + "?token=groupname",
- utilPrefix.getUserAvatar(GROUP));
- assertEquals("http://example.org" + FileConstants.LOGODOWNLOADSERVLET + "?token=groupname",
- utilPrefixWithSlash.getUserAvatar(GROUP));
- assertEquals(FileConstants.LOGODOWNLOADSERVLET + "?token=groupname",
+ assertEquals("http://example.org" + FileConstants.LOGODOWNLOADSERVLET
+ + "?token=groupname&onlyusers=true", utilPrefix.getUserAvatar(GROUP));
+ assertEquals("http://example.org" + FileConstants.LOGODOWNLOADSERVLET
+ + "?token=groupname&onlyusers=true", utilPrefixWithSlash.getUserAvatar(GROUP));
+ assertEquals(FileConstants.LOGODOWNLOADSERVLET + "?token=groupname&onlyusers=true",
utilNoPrefix.getUserAvatar(GROUP));
}
-
}
Modified: trunk/src/test/java/cc/kune/docs/DocumentToolTest.java
===================================================================
--- trunk/src/test/java/cc/kune/docs/DocumentToolTest.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/docs/DocumentToolTest.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -19,7 +19,7 @@
*/
package cc.kune.docs;
-import static cc.kune.docs.shared.DocsToolConstants.NAME;
+import static cc.kune.docs.shared.DocsToolConstants.TOOL_NAME;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_DOCUMENT;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_FOLDER;
import static cc.kune.docs.shared.DocsToolConstants.TYPE_ROOT;
@@ -33,7 +33,7 @@
@Test
public void clientAndServerSync() {
- assertEquals(NAME, DocsToolConstants.NAME);
+ assertEquals(TOOL_NAME, DocsToolConstants.TOOL_NAME);
assertEquals(TYPE_ROOT, DocsToolConstants.TYPE_ROOT);
assertEquals(TYPE_FOLDER, DocsToolConstants.TYPE_FOLDER);
assertEquals(TYPE_DOCUMENT, DocsToolConstants.TYPE_DOCUMENT);
Modified: trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java 2012-03-31 00:46:37 UTC (rev 1810)
+++ trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java 2012-03-31 17:43:11 UTC (rev 1811)
@@ -62,17 +62,17 @@
public WebElement addNewBuddieTextBox;
@FindBy(id = SeleniumConstants.GWTDEV + AddEntityToThisGroupAction.ADD_NEW_MEMBER_TEXTBOX)
public WebElement addNewMemberTextBox;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + BlogsToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + BlogsToolConstants.TOOL_NAME)
public WebElement blogTool;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + ChatToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + ChatToolConstants.TOOL_NAME)
public WebElement chatTool;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + DocsToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + DocsToolConstants.TOOL_NAME)
public WebElement docTool;
@FindBy(xpath = "//div[@id='gwt-debug-k-cnt-title-id']/div/span")
public WebElement entityTitle;
@FindBy(xpath = "//div[@id='gwt-debug-k-cnt-title-id']/div/input")
public WebElement entityTitleTextarea;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + EventsToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + EventsToolConstants.TOOL_NAME)
public WebElement eventTool;
@FindBy(xpath = "//td/img")
public WebElement firstAvatarOfGroup;
@@ -98,7 +98,7 @@
public WebElement groupOptionsTools;
@FindBy(id = SeleniumConstants.GWTDEV + SubscribeToListBtn.ID)
public WebElement listSubscribeBtn;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + ListsToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + ListsToolConstants.TOOL_NAME)
public WebElement listTool;
@FindBy(id = SeleniumConstants.GWTDEV + NewContainerBtn.BTN_ID)
public WebElement newContainerBtn;
@@ -120,9 +120,9 @@
public WebElement searchEntitiesOk;
@FindBy(xpath = "//div[3]/div/button")
public WebElement socialNetOptions;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + TasksToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + TasksToolConstants.TOOL_NAME)
public WebElement taskTool;
- @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + WikiToolConstants.NAME)
+ @FindBy(id = SeleniumConstants.GWTDEV + ToolSelectorItemPanel.TOOL_ID_PREFIX + WikiToolConstants.TOOL_NAME)
public WebElement wikiTool;
public void openFirtsContent() {
More information about the kune-commits
mailing list