[kune-commits] r967 - in trunk/src/main/java/org/ourproject/kune: app/public/css blogs/client docs/client workspace/client workspace/client/licensefoot

vjrj vjrj at ourproject.org
Tue Nov 25 01:51:23 CET 2008


Author: vjrj
Date: 2008-11-25 01:51:20 +0100 (Tue, 25 Nov 2008)
New Revision: 967

Modified:
   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/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
Log:
Complete - task License onOver show details

Incomplete - task UI tools & workspace refactorization 


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	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-11-25 00:51:20 UTC (rev 967)
@@ -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;color:gray;}.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-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}
\ No newline at end of file
+*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.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-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;}
\ 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	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-11-25 00:51:20 UTC (rev 967)
@@ -797,4 +797,8 @@
 
 .k-text-gray {
     color: gray;
-}
\ No newline at end of file
+}
+
+.k-elp-limg {
+  margin-top: 4px;
+}

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2008-11-25 00:51:20 UTC (rev 967)
@@ -29,8 +29,6 @@
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
 import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
 import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
 import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -70,10 +68,10 @@
         String parentMenuTitle = i18n.t("Post");
         String parentMenuTitleCtx = i18n.t("Blog");
 
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addBlog = createContainerAction(TYPE_BLOG,
-                "images/nav/blog_add.png", i18n.t("New blog"), parentMenuTitleCtx, i18n.t("New"), i18n.t("New blog"));
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addPost = createContentAction("images/nav/post_add.png",
-                i18n.t("New post"), parentMenuTitleCtx, TYPE_POST);
+        createNewContainerAction(TYPE_BLOG, "images/nav/blog_add.png", i18n.t("New blog"), parentMenuTitleCtx,
+                i18n.t("New"), i18n.t("New blog"), Position.ctx, TYPE_ROOT);
+        createNewContentAction(TYPE_POST, "images/nav/post_add.png", i18n.t("New post"), parentMenuTitleCtx,
+                Position.ctx, TYPE_BLOG);
 
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = createDelContainerAction("Delete blog",
                 parentMenuTitleCtx);
@@ -95,51 +93,30 @@
         final ActionToolbarMenuDescriptor<StateToken> refreshCnt = createRefreshCntAction(parentMenuTitle);
 
         final ActionToolbarMenuDescriptor<StateToken> refreshCtx = createRefreshCxtAction(parentMenuTitleCtx);
-
         final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile = createUploadAction(i18n.t("Upload file"),
                 "images/nav/upload.png", i18n.t("Upload some files (images, PDFs, ...)"), null);
 
-        final ActionToolbarMenuDescriptor<StateToken> setPublishStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
-                ContentStatusDTO.publishedOnline);
-        final ActionToolbarMenuDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Editing in progress"), parentMenuTitle,
-                ContentStatusDTO.editingInProgress);
-        final ActionToolbarMenuDescriptor<StateToken> setRejectStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
-        final ActionToolbarMenuDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
-                ContentStatusDTO.publishedOnline);
-        final ActionToolbarMenuDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("In the dustbin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
-
         final String[] all = { TYPE_ROOT, TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE };
+        final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
         final String[] containersNoRoot = { TYPE_BLOG };
         final String[] containers = { TYPE_ROOT, TYPE_BLOG };
         final String[] contents = { TYPE_POST, TYPE_UPLOADEDFILE };
-        final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
 
-        contentActionRegistry.addAction(setPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
-        contentActionRegistry.addAction(setRejectStatus, contentsModerated);
-        contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
-        contextActionRegistry.addAction(addBlog, TYPE_ROOT);
-        contextActionRegistry.addAction(addPost, TYPE_BLOG);
+        createContentModeratedActions(parentMenuTitle, contentsModerated);
+
         contextActionRegistry.addAction(go, all);
         contentActionRegistry.addAction(renameCtn, contents);
         contextActionRegistry.addAction(renameCtx, containersNoRoot);
         contextActionRegistry.addAction(refreshCtx, containers);
         contentActionRegistry.addAction(refreshCnt, contents);
         contextActionRegistry.addAction(uploadFile, TYPE_BLOG);
-        contentActionRegistry.addAction(download, TYPE_UPLOADEDFILE);
         contentActionRegistry.addAction(delContent, contents);
         contextActionRegistry.addAction(delContainer, containersNoRoot);
         contentActionRegistry.addAction(setAsDefGroupCnt, TYPE_POST, TYPE_UPLOADEDFILE);
         // ContentRPC Authorized must permit folders
         // contentActionRegistry.addAction(setAsDefGroupCxt, TYPE_BLOG);
+
         contextActionRegistry.addAction(goGroupHome, containers);
-        contextActionRegistry.addAction(downloadCtx, TYPE_UPLOADEDFILE);
         contentActionRegistry.addAction(editContent, TYPE_POST);
         // contentActionRegistry.addAction(translateContent, );
     }

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-11-25 00:51:20 UTC (rev 967)
@@ -32,8 +32,6 @@
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
 import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
 import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
 import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -73,19 +71,17 @@
         String parentMenuTitle = i18n.t("File");
         String parentMenuTitleCtx = i18n.t("Folder");
 
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder = createContainerAction(TYPE_FOLDER,
-                "images/nav/folder_add.png", i18n.t("New folder"), parentMenuTitleCtx, i18n.t("New"),
-                i18n.t("New folder"));
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addGallery = createContainerAction(TYPE_GALLERY,
-                "images/nav/gallery_add.png", i18n.t("New gallery"), parentMenuTitleCtx, i18n.t("New"),
-                i18n.t("New gallery"));
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addWiki = createContainerAction(TYPE_WIKI,
-                "images/nav/wiki_add.png", i18n.t("New wiki"), parentMenuTitleCtx, i18n.t("New"), i18n.t("wiki"));
+        createNewContainerAction(TYPE_FOLDER, "images/nav/folder_add.png", i18n.t("New folder"), parentMenuTitleCtx,
+                i18n.t("New"), i18n.t("New folder"), Position.ctx, TYPE_FOLDER);
+        createNewContainerAction(TYPE_GALLERY, "images/nav/gallery_add.png", i18n.t("New gallery"), parentMenuTitleCtx,
+                i18n.t("New"), i18n.t("New gallery"), Position.ctx, TYPE_ROOT);
+        createNewContainerAction(TYPE_WIKI, "images/nav/wiki_add.png", i18n.t("New wiki"), parentMenuTitleCtx,
+                i18n.t("New"), i18n.t("wiki"), Position.ctx, TYPE_ROOT);
 
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = createContentAction("images/nav/page_add.png",
-                i18n.t("New document"), parentMenuTitleCtx, TYPE_DOCUMENT);
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addWikiPage = createContentAction(
-                "images/nav/wikipage_add.png", parentMenuTitleCtx, i18n.t("New wikipage"), TYPE_WIKIPAGE);
+        createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png", i18n.t("New document"), parentMenuTitleCtx,
+                Position.ctx, TYPE_ROOT, TYPE_FOLDER);
+        createNewContentAction(TYPE_WIKIPAGE, "images/nav/wikipage_add.png", parentMenuTitleCtx,
+                i18n.t("New wikipage"), Position.ctx, TYPE_WIKI);
 
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = createDelContainerAction("Delete folder",
                 parentMenuTitleCtx);
@@ -111,20 +107,6 @@
         final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile = createUploadAction(i18n.t("Upload file"),
                 "images/nav/upload.png", i18n.t("Upload some files (images, PDFs, ...)"), null);
 
-        final ActionToolbarMenuDescriptor<StateToken> setPublishStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
-                ContentStatusDTO.publishedOnline);
-        final ActionToolbarMenuDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Editing in progress"), parentMenuTitle,
-                ContentStatusDTO.editingInProgress);
-        final ActionToolbarMenuDescriptor<StateToken> setRejectStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
-        final ActionToolbarMenuDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
-                ContentStatusDTO.publishedOnline);
-        final ActionToolbarMenuDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("In the dustbin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
-
         final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_GALLERY, TYPE_WIKI, TYPE_WIKIPAGE,
                 TYPE_UPLOADEDFILE };
         final String[] containersNoRoot = { TYPE_FOLDER, TYPE_GALLERY, TYPE_WIKI };
@@ -132,29 +114,20 @@
         final String[] contents = { TYPE_DOCUMENT, TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
         final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
 
-        contentActionRegistry.addAction(setPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
-        contentActionRegistry.addAction(setRejectStatus, contentsModerated);
-        contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
-        contextActionRegistry.addAction(addDoc, TYPE_ROOT, TYPE_FOLDER);
-        contextActionRegistry.addAction(addWikiPage, TYPE_WIKI);
-        contextActionRegistry.addAction(addFolder, TYPE_ROOT, TYPE_FOLDER);
-        contextActionRegistry.addAction(addWiki, TYPE_ROOT);
-        contextActionRegistry.addAction(addGallery, TYPE_ROOT);
+        createContentModeratedActions(parentMenuTitle, contentsModerated);
+        createDownloadActions(TYPE_UPLOADEDFILE);
+
         contextActionRegistry.addAction(go, all);
         contentActionRegistry.addAction(renameCtn, contents);
         contextActionRegistry.addAction(renameCtx, containersNoRoot);
         contextActionRegistry.addAction(refreshCtx, containers);
         contentActionRegistry.addAction(refreshCnt, contents);
         contextActionRegistry.addAction(uploadFile, TYPE_ROOT, TYPE_FOLDER);
-        contentActionRegistry.addAction(download, TYPE_UPLOADEDFILE);
         contentActionRegistry.addAction(delContent, contents);
         contextActionRegistry.addAction(delContainer, containersNoRoot);
         contentActionRegistry.addAction(setAsDefGroupCnt, TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
         // contentActionRegistry.addAction(setAsDefGroupCxt,);
         contextActionRegistry.addAction(goGroupHome, containers);
-        contextActionRegistry.addAction(downloadCtx, TYPE_UPLOADEDFILE);
         contentActionRegistry.addAction(editContent, TYPE_DOCUMENT, TYPE_WIKIPAGE);
         contentActionRegistry.addAction(translateContent, TYPE_DOCUMENT, TYPE_FOLDER, TYPE_GALLERY, TYPE_UPLOADEDFILE,
                 TYPE_WIKI, TYPE_WIKIPAGE);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2008-11-25 00:51:20 UTC (rev 967)
@@ -1,5 +1,7 @@
 package org.ourproject.kune.workspace.client;
 
+import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
+
 import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
 import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
@@ -44,6 +46,10 @@
 
 public abstract class AbstractFoldableContentActions {
 
+    protected enum Position {
+        cnt, ctx
+    }
+
     protected final Session session;
     protected final StateManager stateManager;
     protected final I18nUITranslationService i18n;
@@ -63,8 +69,6 @@
     protected ActionMenuItemDescriptor<StateToken> go;
     protected ActionToolbarButtonDescriptor<StateToken> goGroupHome;
     protected ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia;
-    protected ActionToolbarButtonDescriptor<StateToken> download;
-    protected ActionMenuItemDescriptor<StateToken> downloadCtx;
     protected ActionToolbarButtonDescriptor<StateToken> translateContent;
     protected ActionToolbarButtonDescriptor<StateToken> editContent;
 
@@ -105,53 +109,27 @@
     protected void createActions() {
     }
 
-    protected ActionToolbarMenuAndItemDescriptor<StateToken> createContainerAction(final String contentTypeId,
-            final String iconUrl, final String textDescription, final String parentMenuTitle,
-            final String parentMenuSubtitle, final String defaultName) {
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
-        addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
-                ActionToolbarPosition.topbar, new Listener<StateToken>() {
-                    public void onEvent(final StateToken stateToken) {
-                        Site.showProgressProcessing();
-                        contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
-                                contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
-                                    public void onSuccess(final StateContainerDTO state) {
-                                        contextNavigator.setEditOnNextStateChange(true);
-                                        stateManager.setRetrievedState(state);
-                                    }
-                                });
-                    }
-                });
-        addFolder.setTextDescription(textDescription);
-        addFolder.setParentMenuTitle(parentMenuTitle);
-        addFolder.setParentSubMenuTitle(parentMenuSubtitle);
-        addFolder.setIconUrl(iconUrl);
-        return addFolder;
+    protected void createContentModeratedActions(String parentMenuTitle, final String... contentsModerated) {
+        final ActionToolbarMenuDescriptor<StateToken> setPublishStatus = createSetStatusAction(
+                AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
+                ContentStatusDTO.publishedOnline);
+        final ActionToolbarMenuDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
+                AccessRolDTO.Administrator, i18n.t("Editing in progress"), parentMenuTitle,
+                ContentStatusDTO.editingInProgress);
+        final ActionToolbarMenuDescriptor<StateToken> setRejectStatus = createSetStatusAction(
+                AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
+        final ActionToolbarMenuDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
+                AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
+                ContentStatusDTO.publishedOnline);
+        final ActionToolbarMenuDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
+                AccessRolDTO.Administrator, i18n.t("In the dustbin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
+        contentActionRegistry.addAction(setPublishStatus, contentsModerated);
+        contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
+        contentActionRegistry.addAction(setRejectStatus, contentsModerated);
+        contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
+        contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
     }
 
-    protected ActionToolbarMenuAndItemDescriptor<StateToken> createContentAction(String iconUrl,
-            final String description, final String parentMenuTitle, final String typeId) {
-        final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = new ActionToolbarMenuAndItemDescriptor<StateToken>(
-                AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
-                    public void onEvent(final StateToken token) {
-                        Site.showProgressProcessing();
-                        contentServiceProvider.get().addContent(session.getUserHash(),
-                                session.getCurrentState().getStateToken(), description, typeId,
-                                new AsyncCallbackSimple<StateContentDTO>() {
-                                    public void onSuccess(final StateContentDTO state) {
-                                        contextNavigator.setEditOnNextStateChange(true);
-                                        stateManager.setRetrievedState(state);
-                                    }
-                                });
-                    }
-                });
-        addDoc.setTextDescription(description);
-        addDoc.setParentMenuTitle(parentMenuTitle);
-        addDoc.setParentSubMenuTitle(i18n.t("New"));
-        addDoc.setIconUrl(iconUrl);
-        return addDoc;
-    }
-
     protected ActionToolbarMenuAndItemDescriptor<StateToken> createContentRenameAction(String parentMenuTitle,
             String textDescription) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
@@ -209,6 +187,79 @@
         return delContent;
     }
 
+    protected void createDownloadActions(String typeUploadedfile) {
+        ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
+                AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+                    public void onEvent(final StateToken token) {
+                        downloadContent(token);
+                    }
+                });
+        download.setMustBeAuthenticated(false);
+        download.setTextDescription(i18n.t("Download"));
+        download.setToolTip(i18n.t("Download this file"));
+        download.setIconUrl("images/nav/download.png");
+
+        ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
+                AccessRolDTO.Viewer, new Listener<StateToken>() {
+                    public void onEvent(final StateToken token) {
+                        downloadContent(token);
+                    }
+                });
+        downloadCtx.setMustBeAuthenticated(false);
+        downloadCtx.setTextDescription(i18n.t("Download"));
+        downloadCtx.setIconUrl("images/nav/download.png");
+
+        contentActionRegistry.addAction(download, TYPE_UPLOADEDFILE);
+        contextActionRegistry.addAction(downloadCtx, TYPE_UPLOADEDFILE);
+    }
+
+    protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
+            final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
+            final String defaultName, Position position, String... registerInTypes) {
+        final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
+        addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
+                ActionToolbarPosition.topbar, new Listener<StateToken>() {
+                    public void onEvent(final StateToken stateToken) {
+                        Site.showProgressProcessing();
+                        contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
+                                contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
+                                    public void onSuccess(final StateContainerDTO state) {
+                                        contextNavigator.setEditOnNextStateChange(true);
+                                        stateManager.setRetrievedState(state);
+                                    }
+                                });
+                    }
+                });
+        addFolder.setTextDescription(textDescription);
+        addFolder.setParentMenuTitle(parentMenuTitle);
+        addFolder.setParentSubMenuTitle(parentMenuSubtitle);
+        addFolder.setIconUrl(iconUrl);
+        register(addFolder, position, registerInTypes);
+    }
+
+    protected void createNewContentAction(final String typeId, String iconUrl, final String description,
+            final String parentMenuTitle, Position position, String... registerInTypes) {
+        final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+                AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+                    public void onEvent(final StateToken token) {
+                        Site.showProgressProcessing();
+                        contentServiceProvider.get().addContent(session.getUserHash(),
+                                session.getCurrentState().getStateToken(), description, typeId,
+                                new AsyncCallbackSimple<StateContentDTO>() {
+                                    public void onSuccess(final StateContentDTO state) {
+                                        contextNavigator.setEditOnNextStateChange(true);
+                                        stateManager.setRetrievedState(state);
+                                    }
+                                });
+                    }
+                });
+        addContent.setTextDescription(description);
+        addContent.setParentMenuTitle(parentMenuTitle);
+        addContent.setParentSubMenuTitle(i18n.t("New"));
+        addContent.setIconUrl(iconUrl);
+        register(addContent, position, registerInTypes);
+    }
+
     protected void createPostSessionInitActions() {
     }
 
@@ -365,26 +416,6 @@
         });
         goGroupHome.setLeftSeparator(ActionToolbarButtonSeparator.fill);
 
-        download = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
-                new Listener<StateToken>() {
-                    public void onEvent(final StateToken token) {
-                        downloadContent(token);
-                    }
-                });
-        download.setMustBeAuthenticated(false);
-        download.setTextDescription(i18n.t("Download"));
-        download.setToolTip(i18n.t("Download this file"));
-        download.setIconUrl("images/nav/download.png");
-
-        downloadCtx = new ActionMenuItemDescriptor<StateToken>(AccessRolDTO.Viewer, new Listener<StateToken>() {
-            public void onEvent(final StateToken token) {
-                downloadContent(token);
-            }
-        });
-        downloadCtx.setMustBeAuthenticated(false);
-        downloadCtx.setTextDescription(i18n.t("Download"));
-        downloadCtx.setIconUrl("images/nav/download.png");
-
         translateContent = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Editor,
                 ActionToolbarPosition.topbar, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -493,4 +524,16 @@
         });
         return setGroupLogo;
     }
+
+    private void register(ActionToolbarMenuAndItemDescriptor<StateToken> action, Position position,
+            String... registerInTypes) {
+        switch (position) {
+        case ctx:
+            contentActionRegistry.addAction(action, registerInTypes);
+            break;
+        case cnt:
+            contextActionRegistry.addAction(action, registerInTypes);
+            break;
+        }
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java	2008-11-24 20:24:03 UTC (rev 966)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java	2008-11-25 00:51:20 UTC (rev 967)
@@ -28,6 +28,7 @@
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.MouseListenerAdapter;
 import com.google.gwt.user.client.ui.Widget;
 
 public class EntityLicensePanel implements EntityLicenseView {
@@ -63,10 +64,23 @@
         licenseImage.addClickListener(clickListener);
         copyright.setVisible(false);
         licenseLabel.setVisible(false);
-        licenseImage.setVisible(false);
 
+        MouseListenerAdapter mouseListenerAdapter = new MouseListenerAdapter() {
+            @Override
+            public void onMouseEnter(Widget sender) {
+                copyright.setVisible(true);
+                licenseLabel.setVisible(true);
+            }
+
+            @Override
+            public void onMouseLeave(Widget sender) {
+            }
+        };
+        licenseImage.addMouseListener(mouseListenerAdapter);
+
         copyright.addStyleName("kune-Margin-Large-l");
         licenseLabel.setStyleName("k-entitylicensepanel-licensetext");
+        licenseImage.setStyleName("k-elp-limg");
     }
 
     public void attach() {
@@ -88,9 +102,8 @@
     public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
         copyright.setText(i18n.t("© [%s], under license: ", groupName));
         licenseLabel.setText(licenseDTO.getLongName());
-        copyright.setVisible(true);
-        licenseLabel.setVisible(true);
-        licenseImage.setVisible(true);
+        copyright.setVisible(false);
+        licenseLabel.setVisible(false);
         licenseImage.setUrl(licenseDTO.getImageUrl());
     }
 }




More information about the kune-commits mailing list