// Path: webscripts/src/main/java/com/github/dynamicextensionsalfresco/webscripts/AnnotationWebScriptRequest.java
// public class AnnotationWebScriptRequest extends DelegatingWebScriptRequest implements WrappingWebScriptRequest {
// 
//     private final Map<String, Object> model = new LinkedHashMap<>();
//     private Throwable thrownException = null;
// 
//     public AnnotationWebScriptRequest(WebScriptRequest request) {
//         super(request);
// 
//     }
// 
//     public WebScriptRequest getWebScriptRequest() {
//         return this.getNext();
//     }
// 
// 
//     public Map<String, Object> getModel() {
//         return model;
//     }
// 
//     public Throwable getThrownException() {
//         return thrownException;
//     }
// 
//     public void setThrownException(Throwable thrownException) {
//         this.thrownException = thrownException;
//     }
// 
// }


import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebScriptRequest;
import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebscriptResponse;
import com.github.dynamicextensionsalfresco.webscripts.UrlModel;
import org.springframework.extensions.webscripts.*;
import org.springframework.extensions.webscripts.json.JSONUtils;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
package com.github.dynamicextensionsalfresco.webscripts.resolutions;



/**
 * Can be used directly by controllers or implicitly by returning a Map.
 *
 * @author Laurent Van der Linden
 */
public class TemplateResolution extends AbstractResolution {
    private static final String URL_VARIABLE = "url";
    private static final String WEBSCRIPT_VARIABLE = "webscript";
    private static final String JSON_UTILS = "jsonUtils";

    private String template;
    private Map<String,Object> model;

    public TemplateResolution() {
        this.model = new HashMap<String, Object>(3);
    }

    public TemplateResolution(Map<String, Object> model) {
        this.model = model;
    }

    public TemplateResolution(String template, Map<String, Object> model) {
        this.template = template;
        this.model = model;
    }

    public TemplateResolution(String template) {
        this.template = template;
    }

    @Override
    public void resolve() throws Exception {
// Path: webscripts/src/main/java/com/github/dynamicextensionsalfresco/webscripts/AnnotationWebScriptRequest.java
// public class AnnotationWebScriptRequest extends DelegatingWebScriptRequest implements WrappingWebScriptRequest {
// 
//     private final Map<String, Object> model = new LinkedHashMap<>();
//     private Throwable thrownException = null;
// 
//     public AnnotationWebScriptRequest(WebScriptRequest request) {
//         super(request);
// 
//     }
// 
//     public WebScriptRequest getWebScriptRequest() {
//         return this.getNext();
//     }
// 
// 
//     public Map<String, Object> getModel() {
//         return model;
//     }
// 
//     public Throwable getThrownException() {
//         return thrownException;
//     }
// 
//     public void setThrownException(Throwable thrownException) {
//         this.thrownException = thrownException;
//     }
// 
// }


// Path: webscripts/src/main/java/com/github/dynamicextensionsalfresco/webscripts/resolutions/TemplateResolution.java
import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebScriptRequest;
import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebscriptResponse;
import com.github.dynamicextensionsalfresco.webscripts.UrlModel;
import org.springframework.extensions.webscripts.*;
import org.springframework.extensions.webscripts.json.JSONUtils;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

package com.github.dynamicextensionsalfresco.webscripts.resolutions;



/**
 * Can be used directly by controllers or implicitly by returning a Map.
 *
 * @author Laurent Van der Linden
 */
public class TemplateResolution extends AbstractResolution {
    private static final String URL_VARIABLE = "url";
    private static final String WEBSCRIPT_VARIABLE = "webscript";
    private static final String JSON_UTILS = "jsonUtils";

    private String template;
    private Map<String,Object> model;

    public TemplateResolution() {
        this.model = new HashMap<String, Object>(3);
    }

    public TemplateResolution(Map<String, Object> model) {
        this.model = model;
    }

    public TemplateResolution(String template, Map<String, Object> model) {
        this.template = template;
        this.model = model;
    }

    public TemplateResolution(String template) {
        this.template = template;
    }

    @Override
    public void resolve() throws Exception {
        final AnnotationWebScriptRequest request = getRequest();