org.itracker.web.actions.base
Class ItrackerBaseAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.itracker.web.actions.base.ItrackerBaseAction
Direct Known Subclasses:
AddIssueRelationAction, AdminHomeAction, AssignIssueAction, CreateIssueAction, CreateIssueFormAction, CreateLanguageKeyAction, CreateLanguageKeyFormAction, DisplayReportAction, DownloadAttachmentAction, DownloadReportAction, EditComponentAction, EditComponentFormAction, EditConfigurationAction, EditConfigurationFormAction, EditCustomFieldAction, EditCustomFieldFormAction, EditCustomFieldValueAction, EditCustomFieldValueFormAction, EditIssueAction, EditIssueFormAction, EditLanguageAction, EditLanguageFormAction, EditPreferencesAction, EditPreferencesFormAction, EditProjectAction, EditProjectFormAction, EditProjectScriptAction, EditProjectScriptFormAction, EditReportAction, EditReportFormAction, EditUserAction, EditUserFormAction, EditVersionAction, EditVersionFormAction, EditWorkflowScriptAction, EditWorkflowScriptFormAction, ErrorAction, ExportAttachmentsAction, ExportLanguageAction, ExportReportAction, ForgotPasswordAction, ForgotPasswordFormAction, ImportDataFormAction, ImportDataProcessAction, ImportDataVerifyAction, InitializeLanguagesAction, ListAttachmentsAction, ListConfigurationAction, ListIssuesAction, ListLanguagesAction, ListProjectsAction, ListProjectsAction, ListReportsAction, ListReportsAction, ListTasksAction, ListUsersAction, ListWorkflowScriptAction, LockUserAction, LoginAction, LogoffAction, MoveIssueAction, MoveIssueFormAction, OrderConfigurationItemAction, OrderCustomFieldValueAction, PortalHomeAction, RemoveConfigurationItemAction, RemoveCustomFieldAction, RemoveCustomFieldValueAction, RemoveHistoryEntryAction, RemoveIssueAttachmentAction, RemoveProjectScriptAction, RemoveReportAction, RemoveWorkflowScriptAction, RssFeedAction, SearchIssuesAction, SearchIssuesFormAction, SelfRegisterAction, SelfRegisterFormAction, ShowHelpAction, UnauthorizedAction, UnlockUserAction, ViewIssueAction, ViewIssueActivityAction, WatchIssueAction

public abstract class ItrackerBaseAction
extends org.apache.struts.action.Action

This seems to be an action that is called always, checking for Permissions, Authentication and other stuff

Author:
Marky Goldstein

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ItrackerBaseAction()
           
 
Method Summary
 String getBaseURL(javax.servlet.http.HttpServletRequest request)
           
protected  ITrackerServices getITrackerServices()
          TODO: Deprecate and move to new static method in a ITrackerServicesFactory-class
 Locale getLocale(javax.servlet.http.HttpServletRequest request)
           
 String getName()
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
 String getPage()
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
 int getPermission()
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
protected  Map<Integer,Set<PermissionType>> getUserPermissions(javax.servlet.http.HttpSession session)
           
protected  void handleException(Throwable t, org.apache.struts.action.ActionMessages messages, javax.servlet.http.HttpServletRequest httpServletRequest)
           
protected  boolean hasPermission(int[] permissionsNeeded, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          TODO: Deprecate and move to LoginUtilities
protected  boolean hasPermission(int permissionNeeded, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          TODO: Deprecate and move to LoginUtilities
protected  boolean isLoggedIn(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated. move to LoginUtilities - no need for actions to check for user being logged in.
 org.apache.struts.action.ActionForward loginRouter(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForward thisactionforward)
          former checkLogin Tag(lib) Code..
protected static void logTimeMillies(String message, Date startTime, org.apache.log4j.Logger log, org.apache.log4j.Level level)
          Log time passed since timestamp startTime was set.
 void setName(String value)
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
 void setPage(String value)
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
 void setPermission(int value)
          Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, execute, generateToken, getDataSource, getDataSource, getErrors, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItrackerBaseAction

public ItrackerBaseAction()
Method Detail

getUserPermissions

protected Map<Integer,Set<PermissionType>> getUserPermissions(javax.servlet.http.HttpSession session)

hasPermission

protected boolean hasPermission(int[] permissionsNeeded,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws IOException,
                                javax.servlet.ServletException
TODO: Deprecate and move to LoginUtilities

Parameters:
permissionsNeeded -
request -
response -
Returns:
Throws:
IOException
javax.servlet.ServletException

hasPermission

protected boolean hasPermission(int permissionNeeded,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws IOException,
                                javax.servlet.ServletException
TODO: Deprecate and move to LoginUtilities

Parameters:
permissionNeeded -
request -
response -
Returns:
Throws:
IOException
javax.servlet.ServletException

isLoggedIn

protected boolean isLoggedIn(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws IOException,
                             javax.servlet.ServletException
Deprecated. move to LoginUtilities - no need for actions to check for user being logged in.

Parameters:
request -
response -
Returns:
Throws:
IOException
javax.servlet.ServletException

getBaseURL

public String getBaseURL(javax.servlet.http.HttpServletRequest request)
Parameters:
request - - request for base-url
Returns:
normalized base-url for the request

getITrackerServices

protected ITrackerServices getITrackerServices()
TODO: Deprecate and move to new static method in a ITrackerServicesFactory-class

Returns:

getName

public String getName()
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.

Returns:

setName

public void setName(String value)
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.


getPage

public String getPage()
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.

Returns:

setPage

public void setPage(String value)
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.


getPermission

public int getPermission()
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.

Returns:

setPermission

public void setPermission(int value)
Deprecated. no state information is allowed in actions. use a correct pattern like request-attributes.


loginRouter

public org.apache.struts.action.ActionForward loginRouter(org.apache.struts.action.ActionMapping mapping,
                                                          org.apache.struts.action.ActionForm form,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response,
                                                          org.apache.struts.action.ActionForward thisactionforward)
former checkLogin Tag(lib) Code.. TODO: move to static utility-method in LoginUtilities TODO: Clean and split this code up, so it is understandable what it does.


getLocale

public Locale getLocale(javax.servlet.http.HttpServletRequest request)
Overrides:
getLocale in class org.apache.struts.action.Action

logTimeMillies

protected static void logTimeMillies(String message,
                                     Date startTime,
                                     org.apache.log4j.Logger log,
                                     org.apache.log4j.Level level)
Log time passed since timestamp startTime was set. After logging, the passed startTime-Date is reset to System.currentTimeMillis(). This helps on actions performance issues.

Parameters:
message -
startTime -
log -
priority -

handleException

protected void handleException(Throwable t,
                               org.apache.struts.action.ActionMessages messages,
                               javax.servlet.http.HttpServletRequest httpServletRequest)
Parameters:
t -
messages -
httpServletRequest -


Copyright © 2002-2012 itracker. All Rights Reserved.