nl.surfnet.coin.selfservice.control
Class BaseController

java.lang.Object
  extended by nl.surfnet.coin.selfservice.control.BaseController
Direct Known Subclasses:
ActionListController, HomeController, ServiceDetailController, ServiceListController, SpDetailController, SpLinkController, SpListController, SpUnlinkController, StatisticController

@Controller
public abstract class BaseController
extends Object

Abstract controller used to set model attributes to the request


Nested Class Summary
static class BaseController.MenuType
           
 
Field Summary
protected  org.springframework.web.servlet.LocaleResolver localeResolver
           
 
Constructor Summary
BaseController()
           
 
Method Summary
protected static Menu buildMenu(BaseController.MenuType type, String selectedItem)
          Builds a Menu based on BaseController.MenuType and the identifier of the selected menu item
 String getCurrentRole(String role, javax.servlet.http.HttpServletRequest request)
          Exposes the current role of the user for use in RequestMapping methods
 Locale getLocale(javax.servlet.http.HttpServletRequest request)
           
 List<IdentityProvider> getMyInstitutionIdps()
           
 IdentityProvider getRequestedIdp(String idpId, javax.servlet.http.HttpServletRequest request)
          Exposes the requested IdP for use in RequestMapping methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localeResolver

protected org.springframework.web.servlet.LocaleResolver localeResolver
Constructor Detail

BaseController

public BaseController()
Method Detail

getMyInstitutionIdps

@ModelAttribute(value="idps")
public List<IdentityProvider> getMyInstitutionIdps()

getLocale

@ModelAttribute(value="locale")
public Locale getLocale(javax.servlet.http.HttpServletRequest request)

getRequestedIdp

@ModelAttribute(value="selectedidp")
public IdentityProvider getRequestedIdp(@RequestParam(required=false)
                                                       String idpId,
                                                       javax.servlet.http.HttpServletRequest request)
Exposes the requested IdP for use in RequestMapping methods.

Parameters:
idpId - the idp selected in the view
request - HttpServletRequest, for storing/retrieving the selected idp in the http session.
Returns:
the IdentityProvider selected, or null in case of unknown/invalid idpId

getCurrentRole

@ModelAttribute(value="currentrole")
public String getCurrentRole(@RequestParam(required=false)
                                            String role,
                                            javax.servlet.http.HttpServletRequest request)
Exposes the current role of the user for use in RequestMapping methods

Parameters:
role - the name of the GrantedAuthority
request - HttpServletRequest, for storing/retrieving the selected role in the http session
Returns:
the name of the selected GrantedAuthority

buildMenu

protected static Menu buildMenu(BaseController.MenuType type,
                                String selectedItem)
Builds a Menu based on BaseController.MenuType and the identifier of the selected menu item

Parameters:
type - BaseController.MenuType
selectedItem - identifier of the selected menu item, can be null or empty
Returns:
Menu


Copyright © 2012 SURFnet bv, The Netherlands. All Rights Reserved.