| java.lang.Object org.blojsom.plugin.admin.BaseAdminPlugin org.blojsom.plugin.registration.RegistrationPlugin
RegistrationPlugin | public class RegistrationPlugin extends BaseAdminPlugin (Code) | | This plugin allows users to register for an account on the blog. Can be
combined with various authorization plugins to force users to login before
they can access the blog.
author: Eric Broyles version: $Id: RegistrationPlugin.java,v 1.2 2007/01/17 02:35:05 czarneckid Exp $ |
Method Summary | |
protected void | addUserMetaData(HttpServletRequest httpServletRequest, Blog blog, Map context, User user, String metaDataPropertyKeys, boolean isRequired) Add metadata to the user. | public void | cleanup() | protected Notification | constructEmail(Blog blog, User user, String flavor) Construct an email notification to the user with their registration details. | public void | destroy() | protected String | formatRegistrationResource(String resourceID, String fallbackText, Locale locale, Object[] arguments) | protected String | getRegistrationResource(String resourceID, String fallbackText, Locale locale) | public void | init() | protected void | notifyOfFailedRegistration(String username, Map context, Blog blog, HttpServletRequest httpServletRequest) Notify the user that their registration has failed for some reason. | protected void | notifyOfMissingParameter(String parameterName, Map context, Blog blog, HttpServletRequest httpServletRequest) Notify the user that a required registration parameter is missing. | public Entry[] | process(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Blog blog, Map context, Entry entries) | public void | setFetcher(Fetcher fetcher) Set the Fetcher. | protected void | setupEmail(Blog blog, User user, Email email) Setup an email for the given Blog and User. |
REGISTRATION_MESSAGES_RESOURCE | final protected static String REGISTRATION_MESSAGES_RESOURCE(Code) | | |
RegistrationPlugin | public RegistrationPlugin()(Code) | | |
addUserMetaData | protected void addUserMetaData(HttpServletRequest httpServletRequest, Blog blog, Map context, User user, String metaDataPropertyKeys, boolean isRequired) throws MissingParameterException(Code) | | Add metadata to the user. If the metadata is required and it's not present
the user will be notified that required data is missing.
Parameters: httpServletRequest - the request Parameters: blog - the Blog Parameters: context - Context Parameters: user - the user who's registering Parameters: metaDataPropertyKeys - the keys used to access the metadata values from the context Parameters: isRequired - If the metadata is required throws: MissingParameterException - when a required parameter is missing |
constructEmail | protected Notification constructEmail(Blog blog, User user, String flavor) throws EmailException, MessagingException(Code) | | Construct an email notification to the user with their registration details.
Parameters: blog - Blog Parameters: user - User Parameters: flavor - Flavor the Notification throws: EmailException - If there is an error setting e-mail attributes throws: MessagingException - If there is an error sending the e-mail |
formatRegistrationResource | protected String formatRegistrationResource(String resourceID, String fallbackText, Locale locale, Object[] arguments)(Code) | | Retrieve a resource from the registration resource bundle and pass it through the
ResourceManager.format(StringObject[]) method
Parameters: resourceID - ID of resource to retrieve Parameters: fallbackText - Text to use as fallback if resource ID is not found Parameters: locale - Locale to use when retrieving resource Parameters: arguments - Arguments for ResourceManager.format(StringObject[]) Text from administration resource bundle given by resourceID formatted appropriately or fallbackText if the resource ID could not be formatted |
getRegistrationResource | protected String getRegistrationResource(String resourceID, String fallbackText, Locale locale)(Code) | | Retrieve a resource from the registration resource bundle
Parameters: resourceID - ID of resource to retrieve Parameters: fallbackText - Text to use as fallback if resource ID is not found Parameters: locale - Locale to use when retrieving resource Text from administration resource bundle given by resourceID or fallbackText if the resource ID is not found |
notifyOfFailedRegistration | protected void notifyOfFailedRegistration(String username, Map context, Blog blog, HttpServletRequest httpServletRequest)(Code) | | Notify the user that their registration has failed for some reason.
Parameters: username - the username of the user for which registration failed Parameters: context - Context Parameters: blog - the Blog Parameters: httpServletRequest - the request |
notifyOfMissingParameter | protected void notifyOfMissingParameter(String parameterName, Map context, Blog blog, HttpServletRequest httpServletRequest)(Code) | | Notify the user that a required registration parameter is missing.
Parameters: parameterName - the name of the missing parameter Parameters: context - Context Parameters: blog - the Blog Parameters: httpServletRequest - the request |
setFetcher | public void setFetcher(Fetcher fetcher)(Code) | | Set the Fetcher. Usually injected by Spring.
Parameters: fetcher - Fetcher |
setupEmail | protected void setupEmail(Blog blog, User user, Email email) throws EmailException(Code) | | Setup an email for the given Blog and User. Sets the from address to the blog owner's
email address and the blog's name. Sets the to address to the user's email address
and the blog owner's email address.
Parameters: blog - Blog Parameters: user - User Parameters: email - E-mail message throws: EmailException - If there is an error setting e-mail attributes |
Methods inherited from org.blojsom.plugin.admin.BaseAdminPlugin | protected void addOperationResultMessage(Map context, String message)(Code)(Java Doc) protected boolean authenticateUser(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Map context, Blog blog)(Code)(Java Doc) public boolean checkPermission(Blog blog, Map permissionContext, String username, String permission)(Code)(Java Doc) public void cleanup() throws PluginException(Code)(Java Doc) public void destroy() throws PluginException(Code)(Java Doc) protected String formatAdminResource(String resourceID, String fallbackText, Locale locale, Object[] arguments)(Code)(Java Doc) protected String getAdminResource(String resourceID, String fallbackText, Locale locale)(Code)(Java Doc) protected String getUsernameFromSession(HttpServletRequest httpServletRequest, Blog blog)(Code)(Java Doc) public void init() throws PluginException(Code)(Java Doc) public Entry[] process(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Blog blog, Map context, Entry[] entries) throws PluginException(Code)(Java Doc) public void setAuthorizationProvider(AuthorizationProvider authorizationProvider)(Code)(Java Doc) public void setResourceManager(ResourceManager resourceManager)(Code)(Java Doc) public void setServletConfig(ServletConfig servletConfig)(Code)(Java Doc)
|
|
|