org.kuali.rice.ken.web.spring
Class BaseSendNotificationController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by org.springframework.web.servlet.mvc.multiaction.MultiActionController
                      extended by org.kuali.rice.ken.web.spring.BaseSendNotificationController
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller, org.springframework.web.servlet.mvc.LastModified
Direct Known Subclasses:
SendEventNotificationMessageController, SendNotificationMessageController

public class BaseSendNotificationController
extends org.springframework.web.servlet.mvc.multiaction.MultiActionController

Base class for KEN controllers for sending notifications

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  DataObjectService dataObjectService
           
protected  NotificationChannelService notificationChannelService
           
protected  NotificationMessageContentService notificationMessageContentService
           
protected  NotificationRecipientService notificationRecipientService
           
protected  NotificationService notificationService
           
protected  NotificationWorkflowDocumentService notificationWorkflowDocService
           
 
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.MultiActionController
DEFAULT_COMMAND_NAME, LAST_MODIFIED_METHOD_SUFFIX, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
BaseSendNotificationController()
           
 
Method Summary
protected  NotificationBo createNotification(javax.servlet.http.HttpServletRequest request, Map<String,Object> model, ErrorList errors)
          Provides an overridable method in which to customize a created NotificationBo instance.
protected  WorkflowDocument createNotificationWorkflowDocument(javax.servlet.http.HttpServletRequest request, String initiatorId, Map<String,Object> model)
          Creates a notification WorkflowDocument.
protected  Date getDate(String parameter, ErrorList errors, String errorMessage)
           
protected static GroupService getGroupService()
           
protected static IdentityService getIdentityService()
           
protected static NamespaceService getNamespaceService()
           
protected  String getParameter(javax.servlet.http.HttpServletRequest request, String parameterName, Map<String,Object> model, ErrorList errors, String errorMessage)
           
protected  String getParameter(javax.servlet.http.HttpServletRequest request, String parameterName, Map<String,Object> model, ErrorList errors, String errorMessage, String defaultValue)
           
protected  String[] getParameterList(javax.servlet.http.HttpServletRequest request, String parameterName, Map<String,Object> model, ErrorList errors, String errorMessage)
           
protected  String getPrincipalIdFromIdOrName(String principalIdOrName)
           
protected  boolean isUserRecipientValid(String user, ErrorList errors)
           
protected  boolean isWorkgroupRecipientValid(String groupName, String namespaceCode, ErrorList errors)
           
protected  String[] parseCommaSeparatedValues(javax.servlet.http.HttpServletRequest request, String param)
           
protected  String[] parseUserRecipients(javax.servlet.http.HttpServletRequest request)
           
protected  String[] parseWorkgroupNamespaceCodes(javax.servlet.http.HttpServletRequest request)
           
protected  String[] parseWorkgroupRecipients(javax.servlet.http.HttpServletRequest request)
           
protected  NotificationBo populateNotificationInstance(javax.servlet.http.HttpServletRequest request, Map<String,Object> model)
          Creates a new NotificationBo instance.
 void setDataObjectService(DataObjectService dataObjectService)
          Sets the businessObjectDao attribute value.
 void setNotificationChannelService(NotificationChannelService notificationChannelService)
          Sets the NotificationChannelService.
 void setNotificationMessageContentService(NotificationMessageContentService notificationMessageContentService)
          Sets the NotificationMessageContentService.
 void setNotificationRecipientService(NotificationRecipientService notificationRecipientService)
          Sets the NotificationRecipientService.
 void setNotificationService(NotificationService notificationService)
          Sets the NotificationService.
 void setNotificationWorkflowDocumentService(NotificationWorkflowDocumentService notificationWorkflowDocService)
          Sets the NotificationWorkflowDocumentService.
protected  Map<String,Object> setupModelForSendNotification(javax.servlet.http.HttpServletRequest request)
          Prepares the model used for sending the notification.
protected  org.springframework.web.servlet.ModelAndView submitNotificationMessage(javax.servlet.http.HttpServletRequest request, String routeMessage, String viewName)
          Submits the actual event notification message.
 
Methods inherited from class org.springframework.web.servlet.mvc.multiaction.MultiActionController
bind, createBinder, getCommandName, getExceptionHandler, getLastModified, getMethodNameResolver, getValidators, getWebBindingInitializer, handleNoSuchRequestHandlingMethod, handleRequestInternal, initBinder, invokeNamedMethod, newCommandObject, setDelegate, setMethodNameResolver, setValidators, setWebBindingInitializer
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setAlwaysMustRevalidate, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

notificationService

protected NotificationService notificationService

notificationWorkflowDocService

protected NotificationWorkflowDocumentService notificationWorkflowDocService

notificationChannelService

protected NotificationChannelService notificationChannelService

notificationRecipientService

protected NotificationRecipientService notificationRecipientService

notificationMessageContentService

protected NotificationMessageContentService notificationMessageContentService

dataObjectService

protected DataObjectService dataObjectService
Constructor Detail

BaseSendNotificationController

public BaseSendNotificationController()
Method Detail

getIdentityService

protected static IdentityService getIdentityService()

getGroupService

protected static GroupService getGroupService()

getNamespaceService

protected static NamespaceService getNamespaceService()

setNotificationService

public void setNotificationService(NotificationService notificationService)
Sets the NotificationService.

Parameters:
notificationService - the service to set

setNotificationWorkflowDocumentService

public void setNotificationWorkflowDocumentService(NotificationWorkflowDocumentService notificationWorkflowDocService)
Sets the NotificationWorkflowDocumentService.

Parameters:
notificationWorkflowDocService - the service to set

setNotificationChannelService

public void setNotificationChannelService(NotificationChannelService notificationChannelService)
Sets the NotificationChannelService.

Parameters:
notificationChannelService - the service to set

setNotificationRecipientService

public void setNotificationRecipientService(NotificationRecipientService notificationRecipientService)
Sets the NotificationRecipientService.

Parameters:
notificationRecipientService - the service to set

setNotificationMessageContentService

public void setNotificationMessageContentService(NotificationMessageContentService notificationMessageContentService)
Sets the NotificationMessageContentService.

Parameters:
notificationMessageContentService - the service to set

setDataObjectService

public void setDataObjectService(DataObjectService dataObjectService)
Sets the businessObjectDao attribute value.

Parameters:
dataObjectService - the service to set

getParameter

protected String getParameter(javax.servlet.http.HttpServletRequest request,
                              String parameterName,
                              Map<String,Object> model,
                              ErrorList errors,
                              String errorMessage)

getParameter

protected String getParameter(javax.servlet.http.HttpServletRequest request,
                              String parameterName,
                              Map<String,Object> model,
                              ErrorList errors,
                              String errorMessage,
                              String defaultValue)

getParameterList

protected String[] getParameterList(javax.servlet.http.HttpServletRequest request,
                                    String parameterName,
                                    Map<String,Object> model,
                                    ErrorList errors,
                                    String errorMessage)

getDate

protected Date getDate(String parameter,
                       ErrorList errors,
                       String errorMessage)

parseUserRecipients

protected String[] parseUserRecipients(javax.servlet.http.HttpServletRequest request)

parseWorkgroupRecipients

protected String[] parseWorkgroupRecipients(javax.servlet.http.HttpServletRequest request)

parseWorkgroupNamespaceCodes

protected String[] parseWorkgroupNamespaceCodes(javax.servlet.http.HttpServletRequest request)

parseCommaSeparatedValues

protected String[] parseCommaSeparatedValues(javax.servlet.http.HttpServletRequest request,
                                             String param)

isUserRecipientValid

protected boolean isUserRecipientValid(String user,
                                       ErrorList errors)

isWorkgroupRecipientValid

protected boolean isWorkgroupRecipientValid(String groupName,
                                            String namespaceCode,
                                            ErrorList errors)

getPrincipalIdFromIdOrName

protected String getPrincipalIdFromIdOrName(String principalIdOrName)

submitNotificationMessage

protected org.springframework.web.servlet.ModelAndView submitNotificationMessage(javax.servlet.http.HttpServletRequest request,
                                                                                 String routeMessage,
                                                                                 String viewName)
                                                                          throws javax.servlet.ServletException,
                                                                                 IOException
Submits the actual event notification message.

Parameters:
request - the servlet request
routeMessage - the message to attach to the route action
viewName - the name of the view to forward to after completion
Returns:
the next view to show
Throws:
javax.servlet.ServletException
IOException

createNotificationWorkflowDocument

protected WorkflowDocument createNotificationWorkflowDocument(javax.servlet.http.HttpServletRequest request,
                                                              String initiatorId,
                                                              Map<String,Object> model)
                                                       throws IllegalArgumentException,
                                                              ErrorList
Creates a notification WorkflowDocument.

Parameters:
request - the servlet request
initiatorId - the user sending the notification
model - the Spring MVC model
Returns:
a WorkflowDocument for the notification
Throws:
IllegalArgumentException
ErrorList

populateNotificationInstance

protected NotificationBo populateNotificationInstance(javax.servlet.http.HttpServletRequest request,
                                                      Map<String,Object> model)
                                               throws IllegalArgumentException,
                                                      ErrorList
Creates a new NotificationBo instance.

Parameters:
request - the servlet request
model - the Spring MVC model
Returns:
a new notification
Throws:
IllegalArgumentException
ErrorList

createNotification

protected NotificationBo createNotification(javax.servlet.http.HttpServletRequest request,
                                            Map<String,Object> model,
                                            ErrorList errors)
                                     throws ErrorList
Provides an overridable method in which to customize a created NotificationBo instance.

Parameters:
request - the servlet request
model - the Spring MVC model
errors - the error list
Returns:
a new notification
Throws:
ErrorList

setupModelForSendNotification

protected Map<String,Object> setupModelForSendNotification(javax.servlet.http.HttpServletRequest request)
Prepares the model used for sending the notification.

Parameters:
request - the servlet request
Returns:
the Spring MVC model


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.