. Fix to issue in login page redirect code where URL arguments (e.g. for templates and scripts) were removed and not passed through.

- this only affected the template/command servlets that were using parameters and had not already logged in

. Support for 'path' argument on DownloadContentServlet
  for example /alfresco/download/direct?path=/Company%20Home/Kev's%20Home%20Space/myimage.jpg
  - paths are specified in a similar way to webdav path - they are 'cm:name' based URL encoded strings
  - this means we no longer need to have the NodeRef to a document to download it

. Support for 'templatePath' and 'contextPath' URL arguments in TemplateContentServlet
  for example: /alfresco/template?templatePath=/Company%20Home/Data%20Dictionary/Presentation%20Templates/doc_info.ftl&contextPath=/Company%20Home/file.txt
  - the 'templatePath' argument specifies the cm:name based path to the template to execute
  - the 'contextPath' argument specifies the cm:name based path to the context for the template

. Support for 'scriptPath' and 'contextPath' URL arguments in Script CommandProcessor
  for example: /alfresco/command/script/execute?scriptPath=/Company%20Home/Data%20Dictionary/Scripts/append%20copyright.js&contextPath=/Company%20Home/file.txt
  - the 'scriptPath' argument specifies the cm:name based path to the script to execute
  - the 'contextPath' argument specifies the cm:name based path to the context for the script

. Adding debugging output to get timings for executing templates and scripts

. Enhancements and additions to JavaScript API:
  setPermission()
  removePermission()
  get/setInheritsPermissions()

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3297 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-07-11 10:13:30 +00:00
parent 8af011cd6d
commit 08f4586da7
8 changed files with 252 additions and 71 deletions

View File

@@ -18,6 +18,9 @@ package org.alfresco.web.app.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import javax.servlet.ServletException;
@@ -101,10 +104,19 @@ public class CommandServlet extends BaseServlet
String command = t.nextToken();
// get any remaining uri elements to pass to the processor
String[] args = new String[tokenCount - 3];
String[] urlElements = new String[tokenCount - 3];
for (int i=0; i<tokenCount-3; i++)
{
args[i] = t.nextToken();
urlElements[i] = t.nextToken();
}
// retrieve the URL arguments to pass to the processor
Map<String, String> args = new HashMap<String, String>(8, 1.0f);
Enumeration names = req.getParameterNames();
while (names.hasMoreElements())
{
String name = (String)names.nextElement();
args.put(name, req.getParameter(name));
}
try
@@ -113,13 +125,13 @@ public class CommandServlet extends BaseServlet
CommandProcessor processor = createCommandProcessor(procName);
// validate that the processor has everything it needs to run the command
ServiceRegistry serviceRegistry = getServiceRegistry(getServletContext());
if (processor.validateArguments(serviceRegistry, command, args) == false)
if (processor.validateArguments(getServletContext(), command, args, urlElements) == false)
{
redirectToLoginPage(req, res, getServletContext());
return;
}
ServiceRegistry serviceRegistry = getServiceRegistry(getServletContext());
UserTransaction txn = null;
try
{