Merge from SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10722 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-04 10:44:42 +00:00
parent 617f8e0b2c
commit f51be032bc
170 changed files with 18520 additions and 203 deletions

View File

@@ -27,6 +27,7 @@ package org.alfresco.repo.web.scripts.content;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
@@ -87,10 +88,12 @@ public class ContentGet extends StreamContent
// convert web script URL to node reference in Repository
String match = req.getServiceMatch().getPath();
String[] matchParts = match.split("/");
String extensionPath = req.getExtensionPath();
String[] extParts = extensionPath == null ? new String[1] : extensionPath.split("/");
String[] path = new String[extParts.length -1];
System.arraycopy(extParts, 1, path, 0, extParts.length -1);
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String[] id = templateVars.get("id").split("/");
String[] path = new String[id.length + 2];
path[0] = templateVars.get("store_type");
path[1] = templateVars.get("store_id");
System.arraycopy(id, 0, path, 2, id.length);
NodeRef nodeRef = repository.findNodeRef(matchParts[2], path);
if (nodeRef == null)
{
@@ -99,7 +102,7 @@ public class ContentGet extends StreamContent
// determine content property
QName propertyQName = ContentModel.PROP_CONTENT;
String contentPart = extParts[0];
String contentPart = templateVars.get("property");
if (contentPart.length() > 0 && contentPart.charAt(0) == ';')
{
if (contentPart.length() < 2)

View File

@@ -423,7 +423,6 @@ public class StreamContent extends AbstractWebScript
reader.setEncoding("UTF-8");
streamContentImpl(req, res, reader, attach, this.resouceFileModifiedDate);
}
/**
@@ -439,7 +438,6 @@ public class StreamContent extends AbstractWebScript
protected void streamContentImpl(WebScriptRequest req, WebScriptResponse res, ContentReader reader, boolean attach, Date modified)
throws IOException
{
HttpServletRequest httpReq = ((WebScriptServletRequest)req).getHttpServletRequest();
HttpServletResponse httpRes = ((WebScriptServletResponse)res).getHttpServletResponse();