* @see it.eng.spago.view.AbstractServletModelRenderer#prepareRender(it.eng.spago.dispatching.service.RequestContextIFace, it.eng.spago.presentation.PublisherConfiguration, java.lang.Object)
*/
public void prepareRender(RequestContextIFace requestContext, PublisherConfiguration publisher, Object additionalResources) throws Exception {
super.prepareRender(requestContext, publisher, additionalResources);
RequestContainer requestContainer = requestContext.getRequestContainer();
ResponseContainer responseContainer = requestContext.getResponseContainer();
// Prepare service request for loopback management
try {
SourceBean loopbackServiceRequest = new SourceBean(Constants.SERVICE_REQUEST);
loopbackServiceRequest.setAttribute(Navigator.NAVIGATOR_DISABLED, "TRUE");
SourceBean renderingConfig = publisher.getRenderingConfig();
List resourcesConfig = renderingConfig.getAttributeAsList("RESOURCES.PARAMETER");
for (int j = 0; j < resourcesConfig.size(); j++) {
SourceBean consequence = (SourceBean) resourcesConfig.get(j);
String parameterName = (String) consequence.getAttribute("NAME");
String parameterScope = (String) consequence.getAttribute("SCOPE");
String parameterType = (String) consequence.getAttribute("TYPE");
String parameterValue = (String) consequence.getAttribute("VALUE");
Object inParameterValue = null;
if (parameterType.equalsIgnoreCase("ABSOLUTE"))
inParameterValue = parameterValue;
else {
inParameterValue = ContextScooping.getScopedParameter(requestContainer,
responseContainer,
parameterValue, parameterScope, consequence);
}
if (inParameterValue == null)
continue;
if (inParameterValue instanceof SourceBean)
loopbackServiceRequest.setAttribute((SourceBean) inParameterValue);
else
loopbackServiceRequest.setAttribute(parameterName, inParameterValue);
} // for (int j = 0; j < consequences.size(); j++)
// light navigator id propagation
SourceBean serviceRequest = requestContainer.getServiceRequest();
String lightNavigatorId = (String) serviceRequest.getAttribute(LightNavigationManager.LIGHT_NAVIGATOR_ID);
if (lightNavigatorId != null && !lightNavigatorId.trim().equals("")) {
loopbackServiceRequest.setAttribute(LightNavigationManager.LIGHT_NAVIGATOR_ID, lightNavigatorId);
}