From 6e745c53ecc689b0e8d15ce8f64a4b77940b99a7 Mon Sep 17 00:00:00 2001 From: Stefan Kopf Date: Mon, 4 Aug 2014 19:36:26 +0000 Subject: [PATCH] ACE-2379 - 'Edit online' action is not working git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78925 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/jscript/SlingshotDocLibCustomResponse.java | 9 +++++---- .../org/alfresco/repo/jscript/app/CustomResponse.java | 6 +++++- .../repo/jscript/app/VtiServerCustomResponse.java | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/source/java/org/alfresco/repo/jscript/SlingshotDocLibCustomResponse.java b/source/java/org/alfresco/repo/jscript/SlingshotDocLibCustomResponse.java index 59ba980b34..592ec63a39 100644 --- a/source/java/org/alfresco/repo/jscript/SlingshotDocLibCustomResponse.java +++ b/source/java/org/alfresco/repo/jscript/SlingshotDocLibCustomResponse.java @@ -21,6 +21,7 @@ package org.alfresco.repo.jscript; import org.alfresco.repo.jscript.app.CustomResponse; import org.json.JSONException; import org.json.JSONObject; +import org.springframework.extensions.webscripts.DefaultURLModel; import java.io.Serializable; import java.util.Map; @@ -49,9 +50,9 @@ public final class SlingshotDocLibCustomResponse extends BaseScopableProcessorEx * * @return The JSON string */ - public String getJSON() + public String getJSON(DefaultURLModel url) { - return this.getJSONObj().toString(); + return this.getJSONObj(url).toString(); } /** @@ -59,7 +60,7 @@ public final class SlingshotDocLibCustomResponse extends BaseScopableProcessorEx * * @return The JSON object */ - protected Object getJSONObj() + protected Object getJSONObj(DefaultURLModel url) { JSONObject json = new JSONObject(); @@ -68,7 +69,7 @@ public final class SlingshotDocLibCustomResponse extends BaseScopableProcessorEx { try { - Serializable response = ((CustomResponse) entry.getValue()).populate(); + Serializable response = ((CustomResponse) entry.getValue()).populate(url); json.put(entry.getKey(), response == null ? JSONObject.NULL: response); } catch (JSONException error) diff --git a/source/java/org/alfresco/repo/jscript/app/CustomResponse.java b/source/java/org/alfresco/repo/jscript/app/CustomResponse.java index 3317530991..e99e10afed 100644 --- a/source/java/org/alfresco/repo/jscript/app/CustomResponse.java +++ b/source/java/org/alfresco/repo/jscript/app/CustomResponse.java @@ -21,6 +21,8 @@ package org.alfresco.repo.jscript.app; import java.io.Serializable; +import org.springframework.extensions.webscripts.DefaultURLModel; + /** * Interface for custom properties used by SlingshotDocLibCustomResponse * @@ -30,6 +32,8 @@ public interface CustomResponse { /** * Populates the DocLib webscript response with custom metadata + * + * @param url the URL that initiated the webscript request */ - Serializable populate(); + Serializable populate(DefaultURLModel url); } diff --git a/source/java/org/alfresco/repo/jscript/app/VtiServerCustomResponse.java b/source/java/org/alfresco/repo/jscript/app/VtiServerCustomResponse.java index 79f07aa823..ae2d3be167 100644 --- a/source/java/org/alfresco/repo/jscript/app/VtiServerCustomResponse.java +++ b/source/java/org/alfresco/repo/jscript/app/VtiServerCustomResponse.java @@ -23,6 +23,7 @@ import org.alfresco.repo.jscript.ScriptUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeansException; +import org.springframework.extensions.webscripts.DefaultURLModel; import java.io.Serializable; import java.util.LinkedHashMap; @@ -111,7 +112,7 @@ public class VtiServerCustomResponse implements CustomResponse * * @return JSONObject or null */ - public Serializable populate() + public Serializable populate(DefaultURLModel url) { try {