Package org.ametys.web.usermanagement
Class UserSignupAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.web.usermanagement.UserSignupAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
public class UserSignupAction extends ServiceableAction
Handle the user sign-up actions.
-
-
Field Summary
Fields Modifier and Type Field Description protected PageHelper
_pageHelper
Page helperprotected URIPrefixHandler
_prefixHandler
The URI prefix handlerprotected RenderingContextHandler
_renderingContextHandler
The rendering contextprotected AmetysObjectResolver
_resolver
The Ametys Resolverprotected SiteConfigurationExtensionPoint
_siteConfiguration
The site configuration EP.protected UserManager
_userManager
The user manager.protected UserPopulationDAO
_userPopulationDAO
The DAO for user populationsprotected UserSignupManager
_userSignupManager
The user signup manager.static Set<String>
STANDARD_FIELDS
The UsersManager standard fields.-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description UserSignupAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected void
checkToken(Request request, String siteName, String email, String token, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors)
Check that a token is valid.protected void
doSignup(Request request, Parameters parameters, String siteName, String language, String firstname, String lastname, String email, String token, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors)
Sign-up the user: create a real user from his temporary information.protected Map<String,String>
getAdditionalValues(Request request, ModifiableUserDirectory userDirectory)
Get FO user manager's custom field values.protected void
resetTempSignup(Request request, String siteName, String language, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors)
Reset a user's sign-up request.void
service(ServiceManager serviceManager)
protected void
temporarySignup(Request request, Parameters parameters, String siteName, String language, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors)
Store a user's sign-up request.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
STANDARD_FIELDS
public static final Set<String> STANDARD_FIELDS
The UsersManager standard fields.
-
_userSignupManager
protected UserSignupManager _userSignupManager
The user signup manager.
-
_userManager
protected UserManager _userManager
The user manager.
-
_userPopulationDAO
protected UserPopulationDAO _userPopulationDAO
The DAO for user populations
-
_siteConfiguration
protected SiteConfigurationExtensionPoint _siteConfiguration
The site configuration EP.
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys Resolver
-
_pageHelper
protected PageHelper _pageHelper
Page helper
-
_renderingContextHandler
protected RenderingContextHandler _renderingContextHandler
The rendering context
-
_prefixHandler
protected URIPrefixHandler _prefixHandler
The URI prefix handler
-
-
Constructor Detail
-
UserSignupAction
public UserSignupAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
temporarySignup
protected void temporarySignup(Request request, Parameters parameters, String siteName, String language, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors) throws UserManagementException
Store a user's sign-up request.- Parameters:
request
- the user request.parameters
- the action parameters.siteName
- the site name.language
- the language.populationId
- The id of the populationuserDirectoryId
- The id of the user directory of the populationerrors
- the Map to fill with errors to display to the user.- Throws:
UserManagementException
- if an error occurs.
-
resetTempSignup
protected void resetTempSignup(Request request, String siteName, String language, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors) throws UserManagementException
Reset a user's sign-up request.- Parameters:
request
- the user request.siteName
- the site name.language
- the language.populationId
- The id of the populationuserDirectoryId
- The id of the user directory of the populationerrors
- the Map to fill with errors to display to the user.- Throws:
UserManagementException
- if an error occurs.
-
checkToken
protected void checkToken(Request request, String siteName, String email, String token, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors) throws UserManagementException
Check that a token is valid.- Parameters:
request
- the user request.siteName
- the site name.email
- the user e-mail.token
- the sign-up token that was sent to the user.populationId
- The id of the populationuserDirectoryId
- The id of the user directory of the populationerrors
- the Map to fill with errors to display to the user.- Throws:
UserManagementException
- if an error occurs.
-
doSignup
protected void doSignup(Request request, Parameters parameters, String siteName, String language, String firstname, String lastname, String email, String token, String populationId, String userDirectoryId, Multimap<String,I18nizableText> errors) throws UserManagementException
Sign-up the user: create a real user from his temporary information.- Parameters:
request
- the user request.parameters
- the action parameters.siteName
- the site name.language
- the current language.firstname
- the user firstname.lastname
- the user lastname.email
- the user e-mail.token
- the sign-up token that was sent to the user.populationId
- The id of the populationuserDirectoryId
- The id of the user directory of the populationerrors
- the Map to fill with errors to display to the user.- Throws:
UserManagementException
- if an error occurs.
-
getAdditionalValues
protected Map<String,String> getAdditionalValues(Request request, ModifiableUserDirectory userDirectory) throws UserManagementException
Get FO user manager's custom field values.- Parameters:
request
- the request.userDirectory
- the user directory- Returns:
- the custom field values.
- Throws:
UserManagementException
- if an error occurs.
-
-