nl.surfnet.coin.teams.control
Class AddMemberController

java.lang.Object
  extended by nl.surfnet.coin.teams.control.AddMemberController

@Controller
@SessionAttributes(value={"invitationForm","invitation","tokencheck"})
public class AddMemberController
extends Object

Controller that handles the add member page of a logged in user.


Field Summary
protected static String INVITE_SEND_INVITE_SUBJECT
           
 
Constructor Summary
AddMemberController()
           
 
Method Summary
 String addMembersToTeam(String sessionToken, InvitationForm form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, String token, org.springframework.web.bind.support.SessionStatus status, org.springframework.ui.ModelMap modelMap)
          Called after submitting the add members form
 org.springframework.web.servlet.view.RedirectView cancelAddMembers(InvitationForm form, javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.support.SessionStatus status)
          In case someone clicks the cancel button
 String doResendInvitation(org.springframework.ui.ModelMap modelMap, Invitation invitation, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, String sessionToken, String token, org.springframework.web.bind.support.SessionStatus status)
           
protected  void sendInvitationByMail(Invitation invitation, String subject, nl.surfnet.coin.api.client.domain.Person inviter, Locale locale)
          Sends an email based on the Invitation
 String start(org.springframework.ui.ModelMap modelMap, javax.servlet.http.HttpServletRequest request)
          Shows form to invite others to your Team
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVITE_SEND_INVITE_SUBJECT

protected static final String INVITE_SEND_INVITE_SUBJECT
See Also:
Constant Field Values
Constructor Detail

AddMemberController

public AddMemberController()
Method Detail

start

@RequestMapping(value="/addmember.shtml")
public String start(org.springframework.ui.ModelMap modelMap,
                                   javax.servlet.http.HttpServletRequest request)
Shows form to invite others to your Team

Parameters:
modelMap - ModelMap
request - HttpServletRequest
Returns:
name of the add member form

cancelAddMembers

@RequestMapping(value="/doaddmember.shtml",
                method=POST,
                params="cancelAddMember")
public org.springframework.web.servlet.view.RedirectView cancelAddMembers(@ModelAttribute(value="invitationForm")
                                                                                         InvitationForm form,
                                                                                         javax.servlet.http.HttpServletRequest request,
                                                                                         org.springframework.web.bind.support.SessionStatus status)
                                                                   throws UnsupportedEncodingException
In case someone clicks the cancel button

Parameters:
form - InvitationForm
request - HttpServletRequest
Returns:
RedirectView to detail page of the team
Throws:
UnsupportedEncodingException - if UTF_8 is not supported

addMembersToTeam

@RequestMapping(value="/doaddmember.shtml",
                method=POST)
public String addMembersToTeam(@ModelAttribute(value="tokencheck")
                                              String sessionToken,
                                              @ModelAttribute(value="invitationForm")
                                              InvitationForm form,
                                              org.springframework.validation.BindingResult result,
                                              javax.servlet.http.HttpServletRequest request,
                                              @RequestParam
                                              String token,
                                              org.springframework.web.bind.support.SessionStatus status,
                                              org.springframework.ui.ModelMap modelMap)
                        throws IOException
Called after submitting the add members form

Parameters:
form - InvitationForm from the session
result - BindingResult
request - HttpServletRequest
modelMap - ModelMap
Returns:
the name of the form if something is wrong before handling the invitation, otherwise a redirect to the detailteam url
Throws:
IOException - if something goes wrong handling the invitation

doResendInvitation

@RequestMapping(value="/doResendInvitation.shtml",
                method=POST)
public String doResendInvitation(org.springframework.ui.ModelMap modelMap,
                                                @ModelAttribute(value="invitation")
                                                Invitation invitation,
                                                org.springframework.validation.BindingResult result,
                                                javax.servlet.http.HttpServletRequest request,
                                                @ModelAttribute(value="tokencheck")
                                                String sessionToken,
                                                @RequestParam
                                                String token,
                                                org.springframework.web.bind.support.SessionStatus status)
                          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

sendInvitationByMail

protected void sendInvitationByMail(Invitation invitation,
                                    String subject,
                                    nl.surfnet.coin.api.client.domain.Person inviter,
                                    Locale locale)
Sends an email based on the Invitation

Parameters:
invitation - Invitation that contains the necessary data
subject - of the email
inviter - Person who sends the invitation
locale - Locale for the mail


Copyright © 2009-2013 SURFnet bv, The Netherlands. All Rights Reserved.