Merged V2.2 to HEAD

7534: Merged V2.1 to HEAD
      7398: XPath metadata extractor selector handles malformed and empty XML files
      7401: Fix AR-1879: JBPM Timer never fires
      7413: Contribution: Integrity checker ignores exceptions that would normally trigger transaction retries.
      7416: AR-1884.Unicode wildcard processing.
      7417: Added filtering of pseudo files when a partial wildcard search path is used, such as '*.csv'. AR-1889.
      7436: AR-1863: major version's can now be created via the web service API;
      7451: Fix for handling of UTF-8 application/x-www-form-urlencoded encoded form arguments as raised in support ticket 242
      7458: Fix for AR-1900
      7520: Fix to Template API where content was not retrievable from custom d:content properties on a node


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8413 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-03-03 13:35:10 +00:00
parent d076396436
commit a3bbee6739

View File

@@ -25,6 +25,7 @@
package org.alfresco.web.app.servlet;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.SocketException;
import java.util.Enumeration;
import java.util.HashMap;
@@ -38,6 +39,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.FileTypeImageSize;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -124,6 +126,8 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
NodeRef nodeRef = null;
NodeRef templateRef = null;
try
{
String contentPath = req.getParameter(ARG_CONTEXT_PATH);
if (contentPath != null && contentPath.length() != 0)
{
@@ -153,6 +157,26 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
StoreRef storeRef = new StoreRef(t.nextToken(), t.nextToken());
templateRef = new NodeRef(storeRef, t.nextToken());
}
}
catch (AccessDeniedException err)
{
if (redirectToLogin)
{
if (logger.isDebugEnabled())
logger.debug("Redirecting to login page...");
redirectToLoginPage(req, res, getServletContext());
}
else
{
if (logger.isDebugEnabled())
logger.debug("Returning 403 Forbidden error...");
res.sendError(HttpServletResponse.SC_FORBIDDEN);
}
return;
}
// if no context is specified, use the template itself
// TODO: should this default to something else?
@@ -293,7 +317,11 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
while (names.hasMoreElements())
{
String name = (String)names.nextElement();
args.put(name, req.getParameter(name));
try
{
args.put(name, new String(req.getParameter(name).getBytes(), "UTF-8"));
}
catch (UnsupportedEncodingException err) {}
}
root.put("args", args);