@Override public Map<String, Object> getScriptParameters() { // NOTE: returns unmodifable map from super Map<String, Object> params = new HashMap<String, Object>(8, 1.0f); params.putAll(super.getScriptParameters()); // render context RequestContext context = getRequestContext(); ModelObject object = getModelObject(); // if we have a render context, populate root script properties if (context != null) { processorModelHelper.populateScriptModel(context, params, object); } return params; }
@Override public Map<String, Object> getTemplateParameters() { // NOTE: unmodifable map returned from super class Map<String, Object> params = new HashMap<String, Object>(32, 1.0f); params.putAll(super.getTemplateParameters()); // render context RequestContext context = getRequestContext(); ModelObject object = getModelObject(); // in the case of an internal error such as script compliation failing // the rendercontext can be null - as we are building template model // for the webscript status page - no futher work required here. if (context != null) { try { processorModelHelper.populateTemplateModel(context, params, object); } catch (RendererExecutionException ree) { // This exception is only thrown when processing // template objects, thus it shouldn't occur for web scripts } catch (UnsupportedEncodingException uee) { // should not occur as UTF-8 is always supported } } return params; }
@Override public void reset() { super.reset(); // called early when WSF initialises - can safely ignore until we have a WF app context if (getApplicationContext() != null) { this.getScriptProcessorRegistry().reset(); this.getTemplateProcessorRegistry().reset(); } }
public void executeScript(WebScriptRequest scriptReq, WebScriptResponse scriptRes, Authenticator auth) throws IOException { // Handle authentication of scripts on a case-by-case basis. // Currently we assume that if a webscript servlet has any authenticator // applied then it must be for some kind of remote user auth as supplied. WebScript script = scriptReq.getServiceMatch().getWebScript(); script.setURLModelFactory(getUrlModelFactory()); Description desc = script.getDescription(); RequiredAuthentication required = desc.getRequiredAuthentication(); if (auth == null || RequiredAuthentication.none == required || auth.authenticate(required, false)) { script.execute(scriptReq, scriptRes); } }
super.executeScript(scriptReq, scriptRes, auth); closeExtensibilityModel(extModel, scriptRes.getWriter());
public void executeScript(WebScriptRequest scriptReq, WebScriptResponse scriptRes, Authenticator auth) throws IOException { // Handle authentication of scripts on a case-by-case basis. // Currently we assume that if a webscript servlet has any authenticator // applied then it must be for some kind of remote user auth as supplied. WebScript script = scriptReq.getServiceMatch().getWebScript(); script.setURLModelFactory(getUrlModelFactory()); Description desc = script.getDescription(); RequiredAuthentication required = desc.getRequiredAuthentication(); if (auth == null || RequiredAuthentication.none == required || auth.authenticate(required, false)) { script.execute(scriptReq, scriptRes); } }
super.executeScript(scriptReq, scriptRes, auth); closeExtensibilityModel(extModel, scriptRes.getWriter());
public void executeScript(WebScriptRequest scriptReq, WebScriptResponse scriptRes, Authenticator auth) throws IOException { // Handle authentication of scripts on a case-by-case basis. // Currently we assume that if a webscript servlet has any authenticator // applied then it must be for some kind of remote user auth as supplied. WebScript script = scriptReq.getServiceMatch().getWebScript(); script.setURLModelFactory(getUrlModelFactory()); Description desc = script.getDescription(); RequiredAuthentication required = desc.getRequiredAuthentication(); if (auth == null || RequiredAuthentication.none == required || auth.authenticate(required, false)) { script.execute(scriptReq, scriptRes); } }
@Override public void reset() { super.reset(); // called early when WSF initialises - can safely ignore until we have a WF app context if (getApplicationContext() != null) { this.getScriptProcessorRegistry().reset(); this.getTemplateProcessorRegistry().reset(); } }
@Override public Map<String, Object> getScriptParameters() { // NOTE: returns unmodifable map from super Map<String, Object> params = new HashMap<String, Object>(8, 1.0f); params.putAll(super.getScriptParameters()); // render context RequestContext context = getRequestContext(); ModelObject object = getModelObject(); // if we have a render context, populate root script properties if (context != null) { processorModelHelper.populateScriptModel(context, params, object); } return params; }
@Override public Map<String, Object> getTemplateParameters() { // NOTE: unmodifable map returned from super class Map<String, Object> params = new HashMap<String, Object>(32, 1.0f); params.putAll(super.getTemplateParameters()); // render context RequestContext context = getRequestContext(); ModelObject object = getModelObject(); // in the case of an internal error such as script compliation failing // the rendercontext can be null - as we are building template model // for the webscript status page - no futher work required here. if (context != null) { try { processorModelHelper.populateTemplateModel(context, params, object); } catch (RendererExecutionException ree) { // This exception is only thrown when processing // template objects, thus it shouldn't occur for web scripts } catch (UnsupportedEncodingException uee) { // should not occur as UTF-8 is always supported } } return params; }