info.magnolia.module.publicuserregistration
Class DefaultUserRegistrar

java.lang.Object
  extended by info.magnolia.module.publicuserregistration.DefaultUserRegistrar
All Implemented Interfaces:
UserRegistrar

public class DefaultUserRegistrar
extends Object
implements UserRegistrar

TODO dlipp - add proper comment.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.module.publicuserregistration.UserRegistrar
UserRegistrar.Factory
 
Constructor Summary
DefaultUserRegistrar()
           
 
Method Summary
protected  void extraCreationValidation(Map<String,String> errorMessages, UserProfile userProfile)
          Override this method to add extra validation checks (for your custom UserProfile class).
protected  void extraUpdateValidation(Map<String,String> errorMessages, UserProfile userProfile)
          Override this method to add extra validation checks (for your custom UserProfile class).
protected  info.magnolia.cms.security.UserManager getUserManager(PublicUserRegistrationConfig config)
           
protected  void mandatory(Map<String,String> errorMessages, String fieldName, String value)
           
 info.magnolia.cms.security.User registerUser(UserProfile userProfile, PublicUserRegistrationConfig config)
          Registers a user and delegates to a RegistrationStrategy.
protected  void setExtraUserProperties(info.magnolia.cms.security.User user, UserProfile userProfile)
          Override this method to set extra properties from your custom UserProfile subclass.
protected  void updateExtraUserProperties(info.magnolia.cms.security.User user, UserProfile userProfile)
          Override this method to set extra properties from your custom UserProfile subclass.
 void updateProfile(UserProfile userProfile, PublicUserRegistrationConfig config)
          Updates a user's profile and delegates to a RegistrationStrategy.
 Map<String,String> validateForCreation(UserProfile userProfile, PublicUserRegistrationConfig config)
          Validates the given profile and returns a map of error messages, per field.
 Map<String,String> validateForUpdate(UserProfile userProfile, PublicUserRegistrationConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserRegistrar

public DefaultUserRegistrar()
Method Detail

validateForCreation

public Map<String,String> validateForCreation(UserProfile userProfile,
                                              PublicUserRegistrationConfig config)
Description copied from interface: UserRegistrar
Validates the given profile and returns a map of error messages, per field. Should return a writable empty map if the profile is valid, to allow the caller to do any additional checks. TODO : return a > ?

Specified by:
validateForCreation in interface UserRegistrar

validateForUpdate

public Map<String,String> validateForUpdate(UserProfile userProfile,
                                            PublicUserRegistrationConfig config)
Specified by:
validateForUpdate in interface UserRegistrar

extraCreationValidation

protected void extraCreationValidation(Map<String,String> errorMessages,
                                       UserProfile userProfile)
Override this method to add extra validation checks (for your custom UserProfile class).

Parameters:
errorMessages - the Map where subclasses should add their error messages.

extraUpdateValidation

protected void extraUpdateValidation(Map<String,String> errorMessages,
                                     UserProfile userProfile)
Override this method to add extra validation checks (for your custom UserProfile class).

Parameters:
errorMessages - the Map where subclasses should add their error messages.

mandatory

protected void mandatory(Map<String,String> errorMessages,
                         String fieldName,
                         String value)

registerUser

public info.magnolia.cms.security.User registerUser(UserProfile userProfile,
                                                    PublicUserRegistrationConfig config)
Description copied from interface: UserRegistrar
Registers a user and delegates to a RegistrationStrategy.

Specified by:
registerUser in interface UserRegistrar

setExtraUserProperties

protected void setExtraUserProperties(info.magnolia.cms.security.User user,
                                      UserProfile userProfile)
Override this method to set extra properties from your custom UserProfile subclass.


updateProfile

public void updateProfile(UserProfile userProfile,
                          PublicUserRegistrationConfig config)
Description copied from interface: UserRegistrar
Updates a user's profile and delegates to a RegistrationStrategy.

Specified by:
updateProfile in interface UserRegistrar

updateExtraUserProperties

protected void updateExtraUserProperties(info.magnolia.cms.security.User user,
                                         UserProfile userProfile)
Override this method to set extra properties from your custom UserProfile subclass.


getUserManager

protected info.magnolia.cms.security.UserManager getUserManager(PublicUserRegistrationConfig config)


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.