org.jasig.web.service
Interface AjaxPortletSupport

All Known Implementing Classes:
AjaxPortletSupportService

public interface AjaxPortletSupport

Version:
$Revision$
Author:
Eric Dalquist

Nested Class Summary
static interface AjaxPortletSupport.ModelGenerator
          Generates the data model to pass to the servlet for rendering.
 
Field Summary
static String DEFAULT_AJAX_HANDLER_ERROR_KEY
           
static String DEFAULT_AJAX_SERVLET_NAME
           
 
Method Summary
 Map<String,?> getAjaxModel(HttpServletRequest request, HttpServletResponse response)
          Gets the model for the request, if the model is null a 404 is sent to the browser and null is returned.
 void redirectAjaxResponse(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, AjaxPortletSupport.ModelGenerator generator)
          Calls #redirectAjaxResponse(ActionRequest, ActionResponse, ModelGenerator)) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.
 void redirectAjaxResponse(Map<String,?> model, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          Calls redirectAjaxResponse(String, Map, ActionRequest, ActionResponse) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.
 void redirectAjaxResponse(String ajaxServletName, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, AjaxPortletSupport.ModelGenerator generator)
          Generates a new session key and uses that to pass the model to the servlet.
 void redirectAjaxResponse(String ajaxServletName, Map<String,?> model, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          Generates a new session key and uses that to pass the model to the servlet.
 

Field Detail

DEFAULT_AJAX_SERVLET_NAME

static final String DEFAULT_AJAX_SERVLET_NAME
See Also:
Constant Field Values

DEFAULT_AJAX_HANDLER_ERROR_KEY

static final String DEFAULT_AJAX_HANDLER_ERROR_KEY
See Also:
Constant Field Values
Method Detail

redirectAjaxResponse

void redirectAjaxResponse(String ajaxServletName,
                          Map<String,?> model,
                          javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                          throws IOException
Generates a new session key and uses that to pass the model to the servlet. The response will be redirected to the ajax handling servlet by this method.

Parameters:
ajaxServletName - Name of the ajax servlet to redirect to
model - The data model to pass to the servlet
Throws:
IOException

redirectAjaxResponse

void redirectAjaxResponse(Map<String,?> model,
                          javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                          throws IOException
Calls redirectAjaxResponse(String, Map, ActionRequest, ActionResponse) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.

Throws:
IOException

redirectAjaxResponse

void redirectAjaxResponse(String ajaxServletName,
                          javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response,
                          AjaxPortletSupport.ModelGenerator generator)
                          throws IOException
Generates a new session key and uses that to pass the model to the servlet. The response will be redirected to the ajax handling servlet by this method. Handles any exceptions thrown by AjaxPortletSupport.ModelGenerator.generate(ActionRequest, ActionResponse) using DEFAULT_AJAX_HANDLER_ERROR_KEY as the error key.

Parameters:
ajaxServletName - Name of the ajax servlet to redirect to
generator - ModelGenerator used to generate the model to pass
Throws:
IOException

redirectAjaxResponse

void redirectAjaxResponse(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response,
                          AjaxPortletSupport.ModelGenerator generator)
                          throws IOException
Calls #redirectAjaxResponse(ActionRequest, ActionResponse, ModelGenerator)) passing DEFAULT_AJAX_SERVLET_NAME for the servlet name.

Throws:
IOException

getAjaxModel

Map<String,?> getAjaxModel(HttpServletRequest request,
                           HttpServletResponse response)
                           throws ServletRequestBindingException,
                                  IOException
Gets the model for the request, if the model is null a 404 is sent to the browser and null is returned. If the model contains the key DEFAULT_AJAX_HANDLER_ERROR_KEY a 500 is sent to the browser but the model is still returned for rendering.

Throws:
ServletRequestBindingException
IOException


Copyright © 2010 Jasig. All Rights Reserved.