[kune-commits] r1037 - in trunk: .
src/main/java/org/ourproject/kune/app/public/css
src/main/java/org/ourproject/kune/blogs/client
src/main/java/org/ourproject/kune/docs/client
src/main/java/org/ourproject/kune/gallery/client
src/main/java/org/ourproject/kune/platf/client/rpc
src/main/java/org/ourproject/kune/platf/client/state
src/main/java/org/ourproject/kune/platf/server/content
src/main/java/org/ourproject/kune/platf/server/rpc
src/main/java/org/ourproject/kune/wiki/client
src/main/java/org/ourproject/kune/workspace/client
src/main/java/org/ourproject/kune/workspace/client/ctxnav
src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic
src/main/java/org/ourproject/kune/workspace/client/title
src/test/java/org/ourproject/kune/platf/integration/content
vjrj
vjrj at ourproject.org
Mon Jan 26 18:13:08 CET 2009
Author: vjrj
Date: 2009-01-26 18:13:03 +0100 (Mon, 26 Jan 2009)
New Revision: 1037
Modified:
trunk/TODO
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
Log:
Content status UI improved.
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/TODO 2009-01-26 17:13:03 UTC (rev 1037)
@@ -11,6 +11,7 @@
* SHORT-TERM (URGENT)
** TODO <v> User preferences storing
+ (See also variables in 'Styling braimstorming')
We need a way to store (in db) User preferences (like emite chat configurations) in a extensible way.
Something similar to java.util.prefs.Preferences or Mozilla about:config
http://java.sun.com/developer/technicalArticles/releases/preferences/
@@ -19,8 +20,33 @@
http://stackoverflow.com/questions/194349/what-is-the-proper-way-to-store-apps-conf-data-in-java
** vjrj Styling braimstorming
*** layouts
-*** screenshot
+ - name :: greenforrest
+ - screenshot :: images/greenforrest.png
+ - varsgroupname :: layout.greenforrest
*** html+css+variables
+**** css:
+
+**** variables
+ prefgroups
+ - id :: 1
+ - groupname :: emite.ui
+
+ pref
+ - id :: 1
+ - group :: 1
+ - name :: usercolor
+ - description :: (optional) The color of the self alias color in chat conversations
+ - vartype :: (int/boolean/String) red
+ - defvalue :: ?? #000000
+
+ userpref
+ - id :: 1
+ - userid :: 123
+ - varid :: 1
+ - group :: 1
+ - name :: usercolor
+ - status :: (setted|def) setted
+ - value :: red
*** logos
*** caching
** danigb,vjrj URLs public/workspace braimstorming
@@ -75,6 +101,9 @@
http://vafer.org/blog/20070918215154
Related info:
http://java.debian.net/building.html
+** <v> implement pubsub in emite
+ http://xmpp.org/extensions/attic/jep-0060-1.6.html
+ see: svn checkout svn://anonsvn.it.su.se/su-smack su-smack
** TODO <v> study different embeded video solutions
- for ogg :: http://www.flumotion.net/cortado/
- for mp3+ogg :: flowplayer
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/pom.xml 2009-01-26 17:13:03 UTC (rev 1037)
@@ -309,10 +309,10 @@
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
- <enabled>true</enabled>
+ <enabled>false</enabled>
</snapshots>
<releases>
- <enabled>true</enabled> <!-- Workaround for MNG-2974, see note below -->
+ <enabled>false</enabled> <!-- Workaround for MNG-2974, see note below -->
</releases>
</pluginRepository>
</pluginRepositories>
@@ -478,6 +478,7 @@
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</plugin>
+ <!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>deb-maven-plugin</artifactId>
@@ -497,6 +498,7 @@
</execution>
</executions>
</plugin>
+ -->
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-plugin</artifactId>
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-01-26 17:13:03 UTC (rev 1037)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-rejdel a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-01-26 17:13:03 UTC (rev 1037)
@@ -697,18 +697,21 @@
}
*/
-.k-textlinethrough {
+.x-tree-node .k-ctn-status-normal a span {
+}
+
+.x-tree-node .k-ctn-status-rejdel a span {
text-decoration: line-through;
- color: red;
+ color: gray;
}
-.k-textnormal {
- text-decoration: inherit;
- color: green;
+.x-tree-node .k-ctn-status-editing a span {
+ font-style: italic;
+ color: gray;
}
-.k-textunderline {
- text-decoration: underline;
+.x-tree-node .k-ctn-status-submitted a span {
+ color: green;
}
.k-info-links {
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -40,6 +40,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
@@ -52,11 +53,12 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final BlogViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) {
+ final BlogViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo);
+ documentViewer, entityLogo, publicLink);
}
@Override
@@ -86,8 +88,8 @@
createRefreshCntAction(parentMenuTitle, contents);
createRefreshCxtAction(parentMenuTitleCtx, containers);
- createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- i18n.t("Upload files (images, PDFs...)"), null, containersNoRoot);
+ createUploadAction(i18n.t("Upload file"), "images/nav/upload.png", i18n.t("Upload files (images, PDFs...)"),
+ null, containersNoRoot);
createSetAsDefContent(parentMenuTitle, contents);
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -48,6 +48,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -77,7 +78,7 @@
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
$(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class),
- $$(ContextPropEditor.class));
+ $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -40,6 +40,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
@@ -52,11 +53,12 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final DocumentViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) {
+ final DocumentViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo);
+ documentViewer, entityLogo, publicLink);
}
@Override
@@ -89,8 +91,8 @@
createSetAsDefContent(parentMenuTitle, contents);
- createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- i18n.t("Upload files (images, PDFs...)"), null, containers);
+ createUploadAction(i18n.t("Upload file"), "images/nav/upload.png", i18n.t("Upload files (images, PDFs...)"),
+ null, containers);
createDownloadActions(TYPE_UPLOADEDFILE);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -48,6 +48,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -77,7 +78,7 @@
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
$(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class),
- $(DocumentViewer.class), $$(ContextPropEditor.class));
+ $(DocumentViewer.class), $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -39,6 +39,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
@@ -51,11 +52,12 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) {
+ final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo);
+ documentViewer, entityLogo, publicLink);
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -48,6 +48,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -77,7 +78,7 @@
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
$(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(GalleryViewer.class),
- $$(ContextPropEditor.class));
+ $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -63,9 +63,9 @@
void removeAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
- String renameContainer(String userHash, StateToken token, String newName) throws DefaultException;
+ StateAbstractDTO renameContainer(String userHash, StateToken token, String newName) throws DefaultException;
- String renameContent(String userHash, StateToken token, String newName) throws DefaultException;
+ StateAbstractDTO renameContent(String userHash, StateToken token, String newName) throws DefaultException;
void save(String user, StateToken token, String content) throws DefaultException;
@@ -75,9 +75,9 @@
void setPublishedOn(String userHash, StateToken token, Date date) throws DefaultException;
- void setStatus(String userHash, StateToken stateToken, ContentStatusDTO status);
+ StateAbstractDTO setStatus(String userHash, StateToken stateToken, ContentStatusDTO status);
- void setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatusDTO status);
+ StateAbstractDTO setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatusDTO status);
TagCloudResultDTO setTags(String userHash, StateToken token, String tags) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -63,9 +63,10 @@
void removeAuthor(String userHash, StateToken token, String authorShortName, AsyncCallback<?> asyncCallback);
- void renameContainer(String userHash, StateToken token, String newName, AsyncCallback<String> asyncCallback);
+ void renameContainer(String userHash, StateToken token, String newName,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
- void renameContent(String userHash, StateToken token, String newName, AsyncCallback<String> asyncCallback);
+ void renameContent(String userHash, StateToken token, String newName, AsyncCallback<StateAbstractDTO> asyncCallback);
void save(String user, StateToken token, String content, AsyncCallback<?> asyncCallback);
@@ -76,10 +77,11 @@
void setPublishedOn(String userHash, StateToken token, Date publishedOn, AsyncCallback<?> asyncCallback);
- void setStatus(String userHash, StateToken stateToken, ContentStatusDTO status, AsyncCallback<?> asyncCallback);
+ void setStatus(String userHash, StateToken stateToken, ContentStatusDTO status,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
void setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatusDTO status,
- AsyncCallback<?> asyncCallback);
+ AsyncCallback<StateAbstractDTO> asyncCallback);
void setTags(String userHash, StateToken token, String tags, AsyncCallback<TagCloudResultDTO> asyncCallback);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -76,6 +76,8 @@
public int getImgThumbsize();
+ public boolean inSameToken(StateToken token);
+
void check(AsyncCallbackSimple<?> callback);
StateContainerDTO getContainerState();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -173,6 +173,10 @@
return initData.getUserTools();
}
+ public boolean inSameToken(StateToken token) {
+ return getCurrentStateToken().equals(token);
+ }
+
public boolean isLogged() {
return userHash != null;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -36,7 +36,7 @@
boolean findIfExistsTitle(Container container, String title);
- String renameFolder(Group group, Container container, String newName) throws DefaultException;
+ Container renameFolder(Group group, Container container, String newName) throws DefaultException;
SearchResult<Container> search(String search);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -95,7 +95,7 @@
|| (containerFinder.findIfExistsTitle(container, title) > 0);
}
- public String renameFolder(final Group group, final Container container, final String newName)
+ public Container renameFolder(final Group group, final Container container, final String newName)
throws DefaultException {
FilenameUtils.checkBasicFilename(newName);
String newNameWithoutNT = FilenameUtils.chomp(newName);
@@ -107,7 +107,7 @@
}
container.setName(newNameWithoutNT);
persist(container);
- return newNameWithoutNT;
+ return container;
}
public SearchResult<Container> search(final String search) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -51,7 +51,7 @@
void removeAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
- String renameContent(User user, Long contentId, String newName) throws DefaultException;
+ Content renameContent(User user, Long contentId, String newName) throws DefaultException;
Content save(User editor, Content content, String body);
@@ -63,7 +63,7 @@
void setPublishedOn(User user, Long contentId, Date publishedOn) throws DefaultException;
- void setStatus(Long contentId, ContentStatus contentStatus);
+ Content setStatus(Long contentId, ContentStatus contentStatus);
void setTags(User user, Long contentId, String tags) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -156,7 +156,7 @@
content.removeAuthor(author);
}
- public String renameContent(final User user, final Long contentId, final String newTitle) throws DefaultException {
+ public Content renameContent(final User user, final Long contentId, final String newTitle) throws DefaultException {
String newTitleWithoutNL = FilenameUtils.chomp(newTitle);
FilenameUtils.checkBasicFilename(newTitleWithoutNL);
final Content content = finder.getContent(contentId);
@@ -164,7 +164,7 @@
throw new NameInUseException();
}
content.getLastRevision().setTitle(newTitleWithoutNL);
- return newTitle;
+ return content;
}
public Content save(final User editor, final Content content, final String body) {
@@ -209,7 +209,7 @@
content.setPublishedOn(publishedOn);
}
- public void setStatus(final Long contentId, final ContentStatus status) {
+ public Content setStatus(final Long contentId, final ContentStatus status) {
final Content content = finder.getContent(contentId);
content.setStatus(status);
switch (status) {
@@ -219,6 +219,7 @@
default:
break;
}
+ return content;
}
public void setTags(final User user, final Long contentId, final String tags) throws DefaultException {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -125,8 +125,7 @@
public void addAuthor(final String userHash, final StateToken token, final String authorShortName)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
contentManager.addAuthor(user, contentId, authorShortName);
}
@@ -135,8 +134,7 @@
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO addComment(final String userHash, final StateToken token, final Long parentCommentId,
final String commentText) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User author = userSession.getUser();
+ final User author = getCurrentUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
final Comment comment = commentManager.addComment(author, contentId, commentText, parentCommentId);
return mapper.map(comment, CommentDTO.class);
@@ -147,8 +145,7 @@
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO addComment(final String userHash, final StateToken token, final String commentText)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User author = userSession.getUser();
+ final User author = getCurrentUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
final Comment comment = commentManager.addComment(author, contentId, commentText);
return mapper.map(comment, CommentDTO.class);
@@ -159,14 +156,11 @@
@Transactional(type = TransactionType.READ_WRITE)
public StateContentDTO addContent(final String userHash, final StateToken parentToken, final String title,
final String typeId) throws DefaultException {
- final Group group = groupManager.findByShortName(parentToken.getGroup());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Container container = accessService.accessToContainer(ContentUtils.parseId(parentToken.getFolder()),
user, AccessRol.Editor);
final Content addedContent = creationService.createContent(title, "", user, container, typeId);
- final StateContent state = stateService.create(user, addedContent);
- return mapStateSiblings(state, user, group);
+ return getState(user, addedContent);
}
@Authenticated
@@ -174,13 +168,10 @@
@Transactional(type = TransactionType.READ_WRITE)
public StateContainerDTO addFolder(final String userHash, final StateToken parentToken, final String title,
final String contentTypeId) throws DefaultException {
- final Group group = groupManager.findByShortName(parentToken.getGroup());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Container container = createFolder(parentToken.getGroup(), ContentUtils.parseId(parentToken.getFolder()),
title, contentTypeId);
- StateContainer state = stateService.create(user, container);
- return mapStateSiblings(state, user, group);
+ return getState(user, container);
}
@Authenticated
@@ -189,19 +180,15 @@
public StateContainerDTO addRoom(final String userHash, final StateToken parentToken, final String roomName)
throws DefaultException {
final String groupShortName = parentToken.getGroup();
- final Group group = groupManager.findByShortName(groupShortName);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final String userShortName = user.getShortName();
- final ChatConnection connection = xmppManager.login(userShortName, userSession.getUser().getPassword(),
- userHash);
+ final ChatConnection connection = xmppManager.login(userShortName, user.getPassword(), userHash);
xmppManager.createRoom(connection, roomName, userShortName + userHash);
xmppManager.disconnect(connection);
try {
final Container container = createFolder(groupShortName, ContentUtils.parseId(parentToken.getFolder()),
roomName, ChatServerTool.TYPE_ROOM);
- StateContainer state = stateService.create(user, container);
- return mapStateSiblings(state, user, group);
+ return getState(user, container);
} catch (final ContentNotFoundException e) {
xmppManager.destroyRoom(connection, roomName);
throw new ContentNotFoundException();
@@ -219,8 +206,7 @@
@Transactional(type = TransactionType.READ_WRITE)
public void delContent(final String userHash, final StateToken token) throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
contentManager.delContent(user, contentId);
}
@@ -228,10 +214,8 @@
@Transactional(type = TransactionType.READ_ONLY)
public StateAbstractDTO getContent(final String userHash, final StateToken token) throws DefaultException {
Group defaultGroup;
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final boolean userIsLoggedIn = userSession.isUserLoggedIn();
- if (userIsLoggedIn) {
+ final User user = getCurrentUser();
+ if (isUserLoggedIn()) {
defaultGroup = groupManager.getGroupOfUserWithId(user.getId());
if (groupManager.findEnabledTools(defaultGroup.getId()).size() == 0) {
// Groups with no homepage
@@ -265,8 +249,7 @@
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO markCommentAsAbuse(final String userHash, final StateToken token, final Long commentId)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User informer = userSession.getUser();
+ final User informer = getCurrentUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
final Comment comment = commentManager.markAsAbuse(informer, contentId, commentId);
return mapper.map(comment, CommentDTO.class);
@@ -277,11 +260,10 @@
@Transactional(type = TransactionType.READ_WRITE)
public RateResultDTO rateContent(final String userHash, final StateToken token, final Double value)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User rater = userSession.getUser();
+ final User rater = getCurrentUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
- if (userSession.isUserLoggedIn()) {
+ if (isUserLoggedIn()) {
RateResult result = contentManager.rateContent(rater, contentId, value);
return mapper.map(result, RateResultDTO.class);
} else {
@@ -295,32 +277,32 @@
public void removeAuthor(final String userHash, final StateToken token, final String authorShortName)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
contentManager.removeAuthor(user, contentId, authorShortName);
}
@Authenticated
@Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
@Transactional(type = TransactionType.READ_WRITE)
- public String renameContainer(final String userHash, final StateToken token, final String newName)
+ public StateAbstractDTO renameContainer(final String userHash, final StateToken token, final String newName)
throws DefaultException {
- return renameFolder(token.getGroup(), ContentUtils.parseId(token.getFolder()), newName);
+ renameFolder(token.getGroup(), ContentUtils.parseId(token.getFolder()), newName);
+ return getContent(userHash, token);
}
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
@Transactional(type = TransactionType.READ_WRITE)
- public String renameContent(final String userHash, final StateToken token, final String newName)
+ public StateAbstractDTO renameContent(final String userHash, final StateToken token, final String newName)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
try {
accessService.accessToContent(ContentUtils.parseId(token.getDocument()), user, AccessRol.Editor);
} catch (final NoResultException e) {
throw new AccessViolationException();
}
- return renameContent(token.getDocument(), newName);
+ renameContent(token.getDocument(), newName);
+ return getContent(userHash, token);
}
@Authenticated
@@ -329,8 +311,7 @@
public void save(final String userHash, final StateToken token, final String textContent) throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Content content = accessService.accessToContent(contentId, user, AccessRol.Editor);
creationService.saveContent(user, content, textContent);
}
@@ -344,26 +325,13 @@
return mapper.map(content, ContentSimpleDTO.class);
}
- // @Authenticated
- // @Authorizated(accessRolRequired = AccessRol.Administrator,
- // actionLevel=ActionLevel.container)
- // @Transactional(type = TransactionType.READ_WRITE)
- // public ContentSimpleDTO setFolderAsDefaultContent(final String userHash,
- // final StateToken token) {
- // Container container =
- // containerManager.find(ContentUtils.parseId(token.getFolder()));
- // groupManager.setDefaultContent(token.getGroup(), container);
- // return mapper.map(content, ContentSimpleDTO.class);
- // }
-
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
@Transactional(type = TransactionType.READ_WRITE)
public I18nLanguageDTO setLanguage(final String userHash, final StateToken token, final String languageCode)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
return mapper.map(contentManager.setLanguage(user, contentId, languageCode), I18nLanguageDTO.class);
}
@@ -373,26 +341,31 @@
public void setPublishedOn(final String userHash, final StateToken token, final Date publishedOn)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
contentManager.setPublishedOn(user, contentId, publishedOn);
}
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor)
@Transactional(type = TransactionType.READ_WRITE)
- public void setStatus(final String userHash, final StateToken token, final ContentStatusDTO status) {
- if (status.equals(ContentStatusDTO.publishedOnline) || status.equals(ContentStatusDTO.rejected)) {
+ public StateAbstractDTO setStatus(final String userHash, final StateToken token, final ContentStatusDTO status) {
+ if (status.equals(ContentStatusDTO.publishedOnline) || status.equals(ContentStatusDTO.rejected)
+ || status.equals(ContentStatusDTO.inTheDustbin)) {
throw new AccessViolationException();
}
- contentManager.setStatus(ContentUtils.parseId(token.getDocument()), ContentStatus.valueOf(status.toString()));
+ Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+ ContentStatus.valueOf(status.toString()));
+ return getState(getCurrentUser(), content);
}
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
@Transactional(type = TransactionType.READ_WRITE)
- public void setStatusAsAdmin(final String userHash, final StateToken token, final ContentStatusDTO status) {
- contentManager.setStatus(ContentUtils.parseId(token.getDocument()), ContentStatus.valueOf(status.toString()));
+ public StateAbstractDTO setStatusAsAdmin(final String userHash, final StateToken token,
+ final ContentStatusDTO status) {
+ Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+ ContentStatus.valueOf(status.toString()));
+ return getState(getCurrentUser(), content);
}
@Authenticated
@@ -401,8 +374,7 @@
public TagCloudResultDTO setTags(final String userHash, final StateToken token, final String tags)
throws DefaultException {
final Long contentId = ContentUtils.parseId(token.getDocument());
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Group group = groupManager.findByShortName(token.getGroup());
contentManager.setTags(user, contentId, tags);
return getSummaryTags(group);
@@ -413,8 +385,7 @@
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO voteComment(final String userHash, final StateToken token, final Long commentId,
final boolean votePositive) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User voter = userSession.getUser();
+ final User voter = getCurrentUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
final Comment comment = commentManager.vote(voter, contentId, commentId, votePositive);
return mapper.map(comment, CommentDTO.class);
@@ -422,8 +393,7 @@
private Container createFolder(final String groupShortName, final Long parentFolderId, final String title,
final String typeId) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Group group = groupManager.findByShortName(groupShortName);
final Container container = creationService.createFolder(group, parentFolderId, title, user.getLanguage(),
typeId);
@@ -437,14 +407,28 @@
Long id = content.getId();
if (id != null) {
// Content
- return mapStateSiblings(stateService.create(user, content), user, content.getContainer().getOwner());
+ return mapState(stateService.create(user, content), user);
} else {
// Container
final Container container = content.getContainer();
- return mapStateSiblings(stateService.create(user, container), user, container.getOwner());
+ return mapState(stateService.create(user, container), user);
}
}
+ private User getCurrentUser() {
+ return getUserSession().getUser();
+ }
+
+ private StateContainerDTO getState(User user, Container container) {
+ StateContainer state = stateService.create(user, container);
+ return mapState(state, user);
+ }
+
+ private StateContentDTO getState(User user, Content content) {
+ StateContent state = stateService.create(user, content);
+ return mapState(state, user);
+ }
+
private TagCloudResultDTO getSummaryTags(final Group group) {
TagCloudResult result = tagManager.getTagCloudResultByGroup(group);
return new TagCloudResultDTO(mapper.mapList(result.getTagCountList(), TagCountDTO.class), result.getMaxValue(),
@@ -455,6 +439,10 @@
return userSessionProvider.get();
}
+ private boolean isUserLoggedIn() {
+ return getUserSession().isUserLoggedIn();
+ }
+
private void mapContentRightsInstate(final User user, final AccessLists groupAccessList,
final ContentSimpleDTO siblingDTO) {
final Content sibling = contentManager.find(siblingDTO.getId());
@@ -462,9 +450,9 @@
siblingDTO.setRights(mapper.map(rightsService.get(user, lists), AccessRightsDTO.class));
}
- private StateContainerDTO mapStateSiblings(final StateContainer state, final User user, final Group group) {
+ private StateContainerDTO mapState(final StateContainer state, final User user) {
final StateContainerDTO stateDTO = mapper.map(state, StateContainerDTO.class);
- final AccessLists groupAccessList = group.getSocialNetwork().getAccessLists();
+ final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
@@ -474,9 +462,9 @@
return stateDTO;
}
- private StateContentDTO mapStateSiblings(final StateContent state, final User user, final Group group) {
+ private StateContentDTO mapState(final StateContent state, final User user) {
final StateContentDTO stateDTO = mapper.map(state, StateContentDTO.class);
- final AccessLists groupAccessList = group.getSocialNetwork().getAccessLists();
+ final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
@@ -486,19 +474,17 @@
return stateDTO;
}
- private String renameContent(final String documentId, final String newName) throws ContentNotFoundException,
+ private Content renameContent(final String documentId, final String newName) throws ContentNotFoundException,
DefaultException {
final Long contentId = ContentUtils.parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
return contentManager.renameContent(user, contentId, newName);
}
- private String renameFolder(final String groupShortName, final Long folderId, final String newName)
+ private Container renameFolder(final String groupShortName, final Long folderId, final String newName)
throws DefaultException {
final Group group = groupManager.findByShortName(groupShortName);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = getCurrentUser();
final Container container = accessService.accessToContainer(folderId, user, AccessRol.Editor);
return containerManager.renameFolder(group, container, newName);
}
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -40,6 +40,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
@@ -52,11 +53,12 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) {
+ final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo);
+ documentViewer, entityLogo, publicLink);
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -48,6 +48,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -77,7 +78,7 @@
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
$(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(WikiViewer.class),
- $$(ContextPropEditor.class));
+ $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -17,6 +17,7 @@
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -37,6 +38,7 @@
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.socialnet.RadioMustBeChecked;
import com.calclab.suco.client.events.Listener;
@@ -66,6 +68,7 @@
protected final FoldableContent foldableContent;
protected final DeferredCommandWrapper deferredCommandWrapper;
protected final EntityHeader entityLogo;
+ private final SitePublicSpaceLink publicLink;
public AbstractFoldableContentActions(Session session, StateManager stateManager, I18nUITranslationService i18n,
KuneErrorHandler errorHandler, DeferredCommandWrapper deferredCommandWrapper,
@@ -74,7 +77,7 @@
ContentActionRegistry contentActionRegistry, ContextActionRegistry contextActionRegistry,
Provider<FileDownloadUtils> fileDownloadProvider, Provider<TextEditor> textEditorProvider,
Provider<ContextPropEditor> contextPropEditorProvider, FoldableContent foldableContent,
- EntityHeader entityLogo) {
+ EntityHeader entityLogo, SitePublicSpaceLink publicLink) {
this.session = session;
this.stateManager = stateManager;
this.i18n = i18n;
@@ -91,6 +94,7 @@
this.contextPropEditorProvider = contextPropEditorProvider;
this.foldableContent = foldableContent;
this.entityLogo = entityLogo;
+ this.publicLink = publicLink;
createActions();
session.onInitDataReceived(new Listener<InitDataDTO>() {
public void onEvent(InitDataDTO parameter) {
@@ -113,7 +117,7 @@
AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
final ActionToolbarMenuRadioDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
- ContentStatusDTO.publishedOnline);
+ ContentStatusDTO.submittedForEvaluation);
final ActionToolbarMenuRadioDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), parentMenuTitle,
ContentStatusDTO.inTheDustbin);
@@ -247,7 +251,7 @@
foldableContent.attach();
contextPropEditorProvider.get().detach();
contextNavigator.attach();
- if (session.getCurrentStateToken().equals(stateToken)) {
+ if (session.inSameToken(stateToken)) {
contextNavigator.refreshState();
foldableContent.refreshState();
}
@@ -440,13 +444,17 @@
final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
rol, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
- final AsyncCallbackSimple<Object> callback = new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- session.getContentState().setStatus(status);
+ final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
+ public void onSuccess(final StateAbstractDTO state) {
+ if (session.inSameToken(stateToken)) {
+ session.setCurrentState(state);
+ publicLink.setState(state);
+ }
contextNavigator.setItemStatus(stateToken, status);
}
};
- if (status.equals(ContentStatusDTO.publishedOnline) || status.equals(ContentStatusDTO.rejected)) {
+ if (status.equals(ContentStatusDTO.publishedOnline) || status.equals(ContentStatusDTO.rejected)
+ || status.equals(ContentStatusDTO.inTheDustbin)) {
contentServiceProvider.get().setStatusAsAdmin(session.getUserHash(), stateToken, status,
callback);
} else {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -138,9 +138,8 @@
presenter.gotoToken(getToken(node));
}
});
+ setNodeStatus(child, item.getContentStatus());
parent.appendChild(child);
- ContentStatusDTO status = item.getContentStatus();
- setNodeStatus(child, status);
} else {
Log.error("Error building file tree, parent folder " + item.getParentId() + " not found");
}
@@ -314,17 +313,18 @@
private void setNodeStatus(final TreeNode node, ContentStatusDTO status) {
switch (status) {
- // FIXME: while not finished
case publishedOnline:
- // node.setCls("k-textnormal");
+ node.setCls("k-ctn-status-normal");
break;
case inTheDustbin:
case rejected:
- // node.setCls("k-textlinethrough");
+ node.setCls("k-ctn-status-rejdel");
break;
case editingInProgress:
+ node.setCls("k-ctn-status-editing");
+ break;
case submittedForEvaluation:
- // node.setCls("k-textunderline");
+ node.setCls("k-ctn-status-submitted");
break;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -86,7 +86,7 @@
this.renameAction = renameAction;
actionsByItem = new HashMap<StateToken, ActionItemCollection<StateToken>>();
editOnNextStateChange = false;
- confRenameListener();
+ addRenameListener();
}
public void addFileUploaderListener(FileUploader uploader) {
@@ -121,32 +121,15 @@
view.editItem(genId(stateToken));
}
- public void gotoToken(final String token) {
- stateManager.gotoToken(token);
- }
-
public void init(final ContextNavigatorView view) {
this.view = view;
- session.onUserSignIn(new Listener<UserInfoDTO>() {
- public void onEvent(final UserInfoDTO parameter) {
- clear();
- }
- });
- session.onUserSignOut(new Listener0() {
- public void onEvent() {
- clear();
- }
- });
+ addListeners();
}
public boolean isSelected(final StateToken stateToken) {
return view.isSelected(genId(stateToken));
}
- public boolean mustEditOnNextStateChange() {
- return editOnNextStateChange;
- }
-
public void refreshState() {
StateAbstractDTO currentState = session.getCurrentState();
if (currentState instanceof StateContainerDTO) {
@@ -165,80 +148,16 @@
}
public void setItemStatus(final StateToken stateToken, ContentStatusDTO status) {
- view.setItemStatus(genId(stateToken), status);
+ clear();
+ refreshState();
}
public void setState(final StateContainerDTO state, final boolean select) {
setStateContainer(state, select);
}
- public void setStateContainer(final StateContainerDTO state, final boolean select) {
- // TODO: separate in two methods for stateConent and stateContainer
-
- final StateToken stateToken = state.getStateToken();
- boolean isContent = (state instanceof StateContentDTO);
- StateContentDTO stateContent = null;
-
- final ContainerDTO container = state.getContainer();
- final AccessRightsDTO containerRights = state.getContainerRights();
- AccessRightsDTO rights;
-
- if (isContent) {
- stateContent = (StateContentDTO) state;
- rights = stateContent.getContentRights();
- } else {
- rights = containerRights;
- }
- view.setEditable(rights.isEditable());
-
- // If root sended (container is not a root folder) process root (add
- // childs to view)
- final ContainerDTO root = state.getRootContainer();
- if (root != null) {
- view.setRootItem(genId(root.getStateToken()), i18n.t(root.getName()), root.getStateToken());
- createChildItems(root, containerRights);
- }
-
- // Do the path to our current content
- createTreePath(stateToken, container.getAbsolutePath(), containerRights);
-
- // Process our current content/container
- final ActionItemCollection<StateToken> actionItems = new ActionItemCollection<StateToken>();
- if (isContent) {
- rights = stateContent.getContentRights();
- final ActionItemCollection<StateToken> contentActions = addItem(state.getTitle(), state.getTypeId(),
- stateContent.getMimeType(), stateContent.getStatus(), stateToken, container.getStateToken(),
- rights, false);
- final ActionItemCollection<StateToken> containerActions = actionRegistry.getCurrentActions(
- container.getStateToken(), container.getTypeId(), session.isLogged(), containerRights, true);
- actionItems.addAll(containerActions);
- actionItems.addAll(contentActions);
-
- } else {
- rights = containerRights;
- final ActionItemCollection<StateToken> containerActions = addItem(container.getName(),
- container.getTypeId(), null, ContentStatusDTO.publishedOnline, container.getStateToken(),
- container.getStateToken().copy().setFolder(container.getParentFolderId()), containerRights, false);
- actionItems.addAll(containerActions);
- }
-
- actionsByItem.put(stateToken, actionItems);
-
- // Process container childs
- createChildItems(container, containerRights);
-
- // Finaly
- if (mustEditOnNextStateChange()) {
- // Code smell
- selectItem(stateToken);
- editItem(stateToken);
- setEditOnNextStateChange(false);
- } else {
- if (select) {
- selectItem(stateToken);
- }
- }
- toolbar.attach();
+ protected void gotoToken(final String token) {
+ stateManager.gotoToken(token);
}
protected void onItemRename(final String token, final String newName, final String oldName) {
@@ -263,18 +182,31 @@
return toolbarActions;
}
- private void confRenameListener() {
+ private void addListeners() {
+ session.onUserSignIn(new Listener<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO parameter) {
+ clear();
+ }
+ });
+ session.onUserSignOut(new Listener0() {
+ public void onEvent() {
+ clear();
+ }
+ });
+ }
+
+ private void addRenameListener() {
Listener2<StateToken, String> onSuccess = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String newName) {
setItemText(token, newName);
}
};
- renameAction.onSuccess(onSuccess);
Listener2<StateToken, String> onFail = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String oldName) {
setItemText(token, oldName);
}
};
+ renameAction.onSuccess(onSuccess);
renameAction.onFail(onFail);
}
@@ -306,7 +238,7 @@
}
private String genId(final StateToken token) {
- return "k-" + token.toString().replace(StateToken.SEPARATOR, "-");
+ return "k-cnav-" + token.toString().replace(StateToken.SEPARATOR, "-");
}
private String getIcon(final StateToken token, final String contentTypeId, final BasicMimeTypeDTO mimeType) {
@@ -328,7 +260,78 @@
}
}
+ private void selectOrEditNode(final boolean select, final StateToken stateToken) {
+ // Finaly
+ if (editOnNextStateChange) {
+ // Code smell
+ selectItem(stateToken);
+ editItem(stateToken);
+ setEditOnNextStateChange(false);
+ } else {
+ if (select) {
+ selectItem(stateToken);
+ }
+ }
+ }
+
private void setItemText(final StateToken stateToken, final String name) {
view.setItemText(genId(stateToken), name);
}
+
+ private void setStateContainer(final StateContainerDTO state, final boolean select) {
+ final StateToken stateToken = state.getStateToken();
+ boolean isContent = (state instanceof StateContentDTO);
+ StateContentDTO stateContent = null;
+
+ final ContainerDTO container = state.getContainer();
+ final AccessRightsDTO containerRights = state.getContainerRights();
+ AccessRightsDTO rights;
+
+ showRootFolder(state, containerRights);
+
+ // Do the path to our current content
+ createTreePath(stateToken, container.getAbsolutePath(), containerRights);
+
+ // Process our current content/container
+ final ActionItemCollection<StateToken> actionItems = new ActionItemCollection<StateToken>();
+
+ if (isContent) {
+ stateContent = (StateContentDTO) state;
+ rights = stateContent.getContentRights();
+ final ActionItemCollection<StateToken> contentActions = addItem(state.getTitle(), state.getTypeId(),
+ stateContent.getMimeType(), stateContent.getStatus(), stateToken, container.getStateToken(),
+ rights, false);
+ final ActionItemCollection<StateToken> containerActions = actionRegistry.getCurrentActions(
+ container.getStateToken(), container.getTypeId(), session.isLogged(), containerRights, true);
+ actionItems.addAll(containerActions);
+ actionItems.addAll(contentActions);
+ } else {
+ rights = containerRights;
+ final ActionItemCollection<StateToken> containerActions = addItem(container.getName(),
+ container.getTypeId(), null, ContentStatusDTO.publishedOnline, container.getStateToken(),
+ container.getStateToken().copy().setFolder(container.getParentFolderId()), containerRights, false);
+ actionItems.addAll(containerActions);
+ }
+ view.setEditable(rights.isEditable());
+
+ actionsByItem.put(stateToken, actionItems);
+
+ // Process container childs
+ createChildItems(container, containerRights);
+
+ selectOrEditNode(select, stateToken);
+
+ toolbar.attach();
+ }
+
+ private void showRootFolder(final StateContainerDTO state, final AccessRightsDTO containerRights) {
+ // If container is not a root folder process root (add
+ // childs to view)
+ final ContainerDTO root = state.getRootContainer();
+ if (root != null) {
+ // container is not root
+ view.setRootItem(genId(root.getStateToken()), i18n.t(root.getName()), root.getStateToken());
+ createChildItems(root, containerRights);
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -18,8 +18,12 @@
*
*/package org.ourproject.kune.workspace.client.sitebar.sitepublic;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+
public interface SitePublicSpaceLink {
+ void setState(StateAbstractDTO state);
+
void setVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -45,7 +44,7 @@
publicHP = new HorizontalPanel();
gotoPublic = new IconLabel(img.anybody(), i18n.t("Public Space"), false);
gotoPublic.ensureDebugId(SITE_GOTO_PUBLIC);
- contentNoPublic = new IconLabel(img.anybody(), i18n.t("This content is not public"));
+ contentNoPublic = new IconLabel(img.anybody(), i18n.t("This is not public"));
contentNoPublic.ensureDebugId(SITE_CONTENT_NO_PUBLIC);
publicHP.add(gotoPublic);
publicHP.add(contentNoPublic);
@@ -60,9 +59,10 @@
gotoPublic();
}
});
- gotoPublic.setTitle(i18n.t("Leave the workspace and go to this group public space") + Site.IN_DEVELOPMENT);
+ gotoPublic.setTitle(i18n.t("Leave the workspace and go to this group public space"));
gotoPublic.addStyleName("k-sitebar-labellink");
contentNoPublic.addStyleName("k-sitebar-labellink");
+
}
public void attach() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -19,9 +19,11 @@
*/package org.ourproject.kune.workspace.client.sitebar.sitepublic;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -34,11 +36,7 @@
public SitePublicSpaceLinkPresenter(final StateManager stateManager) {
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
public void onEvent(final StateAbstractDTO state) {
- if (state instanceof StateContainerDTO) {
- setState((StateContainerDTO) state);
- } else {
- view.detach();
- }
+ setState(state);
}
});
}
@@ -51,21 +49,34 @@
this.view = view;
}
+ public void setState(final StateAbstractDTO state) {
+ if (state instanceof StateContainerDTO) {
+ final StateToken token = state.getStateToken();
+ if (((StateContainerDTO) state).getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
+ final String publicUrl = token.getPublicUrl();
+ view.setContentGotoPublicUrl(publicUrl);
+ if (state instanceof StateContentDTO) {
+ StateContentDTO content = (StateContentDTO) state;
+ if (content.getStatus().equals(ContentStatusDTO.publishedOnline)) {
+ view.setContentPublic(true);
+ } else {
+ view.setContentPublic(false);
+ }
+ } else {
+ view.setContentPublic(true);
+ }
+ } else {
+ view.setContentPublic(false);
+ }
+ view.attach();
+ view.setVisible(true);
+ } else {
+ view.detach();
+ }
+ }
+
public void setVisible(final boolean visible) {
view.setVisible(visible);
}
- private void setState(final StateContainerDTO state) {
- final StateToken token = state.getStateToken();
- if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
- final String publicUrl = token.getPublicUrl();
- view.setContentGotoPublicUrl(publicUrl);
- view.setContentPublic(true);
- } else {
- view.setContentPublic(false);
- }
- view.attach();
- view.setVisible(true);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -78,5 +78,4 @@
public void setContentTitleVisible(final boolean visible) {
titleLabel.setVisible(visible);
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -59,7 +59,7 @@
}
}
});
- createRenameListeners();
+ addRenameListeners();
}
public View getView() {
@@ -83,18 +83,18 @@
renameAction.rename(token, oldName, newName);
}
- private void createRenameListeners() {
+ private void addRenameListeners() {
Listener2<StateToken, String> onSuccess = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String newName) {
view.setContentTitle(newName);
}
};
- renameAction.onSuccess(onSuccess);
Listener2<StateToken, String> onFail = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String oldName) {
view.setContentTitle(oldName);
}
};
+ renameAction.onSuccess(onSuccess);
renameAction.onFail(onFail);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.title;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.NameInUseException;
import org.ourproject.kune.platf.client.errors.NameNotPermittedException;
@@ -39,7 +40,7 @@
public void rename(final StateToken token, final String oldName, final String newName) {
if (!newName.equals(oldName)) {
Site.showProgress(i18n.t("Renaming"));
- final AsyncCallback<String> asyncCallback = new AsyncCallback<String>() {
+ final AsyncCallback<StateAbstractDTO> asyncCallback = new AsyncCallback<StateAbstractDTO>() {
public void onFailure(final Throwable caught) {
Site.hideProgress();
try {
@@ -56,9 +57,10 @@
onFail.fire(token, oldName);
}
- public void onSuccess(final String finalNewName) {
+ public void onSuccess(final StateAbstractDTO state) {
Site.hideProgress();
- onSuccess.fire(token, finalNewName);
+ session.setCurrentState(state);
+ onSuccess.fire(token, state.getTitle());
}
};
if (token.isComplete()) {
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2009-01-21 01:38:59 UTC (rev 1036)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2009-01-26 17:13:03 UTC (rev 1037)
@@ -13,6 +13,7 @@
import org.ourproject.kune.docs.server.DocumentServerTool;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -88,9 +89,9 @@
final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
newFolder.getId().toString(), null);
- String result = contentService.renameContainer(getHash(), folderToken, newTitle);
+ StateAbstractDTO result = contentService.renameContainer(getHash(), folderToken, newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result.getTitle());
final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
newFolder.getId().toString(), null);
@@ -128,9 +129,9 @@
final String newTitle = "folder new name";
final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
folder.getId().toString(), null);
- final String result = contentService.renameContainer(getHash(), folderToken, newTitle);
+ final StateAbstractDTO result = contentService.renameContainer(getHash(), folderToken, newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result.getTitle());
final ContainerDTO folderAgain = getSiteDefaultContent().getContainer();
@@ -193,9 +194,9 @@
newTitle = "folder last name";
- final String result = contentService.renameContainer(getHash(), newState.getStateToken(), newTitle);
+ final StateAbstractDTO result = contentService.renameContainer(getHash(), newState.getStateToken(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result.getTitle());
final StateContainerDTO folderAgain = (StateContainerDTO) contentService.getContent(getHash(),
newState.getStateToken());
More information about the kune-commits
mailing list