mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Activity Service - for template store, move "path" arg to be URL extension (SLNG-777)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9832 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,6 +31,7 @@ import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.web.scripts.DeclarativeWebScript;
|
||||
import org.alfresco.web.scripts.SearchPath;
|
||||
import org.alfresco.web.scripts.Status;
|
||||
@@ -61,10 +62,16 @@ public class TemplateWebScript extends DeclarativeWebScript
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
|
||||
// process arguments
|
||||
String path = req.getParameter("p"); // required
|
||||
// process extension
|
||||
String path = req.getExtensionPath(); // required
|
||||
|
||||
if ((path != null) && (path.length() != 0))
|
||||
if ((path == null) || (path.length() == 0))
|
||||
{
|
||||
String msg = "Failed to getTemplate: missing {path}";
|
||||
logger.error(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (path.endsWith(".ftl"))
|
||||
{
|
||||
|
@@ -29,6 +29,7 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.web.scripts.DeclarativeWebScript;
|
||||
import org.alfresco.web.scripts.SearchPath;
|
||||
import org.alfresco.web.scripts.Status;
|
||||
@@ -53,12 +54,12 @@ public class TemplatesWebScript extends DeclarativeWebScript
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
|
||||
{
|
||||
// process arguments
|
||||
String p = req.getParameter("p"); // optional
|
||||
|
||||
String path = "/";
|
||||
String templatePattern = "*.ftl";
|
||||
|
||||
// process extension
|
||||
String p = req.getExtensionPath(); // optional
|
||||
|
||||
if ((p != null) && (p.length() > 0))
|
||||
{
|
||||
int idx = p.lastIndexOf("/");
|
||||
|
Reference in New Issue
Block a user