various minor bug fixes to create/edit form, parseXMLDocuments

- WCM-351 fixes to select workflow screen on IE (weird onchange behavior)
- WCM-468 fixes to remove rendering engine
- doing the jsp 2.0 thing
- WCM-427 fix to encoding issue with parseXMLDocuements
- fix for remove rendering engine templates in create form (wasn't clearing the list in init)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5630 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-05-04 21:02:05 +00:00
parent 3c1db37e0c
commit 6e0afbf34c
9 changed files with 357 additions and 318 deletions

View File

@@ -32,6 +32,7 @@ import freemarker.template.TemplateModelException;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.*;
import javax.faces.context.FacesContext;
@@ -57,6 +58,7 @@ import org.alfresco.service.cmr.remote.AVMRemote;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.context.WebApplicationContext;
@@ -378,10 +380,15 @@ public class RenderingEngineTemplateImpl
}
}
URI uri = null;
try
{
uri = new URI(webappUrl + (name.charAt(0) == '/' ? name : '/' + name));
final String[] path = (name.startsWith("/") ? name.substring(1) : name).split("/");
for (int i = 0; i < path.length; i++)
{
path[i] = URLEncoder.encode(path[i], "utf-8").replace("+", "%20");
}
final URI uri = new URI(webappUrl + '/' + StringUtils.join(path, '/'));
if (LOGGER.isDebugEnabled())
LOGGER.debug("loading " + uri);
return uri.toURL().openStream();

View File

@@ -149,10 +149,15 @@ public class XMLUtil
throws SAXException,
IOException
{
final DocumentBuilder db = XMLUtil.getDocumentBuilder();
final Document result = db.parse(source);
source.close();
return result;
try
{
final DocumentBuilder db = XMLUtil.getDocumentBuilder();
return db.parse(source);
}
finally
{
source.close();
}
}
/** provides a document builder that is namespace aware but not validating by default */