|
|||||||||||
| 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 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_AJAX_RESPONSE
|
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
|
protected static java.lang.String |
SUBACTION_PARAM
|
| 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,
Blog blog)
Authenticate the user if their authentication session variable is not present |
boolean |
checkPermission(Blog blog,
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()
Initialize this plugin. |
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 |
setAuthorizationProvider(AuthorizationProvider authorizationProvider)
Set the authorization provider for use by this plugin |
void |
setResourceManager(ResourceManager resourceManager)
Set the resource manager for use by this plugin |
void |
setServletConfig(javax.servlet.ServletConfig servletConfig)
Set the ServletConfig for the fetcher to grab initialization parameters |
| 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 SUBACTION_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 ADMIN_AJAX_RESPONSE
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 AuthorizationProvider _authorizationProvider
protected ResourceManager _resourceManager
protected java.util.Map _ignoreParams
| Constructor Detail |
public BaseAdminPlugin()
| Method Detail |
public void setServletConfig(javax.servlet.ServletConfig servletConfig)
ServletConfig for the fetcher to grab initialization parameters
servletConfig - ServletConfigpublic void setAuthorizationProvider(AuthorizationProvider authorizationProvider)
authorizationProvider - AuthorizationProviderpublic void setResourceManager(ResourceManager resourceManager)
resourceManager - ResourceManager
public void init()
throws PluginException
init in interface PluginPluginException - 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,
Blog blog)
httpServletRequest - RequesthttpServletResponse - Responsecontext - Contextblog - Blog 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(Blog blog,
java.util.Map permissionContext,
java.lang.String username,
java.lang.String permission)
checkPermission in interface PermissionedPluginblog - Blog 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 Entry[] process(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
Blog blog,
java.util.Map context,
Entry[] entries)
throws PluginException
process in interface PluginhttpServletRequest - RequesthttpServletResponse - Responseblog - Blog instancecontext - Contextentries - Blog entries retrieved for the particular request
PluginException - If there is an error processing the blog entries
public void cleanup()
throws PluginException
process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.blojsom.blog.Blog, java.util.Map, org.blojsom.blog.Entry[]).
cleanup in interface PluginPluginException - If there is an error performing cleanup for this plugin
public void destroy()
throws PluginException
destroy in interface PluginPluginException - 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 | ||||||||||