From 8330b9b924be6fe15f890ffd58f576d704afefb9 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 26 Jul 2006 09:43:07 +0000 Subject: [PATCH] Merged V1.3 to HEAD (3117:3125) svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3117 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3125 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3402 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/bean/CheckinCheckoutBean.java | 9 ++++++--- .../web/ui/common/component/UIGenericPicker.java | 2 +- .../alfresco/web/ui/common/component/UIPanel.java | 12 ++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java index 13e9d5bab2..eaf32c4830 100644 --- a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java +++ b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java @@ -744,7 +744,8 @@ public class CheckinCheckoutBean { try { - tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); + FacesContext context = FacesContext.getCurrentInstance(); + tx = Repository.getUserTransaction(context); tx.begin(); if (logger.isDebugEnabled()) @@ -763,8 +764,10 @@ public class CheckinCheckoutBean { // add the content to an anonymous but permanent writer location // we can then retrieve the URL to the content to to be set on the node during checkin - ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, false); - // TODO: Adjust the mimetype + ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true); + // also update the mime type in case a different type of file is uploaded + String mimeType = Repository.getMimeTypeForFileName(context, this.fileName); + writer.setMimetype(mimeType); writer.putContent(this.file); contentUrl = writer.getContentUrl(); } diff --git a/source/java/org/alfresco/web/ui/common/component/UIGenericPicker.java b/source/java/org/alfresco/web/ui/common/component/UIGenericPicker.java index b8c74892f9..582ae72d30 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIGenericPicker.java +++ b/source/java/org/alfresco/web/ui/common/component/UIGenericPicker.java @@ -221,7 +221,7 @@ public class UIGenericPicker extends UICommand { // use reflection to execute the query callback method and retrieve results Object result = callback.invoke(getFacesContext(), new Object[] { - this.filterIndex, this.contains}); + this.filterIndex, this.contains.trim()}); if (result instanceof SelectItem[]) { diff --git a/source/java/org/alfresco/web/ui/common/component/UIPanel.java b/source/java/org/alfresco/web/ui/common/component/UIPanel.java index 6d12cafcd2..7a5842fc68 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIPanel.java +++ b/source/java/org/alfresco/web/ui/common/component/UIPanel.java @@ -101,6 +101,10 @@ public class UIPanel extends UICommand // determine whether we have any adornments String label = getLabel(); + if (label != null) + { + label = Utils.encode(label); + } if (label != null || isProgressive() == true || titleComponent != null) { this.hasAdornments = true; @@ -156,11 +160,11 @@ public class UIPanel extends UICommand if (isExpanded() == true) { - out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, "")); + out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, label)); } else { - out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, "")); + out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, label)); } out.write("  "); @@ -174,11 +178,11 @@ public class UIPanel extends UICommand Utils.outputAttribute(out, getAttributes().get("styleClass"), "class"); out.write('>'); - out.write(Utils.encode(label)); + out.write(label); // already encoded above out.write(""); } - + if (this.hasAdornments) { out.write("");