|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.blojsom.plugin.admin.BaseAdminPlugin
BaseAdminPlugin
| Field Summary | |
protected AuthorizationProvider |
_authorizationProvider
|
protected BlojsomConfiguration |
_blojsomConfiguration
|
protected java.util.Map |
_ignoreParams
|
protected static org.apache.commons.logging.Log |
_logger
|
protected ResourceManager |
_resourceManager
|
protected javax.servlet.ServletConfig |
_servletConfig
|
protected static java.lang.String |
ACTION_PARAM
|
protected static java.lang.String |
ADMIN_ADMINISTRATION_PAGE
|
protected static java.lang.String |
ADMIN_LOGIN_PAGE
|
protected static java.lang.String |
BLOJSOM_ADMIN_MESSAGES_RESOURCE
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_AUTHENTICATED_KEY
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_OPERATION_RESULT
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_PASSWORD_PARAM
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_USERNAME
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_USERNAME_KEY
|
protected static java.lang.String |
BLOJSOM_ADMIN_PLUGIN_USERNAME_PARAM
|
protected static java.lang.String |
BLOJSOM_PERMISSION_CHECKER
|
protected static java.lang.String |
BLOJSOM_USER_AUTHENTICATED
|
protected static java.lang.String |
LOGIN_ACTION
|
protected static java.lang.String |
LOGIN_ERROR_TEXT_KEY
|
protected static java.lang.String |
LOGOUT_ACTION
|
protected static java.lang.String |
PAGE_ACTION
|
protected static java.lang.String |
PLUGIN_ADMIN_INHERIT_APACHE_CREDENTIALS
|
| Fields inherited from interface org.blojsom.util.BlojsomMetaDataConstants |
BLOG_ENTRY_METADATA_AUTHOR, BLOG_ENTRY_METADATA_AUTHOR_EXT, BLOG_ENTRY_METADATA_TIMESTAMP, BLOG_METADATA_COMMENTS_DISABLED, BLOG_METADATA_HEADER, BLOG_METADATA_PINGBACKS_DISABLED, BLOG_METADATA_TRACKBACKS_DISABLED, SOURCE_ATTRIBUTE |
| Constructor Summary | |
BaseAdminPlugin()
Default constructor. |
|
| Method Summary | |
protected void |
addOperationResultMessage(java.util.Map context,
java.lang.String message)
Adds a message to the context under the BLOJSOM_ADMIN_PLUGIN_OPERATION_RESULT key |
protected boolean |
authenticateUser(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
java.util.Map context,
BlogUser blogUser)
Authenticate the user if their authentication session variable is not present |
boolean |
checkPermission(BlogUser blogUser,
java.util.Map permissionContext,
java.lang.String username,
java.lang.String permission)
Check the permission for a given username and permission |
void |
cleanup()
Perform any cleanup for the plugin. |
void |
destroy()
Called when BlojsomServlet is taken out of service |
protected java.lang.String |
formatAdminResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale,
java.lang.Object[] arguments)
Retrieve a resource from the administration resource bundle and pass it through the ResourceManager.format(String, Object[]) method |
protected java.lang.String |
getAdminResource(java.lang.String resourceID,
java.lang.String fallbackText,
java.util.Locale locale)
Retrieve a resource from the administration resource bundle |
protected java.lang.String |
getUsernameFromSession(javax.servlet.http.HttpServletRequest httpServletRequest,
Blog blog)
Retrieve the current authorized username for this session |
void |
init(javax.servlet.ServletConfig servletConfig,
BlojsomConfiguration blojsomConfiguration)
Initialize this plugin. |
BlogEntry[] |
process(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
BlogUser user,
java.util.Map context,
BlogEntry[] entries)
Process the blog entries |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final org.apache.commons.logging.Log _logger
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_AUTHENTICATED_KEY
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_USERNAME_KEY
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_USERNAME
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_USERNAME_PARAM
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_PASSWORD_PARAM
protected static final java.lang.String ACTION_PARAM
protected static final java.lang.String BLOJSOM_ADMIN_PLUGIN_OPERATION_RESULT
protected static final java.lang.String BLOJSOM_USER_AUTHENTICATED
protected static final java.lang.String BLOJSOM_ADMIN_MESSAGES_RESOURCE
protected static final java.lang.String BLOJSOM_PERMISSION_CHECKER
protected static final java.lang.String PLUGIN_ADMIN_INHERIT_APACHE_CREDENTIALS
protected static final java.lang.String LOGIN_ERROR_TEXT_KEY
protected static final java.lang.String ADMIN_ADMINISTRATION_PAGE
protected static final java.lang.String ADMIN_LOGIN_PAGE
protected static final java.lang.String LOGIN_ACTION
protected static final java.lang.String LOGOUT_ACTION
protected static final java.lang.String PAGE_ACTION
protected javax.servlet.ServletConfig _servletConfig
protected BlojsomConfiguration _blojsomConfiguration
protected AuthorizationProvider _authorizationProvider
protected ResourceManager _resourceManager
protected java.util.Map _ignoreParams
| Constructor Detail |
public BaseAdminPlugin()
| Method Detail |
public void init(javax.servlet.ServletConfig servletConfig,
BlojsomConfiguration blojsomConfiguration)
throws BlojsomPluginException
init in interface BlojsomPluginservletConfig - Servlet config object for the plugin to retrieve any initialization parametersblojsomConfiguration - BlojsomConfiguration information
BlojsomPluginException - If there is an error initializing the plugin
protected boolean authenticateUser(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
java.util.Map context,
BlogUser blogUser)
httpServletRequest - RequesthttpServletResponse - Responsecontext - ContextblogUser - User information
true if the user is authenticated, false otherwise
protected java.lang.String getUsernameFromSession(javax.servlet.http.HttpServletRequest httpServletRequest,
Blog blog)
httpServletRequest - Requestblog - Blog
null if no user is currently authorized
public boolean checkPermission(BlogUser blogUser,
java.util.Map permissionContext,
java.lang.String username,
java.lang.String permission)
checkPermission in interface PermissionedPluginblogUser - BlogUser informationpermissionContext - Map containing context information for checking permissionusername - Usernamepermission - Permission
true if the username has the required permission, false otherwise
protected void addOperationResultMessage(java.util.Map context,
java.lang.String message)
BLOJSOM_ADMIN_PLUGIN_OPERATION_RESULT key
context - Contextmessage - Message to add
protected java.lang.String getAdminResource(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 java.lang.String formatAdminResource(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
public BlogEntry[] process(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
BlogUser user,
java.util.Map context,
BlogEntry[] entries)
throws BlojsomPluginException
process in interface BlojsomPluginhttpServletRequest - RequesthttpServletResponse - Responseuser - BlogUser instancecontext - Contextentries - Blog entries retrieved for the particular request
BlojsomPluginException - If there is an error processing the blog entries
public void cleanup()
throws BlojsomPluginException
process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.blojsom.blog.BlogUser, java.util.Map, org.blojsom.blog.BlogEntry[]).
cleanup in interface BlojsomPluginBlojsomPluginException - If there is an error performing cleanup for this plugin
public void destroy()
throws BlojsomPluginException
destroy in interface BlojsomPluginBlojsomPluginException - If there is an error in finalizing this plugin
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||