|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.blojsom.plugin.admin.BaseAdminPlugin
org.blojsom.plugin.registration.RegistrationPlugin
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.
| Field Summary | |
protected static java.lang.String |
REGISTRATION_MESSAGES_RESOURCE
|
| Constructor Summary | |
RegistrationPlugin()
|
|
| Method Summary | |
protected void |
addUserMetaData(javax.servlet.http.HttpServletRequest httpServletRequest,
Blog blog,
java.util.Map context,
User user,
java.lang.String metaDataPropertyKeys,
boolean isRequired)
Add metadata to the user. |
void |
cleanup()
Perform any cleanup for the plugin. |
protected Notification |
constructEmail(Blog blog,
User user,
java.lang.String flavor)
Construct an email notification to the user with their registration details. |
void |
destroy()
Called when BlojsomServlet is taken out of service |
protected java.lang.String |
formatRegistrationResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale,
java.lang.Object[] arguments)
Retrieve a resource from the registration resource bundle and pass it through the ResourceManager.format(String,Object[]) method |
protected java.lang.String |
getRegistrationResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale)
Retrieve a resource from the registration resource bundle |
void |
init()
Initialize this plugin. |
protected void |
notifyOfFailedRegistration(java.lang.String username,
java.util.Map context,
Blog blog,
javax.servlet.http.HttpServletRequest httpServletRequest)
Notify the user that their registration has failed for some reason. |
protected void |
notifyOfMissingParameter(java.lang.String parameterName,
java.util.Map context,
Blog blog,
javax.servlet.http.HttpServletRequest httpServletRequest)
Notify the user that a required registration parameter is missing. |
Entry[] |
process(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
Blog blog,
java.util.Map context,
Entry[] entries)
Process the blog entries |
void |
setFetcher(Fetcher fetcher)
Set the Fetcher. |
protected void |
setupEmail(Blog blog,
User user,
org.apache.commons.mail.Email email)
Setup an email for the given Blog and User. |
| Methods inherited from class org.blojsom.plugin.admin.BaseAdminPlugin |
addOperationResultMessage, authenticateUser, checkPermission, formatAdminResource, getAdminResource, getUsernameFromSession, setAuthorizationProvider, setResourceManager, setServletConfig |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String REGISTRATION_MESSAGES_RESOURCE
| Constructor Detail |
public RegistrationPlugin()
| Method Detail |
public void setFetcher(Fetcher fetcher)
fetcher - Fetcher
public void init()
throws PluginException
BaseAdminPlugin
init in interface Plugininit in class BaseAdminPluginPluginException - If there is an error initializing the pluginBaseAdminPlugin.init()
protected void setupEmail(Blog blog,
User user,
org.apache.commons.mail.Email email)
throws org.apache.commons.mail.EmailException
blog - Bloguser - Useremail - E-mail message
org.apache.commons.mail.EmailException - If there is an error setting e-mail attributes
public Entry[] process(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
Blog blog,
java.util.Map context,
Entry[] entries)
throws PluginException
BaseAdminPlugin
process in interface Pluginprocess in class BaseAdminPluginhttpServletRequest - RequesthttpServletResponse - Responseblog - Blog instancecontext - Contextentries - Blog entries retrieved for the particular request
PluginException - If there is an error processing the blog entriesBaseAdminPlugin.process(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.blojsom.blog.Blog,java.util.Map,org.blojsom.blog.Entry[])
protected void addUserMetaData(javax.servlet.http.HttpServletRequest httpServletRequest,
Blog blog,
java.util.Map context,
User user,
java.lang.String metaDataPropertyKeys,
boolean isRequired)
throws MissingParameterException
httpServletRequest - the requestblog - the Blogcontext - Contextuser - the user who's registeringmetaDataPropertyKeys - the keys used to access the metadata values from the contextisRequired - If the metadata is required
MissingParameterException - when a required parameter is missing
public void cleanup()
throws PluginException
BaseAdminPluginBaseAdminPlugin.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.blojsom.blog.Blog, java.util.Map, org.blojsom.blog.Entry[]).
cleanup in interface Plugincleanup in class BaseAdminPluginPluginException - If there is an error performing cleanup for this pluginBaseAdminPlugin.cleanup()
public void destroy()
throws PluginException
BaseAdminPlugin
destroy in interface Plugindestroy in class BaseAdminPluginPluginException - If there is an error in finalizing this pluginBaseAdminPlugin.destroy()
protected Notification constructEmail(Blog blog,
User user,
java.lang.String flavor)
throws org.apache.commons.mail.EmailException,
javax.mail.MessagingException
blog - Bloguser - Userflavor - Flavor
org.apache.commons.mail.EmailException - If there is an error setting e-mail attributes
javax.mail.MessagingException - If there is an error sending the e-mail
protected java.lang.String formatRegistrationResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale,
java.lang.Object[] arguments)
ResourceManager.format(String,Object[]) method
resourceID - ID of resource to retrievefallbackText - Text to use as fallback if resource ID is not foundlocale - Locale to use when retrieving resourcearguments - Arguments for ResourceManager.format(String,Object[])
resourceID formatted appropriately or fallbackText if the resource ID could not be formatted
protected java.lang.String getRegistrationResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale)
resourceID - ID of resource to retrievefallbackText - Text to use as fallback if resource ID is not foundlocale - Locale to use when retrieving resource
resourceID or fallbackText if the resource ID is not found
protected void notifyOfMissingParameter(java.lang.String parameterName,
java.util.Map context,
Blog blog,
javax.servlet.http.HttpServletRequest httpServletRequest)
parameterName - the name of the missing parametercontext - Contextblog - the BloghttpServletRequest - the request
protected void notifyOfFailedRegistration(java.lang.String username,
java.util.Map context,
Blog blog,
javax.servlet.http.HttpServletRequest httpServletRequest)
username - the username of the user for which registration failedcontext - Contextblog - the BloghttpServletRequest - the request
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||