fixes for WCM-511 and WCM-512

- preserve anchor (#anchor) urls in tinymce
- better error handling in file picker widget
- disabling next while in the midst of adding a rendering engine (usability fix)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6058 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-06-21 19:29:33 +00:00
parent 830254ef6d
commit 8172e5b73f
4 changed files with 31 additions and 12 deletions

View File

@@ -417,6 +417,10 @@ public class CreateFormWizard
this.getSchemaFileName().length() == 0 || this.getSchemaFileName().length() == 0 ||
this.getSchemaRootElementNameChoices().size() == 0); this.getSchemaRootElementNameChoices().size() == 0);
} }
case 2:
{
return this.getRenderingEngineTemplateFileName() != null;
}
default: default:
{ {
return false; return false;

View File

@@ -24,6 +24,7 @@
package org.alfresco.web.bean.wcm; package org.alfresco.web.bean.wcm;
import java.io.*; import java.io.*;
import java.text.MessageFormat;
import java.util.*; import java.util.*;
import javax.faces.context.ExternalContext; import javax.faces.context.ExternalContext;
@@ -131,8 +132,8 @@ public class FilePickerBean
final String previewStorePath = final String previewStorePath =
AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath()); AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath());
currentPath = AVMUtil.buildPath(previewStorePath, currentPath = AVMUtil.buildPath(previewStorePath,
currentPath, currentPath,
AVMUtil.PathRelation.WEBAPP_RELATIVE); AVMUtil.PathRelation.WEBAPP_RELATIVE);
} }
LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")"); LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")");
@@ -144,9 +145,12 @@ public class FilePickerBean
final AVMNodeDescriptor currentNode = this.avmService.lookup(-1, currentPath); final AVMNodeDescriptor currentNode = this.avmService.lookup(-1, currentPath);
if (currentNode == null) if (currentNode == null)
{ {
final Element errorElement = result.createElement("error"); currentPath = AVMUtil.getWebappRelativePath(currentPath);
errorElement.appendChild(result.createTextNode("Path " + currentPath + " not found"));
filePickerDataElement.appendChild(errorElement); 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(); currentPath = this.getCurrentAVMPath();
} }
else if (! currentNode.isDirectory()) else if (! currentNode.isDirectory())

View File

@@ -427,6 +427,11 @@ _showPicker: function(data)
"xformsRow" + (i % 2 ? "Even" : "Odd")); "xformsRow" + (i % 2 ? "Even" : "Odd"));
this.contentDiv.appendChild(row); 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) _createRow: function(fileName, webappRelativePath, isDirectory, fileTypeImage, rowClass)

View File

@@ -27,19 +27,25 @@
function alfresco_TinyMCE_urlconverter_callback(href, element, onsave) function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
{ {
// dojo.debug("request to convert " + href + " onsave = " + onsave); var result = null;
if (onsave) if (onsave)
{ {
return (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL) result = (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL)
? href.substring(alfresco.constants.AVM_WEBAPP_URL.length) ? href.substring(alfresco.constants.AVM_WEBAPP_URL.length)
: href); : href);
} }
else else
{ {
return (href && href.startsWith("/") result = (href && href.startsWith("/")
? alfresco.constants.AVM_WEBAPP_URL + href ? alfresco.constants.AVM_WEBAPP_URL + href
: 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) function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)