[kune-commits] r1013 - in trunk/src: main/java/org/ourproject/kune/platf/client/dto main/java/org/ourproject/kune/platf/client/ui/upload main/java/org/ourproject/kune/platf/server/domain main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/ctxnav main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal main/java/org/ourproject/kune/workspace/client/i18n main/java/org/ourproject/kune/workspace/client/licensefoot test/java/org/ourproject/kune/platf/integration/content test/java/org/ourproject/kune/platf/server/mapper

vjrj vjrj at ourproject.org
Tue Dec 23 02:01:07 CET 2008


Author: vjrj
Date: 2008-12-23 02:01:04 +0100 (Tue, 23 Dec 2008)
New Revision: 1013

Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java
   trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
bug fixes...

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -86,7 +86,7 @@
         return this;
     }
 
-    public StateToken clone() {
+    public StateToken copy() {
         return new StateToken(this.getEncoded());
     }
 
@@ -131,21 +131,23 @@
     public String getPublicUrl() {
         String publicUrl = "http://";
 
-        if (group != null) {
-            publicUrl += group + SEPARATOR;
-        }
+        String separator = "/";
 
         // FIXME: Maybe get from InitData the site.domain
-        publicUrl += WindowUtils.getLocation().getHostName() + "/";
+        String port = WindowUtils.getLocation().getPort();
+        publicUrl += WindowUtils.getLocation().getHostName() + (port == null ? "" : ":" + port) + "/public";
 
+        if (group != null) {
+            publicUrl += separator + group;
+        }
         if (tool != null) {
-            publicUrl += tool;
+            publicUrl += separator + tool;
         }
         if (folder != null) {
-            publicUrl += SEPARATOR + folder;
+            publicUrl += separator + folder;
         }
         if (document != null) {
-            publicUrl += SEPARATOR + document;
+            publicUrl += separator + document;
         }
 
         return publicUrl;
@@ -224,6 +226,7 @@
         return this;
     }
 
+    @Override
     public String toString() {
         return getEncoded();
     }
@@ -248,5 +251,4 @@
         setFolder(conditionalAssign(2, splitted));
         setDocument(conditionalAssign(3, splitted));
     }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -39,7 +39,7 @@
     }
 
     public boolean checkFolderChange() {
-        final StateToken currentFolderStateToken = session.getCurrentStateToken().clone().clearDocument();
+        final StateToken currentFolderStateToken = session.getCurrentStateToken().copy().clearDocument();
         if (sameContainer()) {
             view.setUploadParams(session.getUserHash(), currentFolderStateToken.toString(),
                     currentFolderStateToken.getTool() + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX);

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -228,7 +228,7 @@
 
     @Transient
     public StateToken getStateToken() {
-        return getContainer().getStateToken().clone().setDocument(getId());
+        return getContainer().getStateToken().copy().setDocument(getId());
     }
 
     @Transient

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -115,7 +115,8 @@
                 AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
                 ContentStatusDTO.publishedOnline);
         final ActionToolbarMenuRadioDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
+                AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), parentMenuTitle,
+                ContentStatusDTO.inTheDustbin);
         contentActionRegistry.addAction(setPublishStatus, contentsModerated);
         contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
         contentActionRegistry.addAction(setRejectStatus, contentsModerated);
@@ -157,7 +158,7 @@
                         contentServiceProvider.get().delContent(session.getUserHash(), token,
                                 new AsyncCallbackSimple<String>() {
                                     public void onSuccess(final String result) {
-                                        final StateToken parent = token.clone().clearDocument();
+                                        final StateToken parent = token.copy().clearDocument();
                                         stateManager.gotoToken(parent);
                                     }
                                 });

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -222,7 +222,7 @@
             rights = containerRights;
             final ActionItemCollection<StateToken> containerActions = addItem(container.getName(),
                     container.getTypeId(), null, ContentStatusDTO.publishedOnline, container.getStateToken(),
-                    container.getStateToken().clone().setFolder(container.getParentFolderId()), containerRights, false);
+                    container.getStateToken().copy().setFolder(container.getParentFolderId()), containerRights, false);
             actionItems.addAll(containerActions);
         }
 
@@ -284,13 +284,12 @@
     private void createChildItems(final ContainerDTO container, final AccessRightsDTO containerRights) {
         for (final ContentSimpleDTO content : container.getContents()) {
             addItem(content.getTitle(), content.getTypeId(), content.getMimeType(), content.getStatus(),
-                    content.getStateToken(), content.getStateToken().clone().clearDocument(), content.getRights(),
-                    false);
+                    content.getStateToken(), content.getStateToken().copy().clearDocument(), content.getRights(), false);
         }
 
         for (final ContainerSimpleDTO siblingFolder : container.getChilds()) {
             addItem(siblingFolder.getName(), siblingFolder.getTypeId(), null, ContentStatusDTO.publishedOnline,
-                    siblingFolder.getStateToken(), siblingFolder.getStateToken().clone().setFolder(
+                    siblingFolder.getStateToken(), siblingFolder.getStateToken().copy().setFolder(
                             siblingFolder.getParentFolderId()), containerRights, false);
         }
     }
@@ -299,7 +298,7 @@
             final AccessRightsDTO rights) {
         for (final ContainerSimpleDTO folder : absolutePath) {
             final StateToken folderStateToken = folder.getStateToken();
-            final StateToken parentStateToken = state.clone().clearDocument().setFolder(folder.getParentFolderId());
+            final StateToken parentStateToken = state.copy().clearDocument().setFolder(folder.getParentFolderId());
 
             if (folder.getParentFolderId() != null) {
                 addItem(folder.getName(), folder.getTypeId(), null, ContentStatusDTO.publishedOnline, folderStateToken,

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -23,6 +23,6 @@
 
     public void onInsert(String name, String link) {
         editorInsertElement.fireOnInsert(name, link);
-        view.clear();
+        view.reset();
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -4,6 +4,6 @@
 
 public interface TextEditorInsertAbstractView extends View {
 
-    void clear();
+    void reset();
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -3,6 +3,7 @@
 import org.ourproject.kune.platf.client.dto.LinkDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementView;
 import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherPanel;
@@ -19,6 +20,8 @@
         super(i18n, TEMPLATE_TEXT_PREFIX + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
                 + TEMPLATE_TEXT_SUFFIX, DATA_PROXY_URL, new Listener<LinkDTO>() {
             public void onEvent(LinkDTO link) {
+                // FIXME
+                presenter.onInsert("", WindowUtils.getLocation().getHref() + link.getLink());
             }
         });
         super.setTitle(i18n.t("Local link"));

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -127,7 +127,7 @@
         center.setClosable(false);
         center.setBorder(false);
 
-        final Window dialog = new BasicDialog(TRANSLATOR_DIALOG, "", false, false, 720, 330);
+        final Window dialog = new BasicDialog(TRANSLATOR_DIALOG, "", false, false, 620, 330);
         // dialog.setResizable(false);
         dialog.setIconCls("i18n-icon");
 
@@ -222,7 +222,7 @@
             {
                 setHeader(i18n.t("Text to translate"));
                 setDataIndex("trKey");
-                setWidth(335);
+                setWidth(285);
                 setTooltip(i18n.t("Click to sort"));
                 setRenderer(renderNT);
             }
@@ -234,7 +234,7 @@
             {
                 setHeader(i18n.t("Translation (click to edit)"));
                 setDataIndex("text");
-                setWidth(335);
+                setWidth(285);
                 setEditor(textColumnEditor);
             }
         };
@@ -243,7 +243,7 @@
 
         columnModel.setDefaultSortable(true);
 
-        final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
+        final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 595,
                 180, store, columnModel);
         createPagingToolbar(store, grid);
 

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-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -60,7 +60,7 @@
             }
         };
 
-        licenseLabel.addClickListener(clickListener);
+        // licenseLabel.addClickListener(clickListener);
         licenseImage.addClickListener(clickListener);
 
         MouseListenerAdapter mouseListenerAdapter = new MouseListenerAdapter() {

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -82,7 +82,7 @@
     @Test(expected = ContentNotFoundException.class)
     public void nonExistentContent4() throws Exception {
         final StateContainerDTO stateDTO = getSiteDefaultContent();
-        contentService.getContent(null, stateDTO.getStateToken().clone().setDocument("dadaas"));
+        contentService.getContent(null, stateDTO.getStateToken().copy().setDocument("dadaas"));
     }
 
     @Test(expected = ContentNotFoundException.class)

Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java	2008-12-22 10:39:52 UTC (rev 1012)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java	2008-12-23 01:01:04 UTC (rev 1013)
@@ -176,8 +176,8 @@
         assertTrue(dto.getContents().get(0) instanceof ContentSimpleDTO);
         assertTrue(dto.getChilds().get(0) instanceof ContainerSimpleDTO);
         assertEquals(new StateToken(TESTGROUPSHORTNAME, TESTTOOL),
-                dto.getChilds().get(0).getStateToken().clone().clearFolder());
-        assertEquals(expectedToken, dto.getContents().get(0).getStateToken().clone().clearDocument());
+                dto.getChilds().get(0).getStateToken().copy().clearFolder());
+        assertEquals(expectedToken, dto.getContents().get(0).getStateToken().copy().clearDocument());
         assertEquals(expectedToken, dto.getStateToken());
 
         final ContainerDTO dtoChild = mapper.map(containerChild, ContainerDTO.class);




More information about the kune-commits mailing list