diff --git a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java index fb8089dbce..0545dc1777 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java @@ -417,6 +417,10 @@ public class CreateFormWizard this.getSchemaFileName().length() == 0 || this.getSchemaRootElementNameChoices().size() == 0); } + case 2: + { + return this.getRenderingEngineTemplateFileName() != null; + } default: { return false; diff --git a/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java b/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java index 3c466f3787..ddaed5c29f 100644 --- a/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java +++ b/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java @@ -24,6 +24,7 @@ package org.alfresco.web.bean.wcm; import java.io.*; +import java.text.MessageFormat; import java.util.*; import javax.faces.context.ExternalContext; @@ -131,8 +132,8 @@ public class FilePickerBean final String previewStorePath = AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath()); currentPath = AVMUtil.buildPath(previewStorePath, - currentPath, - AVMUtil.PathRelation.WEBAPP_RELATIVE); + currentPath, + AVMUtil.PathRelation.WEBAPP_RELATIVE); } LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")"); @@ -144,9 +145,12 @@ public class FilePickerBean final AVMNodeDescriptor currentNode = this.avmService.lookup(-1, currentPath); if (currentNode == null) { - final Element errorElement = result.createElement("error"); - errorElement.appendChild(result.createTextNode("Path " + currentPath + " not found")); - filePickerDataElement.appendChild(errorElement); + currentPath = AVMUtil.getWebappRelativePath(currentPath); + + filePickerDataElement.setAttribute("error", + MessageFormat.format(Application.getMessage(facesContext, "error_not_found"), + currentPath.substring(currentPath.lastIndexOf("/") + 1, currentPath.length()), + currentPath.lastIndexOf("/") == 0 ? "/" : currentPath.substring(0, currentPath.lastIndexOf("/")))); currentPath = this.getCurrentAVMPath(); } else if (! currentNode.isDirectory()) diff --git a/source/web/scripts/ajax/file_picker_widget.js b/source/web/scripts/ajax/file_picker_widget.js index 8a78788996..938889198a 100644 --- a/source/web/scripts/ajax/file_picker_widget.js +++ b/source/web/scripts/ajax/file_picker_widget.js @@ -427,6 +427,11 @@ _showPicker: function(data) "xformsRow" + (i % 2 ? "Even" : "Odd")); this.contentDiv.appendChild(row); } + + if (data.getAttribute("error") && data.getAttribute("error").length != 0) + { + this._showStatus(data.getAttribute("error"), true); + } }, _createRow: function(fileName, webappRelativePath, isDirectory, fileTypeImage, rowClass) diff --git a/source/web/scripts/ajax/tiny_mce_wcm_extensions.js b/source/web/scripts/ajax/tiny_mce_wcm_extensions.js index 573f82cb98..ca6940c7b3 100644 --- a/source/web/scripts/ajax/tiny_mce_wcm_extensions.js +++ b/source/web/scripts/ajax/tiny_mce_wcm_extensions.js @@ -27,19 +27,25 @@ function alfresco_TinyMCE_urlconverter_callback(href, element, onsave) { -// dojo.debug("request to convert " + href + " onsave = " + onsave); + var result = null; if (onsave) { - return (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL) - ? href.substring(alfresco.constants.AVM_WEBAPP_URL.length) - : href); + result = (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL) + ? href.substring(alfresco.constants.AVM_WEBAPP_URL.length) + : href); } else { - return (href && href.startsWith("/") - ? alfresco.constants.AVM_WEBAPP_URL + href - : href); + result = (href && href.startsWith("/") + ? alfresco.constants.AVM_WEBAPP_URL + href + : href); } + if (href && href.startsWith(document.location.href)) + { + result = href.substring(document.location.href.length); + } +// dojo.debug("alfresco_TinyMCE_urlconverter_callback('" + href + "', ... , " + onsave + ") = " + result); + return result; } function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)