com.atlassian.jira.web.action
Class JiraWebActionSupport

java.lang.Object
  extended by webwork.action.ActionSupport
      extended by com.atlassian.jira.action.JiraActionSupport
          extended by com.atlassian.jira.web.action.JiraWebActionSupport
All Implemented Interfaces:
ErrorCollection, I18nHelper, java.io.Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.IllegalArgumentAware
Direct Known Subclasses:
AbstractConfigureFieldLayout, AbstractConstantAction, AbstractConvertIssue, AbstractEditConfigurationItemAction, AbstractEditFieldLayoutItem, AbstractEditFieldLayoutSchemeAction, AbstractFieldLayoutAction, AbstractFieldScreenAction, AbstractFieldScreenSchemeAction, AbstractManageIssueTypeOptionsAction, AbstractProjectImportProgress, AbstractProjectImportUsersMissing, AbstractProjectRole, AbstractRoleActorAction, AbstractRoleActors, AbstractSchemeAware, AbstractSchemeAwareAction, AbstractSchemeToolAction, AbstractSetupAction, AbstractTrustedApplicationAction, AbstractViewWorkflowMetaAttributes, AbstractWorkflowStep, AbstractWorkflowTransition, AbstractWorkflowTransitionAction, AcknowledgeTask, ActivateWorkflow, ActivateWorkflowStep2, AddPortalPage, AddUser, AdjustFavourite, AllUsersRememberMeCookies, AssociateFieldToScreens, AvatarPicker, BrowseComponent, BrowseProjects, BrowseVersion, BugzillaImport, BulkEditUserGroups, CantBrowseCreatedIssue, ChangePassword, CleanData, ClearRememberMeCookies, CloneWorkflow, ConfigureCustomField, ConfigureFieldLayoutScheme, ConfigureFieldScreen, ConfigureIssueCache, ConfigureIssueTypeScreenScheme, ConfigurePortalPages, ConfirmInstallationWithLicense, ConfirmNewInstallationWithOldLicense, CreateDraftWorkflow, CurrentUsersList, Dashboard, DateRangePicker, DeleteAvatar, DeleteCustomField, DeleteLinkType, DeletePortalPage, DeleteWorkflowTransitions, DisableSubTasks, EditAnnouncementBanner, EditCustomField, EditDefaultDashboard, EditFieldLayoutItemRendererConfirmation, EditIssueTypeScreenScheme, EditLinkType, EditListener, EditPortalPage, EditProfile, EditService, EditSubTaskIssueTypes, EditWorkflow, FavouriteFilters, FilterPickerPopup, ForgotLoginDetails, FuncTestWriter, IconPicker, ImportWorkflow, IndexOptimize, IntegrityChecker, IssuePicker, JellyRunner, JiraSupportRequest, JiraWizardActionSupport, LDAPConfigurer, ListEventTypes, ListWorkflows, Logout, MailQueueAdmin, MailServerActionSupport, ManageConfigurationScheme, ManageSubTasks, MantisImport, ProjectActionSupport, ProjectEmail, ProjectImportResultsAction, ProjectImportSelectBackup, ProjectImportSelectProject, ProjectImportSummary, PublishDraftWorkflow, RecentIssueHistory, ReleaseNote, RepositoryActionSupport, ResetFailedLoginCount, ResetPassword, RestoreDefaultDashboard, RunPortlet, SchedulerAdmin, SchemeToolsAction, SelectFieldLayoutScheme, SelectIssueTypeScreenScheme, SelectProjectCategory, SelectProjectRepository, SelectScreenScheme, SendBulkMail, SendTestMail, ServiceExecutor, SessionTimeoutMessage, SetSelectedIssue, ShowConstantsHelp, ShowTimeTrackingHelp, Signup, TaskAdmin, TimeTrackingAdmin, UpdateUserPreferences, ViewCustomFields, ViewGroup, ViewIssueTypeScreenSchemes, ViewKeyboardShortcuts, ViewLicense, ViewLinkTypes, ViewListeners, ViewLogging, ViewPlugins, ViewProjects, ViewSchemes, ViewServices, ViewSystemInfo, ViewTrustedApplications, ViewUserHover, ViewUserProjectRoles, ViewWorkflowXml, WikiRendererHelpAction, XsrfErrorAction

public class JiraWebActionSupport
extends JiraActionSupport
implements ErrorCollection

All web actions should extend this class - it provides basic common functionality for all web actions.

When adding to this class, be sure that what you are adding is used by a large number of actions - otherwise add it to a sub class of this.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory
 
Field Summary
static java.lang.String ISSUE_NOT_FOUND_RESULT
           
static java.lang.String PERMISSION_VIOLATION_RESULT
           
protected  javax.servlet.http.HttpServletRequest request
           
static java.lang.String RETURN_URL_PARAMETER
           
protected  java.util.Collection savedFilters
           
 
Fields inherited from class com.atlassian.jira.action.JiraActionSupport
log
 
Fields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessages
 
Fields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
JiraWebActionSupport()
           
 
Method Summary
 void addErrorCollection(ErrorCollection errors)
          Populate this ErrorCollection with general and field-specific errors.
protected  void addErrorMessageByKeyIfAbsent(java.lang.String errorMsgKey)
           
protected  void addErrorMessageIfAbsent(java.lang.String errorMsg)
           
protected  java.lang.String forceRedirect(java.lang.String redirect)
          This method will force a server redirect.
 ApplicationProperties getApplicationProperties()
           
 java.util.Map getAssignableUsers(org.ofbiz.core.entity.GenericValue entity)
           
 java.util.Map getAssignableUsers(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue issue)
           
protected  java.util.Collection getCachedGroups()
           
 ComponentManager getComponentManager()
           
 java.lang.String getConglomerateCookieValue(java.lang.String cookieName, java.lang.String key)
          Retreive the value from a conglomerate Cookie from the request.
 ConstantsManager getConstantsManager()
           
 java.lang.String getDateFormat()
           
 java.lang.String getDateTimeFormat()
           
 java.lang.String getDescTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV)
           
static ExternalLinkUtil getExternalLinkUtils()
           
 Field getField(java.lang.String id)
           
 java.util.Collection<java.lang.String> getFlushedErrorMessages()
          Get error messages, then get rid of them.
protected  GlobalPermissionManager getGlobalPermissionManager()
           
 Hint getHint(java.lang.String context)
           
protected  HintManager getHintManager()
           
 JiraServiceContext getJiraServiceContext()
          Provides a service context with the current user which contains this action as its ErrorCollection.
 java.lang.String getLanguage()
           
 java.lang.String getNameTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV)
           
 OutlookDate getOutlookDate()
           
protected  PermissionManager getPermissionManager()
           
 ProjectManager getProjectManager()
           
 com.opensymphony.module.propertyset.PropertySet getPropertySet(org.ofbiz.core.entity.GenericValue gv)
           
 Hint getRandomHint()
           
 java.lang.String getRedirect(java.lang.String defaultUrl)
          Get a definitive result with a redirect upon success.
 com.opensymphony.user.User getRemoteUser()
           
 java.lang.String getReturnUrl()
           
 java.lang.String getReturnUrlForCancelLink()
          The cancel links should not included the selectedIssueId, otherwise when returning to the issue navigator an issue updated notification will be shown.
 java.util.List<java.lang.String> getSearchSortDescriptions(SearchRequest searchRequest)
           
 org.ofbiz.core.entity.GenericValue getSelectedProject()
          Gets the "active" project.
 Project getSelectedProjectObject()
           
 java.lang.String getServerId()
           
 java.lang.String getText(java.lang.String key)
          If called from a JSP page that is not associated with an action, look for key in the default JiraWebActionSupport.properties file
 java.lang.String getTimeFormat()
           
 UriValidator getUriValidator()
           
 java.lang.String getUserFullName(java.lang.String username)
           
protected  UserProjectHistoryManager getUserProjectHistoryManager()
           
 VersionManager getVersionManager()
           
 java.lang.String getWebworkStack()
          For debugging JSPs; prints the webwork stack.
 java.lang.String getWebworkStack(java.lang.String selected)
          For debugging JSPs; prints the webwork stack, highlighting the specified node.
 java.lang.String getXsrfToken()
           
protected  boolean hasErrorMessage(java.lang.String errorMsg)
           
protected  boolean hasErrorMessageByKey(java.lang.String errorMsgKey)
           
 java.lang.String htmlEncode(java.lang.String encodeMe)
          Convenience instance method to call static utility from webwork EL.
 boolean isHasIssuePermission(int permissionsId, org.ofbiz.core.entity.GenericValue issue)
           
 boolean isHasIssuePermission(java.lang.String permName, org.ofbiz.core.entity.GenericValue issue)
           
 boolean isHasPermission(int permissionsId)
           
 boolean isHasPermission(java.lang.String permName)
           
 boolean isHasPermission(java.lang.String permName, org.ofbiz.core.entity.GenericValue entity)
          Deprecated. Please use either isHasIssuePermission(String,GenericValue), isHasIssuePermission(int,GenericValue) or isHasProjectPermission(String,GenericValue), isHasProjectPermission(int,GenericValue).
 boolean isHasProjectPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project)
           
 boolean isHasProjectPermission(java.lang.String permName, org.ofbiz.core.entity.GenericValue project)
           
 boolean isInlineDialogMode()
          This returns true if the action has been invoked as an inline dialog.
 boolean isSystemAdministrator()
           
 boolean isUserExists(java.lang.String username)
           
 java.lang.String returnComplete()
           
 java.lang.String returnComplete(java.lang.String url)
           
protected  java.lang.String returnCompleteWithInlineRedirect(java.lang.String url)
          This will return success response with body containing url to redirect.
 void setConglomerateCookieValue(java.lang.String cookieName, java.lang.String key, java.lang.String value)
          Set the value key/value pair in a conglomerate Cookie.
 void setInline(boolean inline)
          This is the web parameter setter for invoking an action as an inline dialog
 void setReturnUrl(java.lang.String returnUrl)
           
 void setSelectedProjectId(java.lang.Long id)
           
 
Methods inherited from class com.atlassian.jira.action.JiraActionSupport
addErrorMessages, addErrorMessages, addErrors, addIllegalArgumentException, execute, getActionName, getDefaultResourceBundle, getDelegator, getKeysForPrefix, getLocale, getResult, getText, getText, getText, getText, getText, getText, getText, getText, getText0, getUnescapedText, getUserPreferences, getWatcherManager, hasAnyErrors, isEnterprise, isIndexing, isProfessional, isProfessionalOrEnterprise, isStandard, removeKeyOrAddError
 
Methods inherited from class webwork.action.ActionSupport
addError, addErrorMessage, doDefault, doExecute, doValidation, getCommandName, getErrorMessages, getErrors, getHasErrorMessages, getHasErrors, getPropertyEditorMessage, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, addErrorMessage, addErrorMessages, addErrors, getErrorMessages, getErrors, hasAnyErrors, setErrorMessages
 
Methods inherited from interface webwork.action.CommandDriven
getCommandName, setCommand
 

Field Detail

RETURN_URL_PARAMETER

public static final java.lang.String RETURN_URL_PARAMETER
See Also:
Constant Field Values

PERMISSION_VIOLATION_RESULT

public static final java.lang.String PERMISSION_VIOLATION_RESULT
See Also:
Constant Field Values

ISSUE_NOT_FOUND_RESULT

public static final java.lang.String ISSUE_NOT_FOUND_RESULT
See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request

savedFilters

protected java.util.Collection savedFilters
Constructor Detail

JiraWebActionSupport

public JiraWebActionSupport()
Method Detail

getRemoteUser

public com.opensymphony.user.User getRemoteUser()
Specified by:
getRemoteUser in class JiraActionSupport

getXsrfToken

public java.lang.String getXsrfToken()

getApplicationProperties

public ApplicationProperties getApplicationProperties()
Overrides:
getApplicationProperties in class JiraActionSupport

getUriValidator

public UriValidator getUriValidator()

getRedirect

public java.lang.String getRedirect(java.lang.String defaultUrl)
Get a definitive result with a redirect upon success.

Returns Action.ERROR if there are error messages, otherwise redirects to another URL if successful. If URL starts with '/', interpreted as context-relative

Since 3.1 now redirects to a the "returnUrl" if one exists. Will clear this value once this occurs

Parameters:
defaultUrl - default URL to redirect to
Returns:
URL to redirect to

forceRedirect

protected java.lang.String forceRedirect(java.lang.String redirect)
This method will force a server redirect. It doesn't clear the return URL and will always go to the redirect URL

Parameters:
redirect - redirect URL
Returns:
Action.NONE. It'll just redirect to where you've specified

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(org.ofbiz.core.entity.GenericValue gv)

isHasPermission

public boolean isHasPermission(java.lang.String permName)

isHasPermission

public boolean isHasPermission(int permissionsId)

isHasIssuePermission

public boolean isHasIssuePermission(java.lang.String permName,
                                    org.ofbiz.core.entity.GenericValue issue)

isHasIssuePermission

public boolean isHasIssuePermission(int permissionsId,
                                    org.ofbiz.core.entity.GenericValue issue)

isHasProjectPermission

public boolean isHasProjectPermission(java.lang.String permName,
                                      org.ofbiz.core.entity.GenericValue project)

isHasProjectPermission

public boolean isHasProjectPermission(int permissionsId,
                                      org.ofbiz.core.entity.GenericValue project)

isHasPermission

public boolean isHasPermission(java.lang.String permName,
                               org.ofbiz.core.entity.GenericValue entity)
Deprecated. Please use either isHasIssuePermission(String,GenericValue), isHasIssuePermission(int,GenericValue) or isHasProjectPermission(String,GenericValue), isHasProjectPermission(int,GenericValue).

Returns true if remote user has permission over given entity, false otherwise.

Parameters:
permName - permission type
entity - entity to check the permission for, e.g. project, issue
Returns:
true if remote user has permission over given entity, false otherwise

isSystemAdministrator

public boolean isSystemAdministrator()

getGlobalPermissionManager

protected GlobalPermissionManager getGlobalPermissionManager()

getPermissionManager

protected PermissionManager getPermissionManager()

getUserProjectHistoryManager

protected UserProjectHistoryManager getUserProjectHistoryManager()

getCachedGroups

protected java.util.Collection getCachedGroups()

getConstantsManager

public ConstantsManager getConstantsManager()

isUserExists

public boolean isUserExists(java.lang.String username)

getUserFullName

public java.lang.String getUserFullName(java.lang.String username)

getAssignableUsers

public java.util.Map getAssignableUsers(org.ofbiz.core.entity.GenericValue entity)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getAssignableUsers

public java.util.Map getAssignableUsers(org.ofbiz.core.entity.GenericValue project,
                                        org.ofbiz.core.entity.GenericValue issue)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getProjectManager

public ProjectManager getProjectManager()

getVersionManager

public VersionManager getVersionManager()

getText

public java.lang.String getText(java.lang.String key)
If called from a JSP page that is not associated with an action, look for key in the default JiraWebActionSupport.properties file

Specified by:
getText in interface I18nHelper
Overrides:
getText in class JiraActionSupport
Parameters:
key - message resource key

addErrorCollection

public void addErrorCollection(ErrorCollection errors)
Description copied from interface: ErrorCollection
Populate this ErrorCollection with general and field-specific errors.

Specified by:
addErrorCollection in interface ErrorCollection
Parameters:
errors - ErrorCollection whose errors/messages we obtain.

getField

public Field getField(java.lang.String id)

getSearchSortDescriptions

public java.util.List<java.lang.String> getSearchSortDescriptions(SearchRequest searchRequest)

getComponentManager

public ComponentManager getComponentManager()

getOutlookDate

public OutlookDate getOutlookDate()

getNameTranslation

public java.lang.String getNameTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV)

getDescTranslation

public java.lang.String getDescTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV)

getReturnUrl

public java.lang.String getReturnUrl()

getReturnUrlForCancelLink

public java.lang.String getReturnUrlForCancelLink()
The cancel links should not included the selectedIssueId, otherwise when returning to the issue navigator an issue updated notification will be shown.

Returns:
the returnUrl with selectedIssueId parameter stripped out.

setReturnUrl

public void setReturnUrl(java.lang.String returnUrl)

getFlushedErrorMessages

public java.util.Collection<java.lang.String> getFlushedErrorMessages()
Description copied from interface: ErrorCollection
Get error messages, then get rid of them.

Specified by:
getFlushedErrorMessages in interface ErrorCollection
Returns:
The (now cleared) error messages.

getLanguage

public java.lang.String getLanguage()
                             throws java.io.IOException
Throws:
java.io.IOException

getSelectedProjectObject

public Project getSelectedProjectObject()

getSelectedProject

public org.ofbiz.core.entity.GenericValue getSelectedProject()
Gets the "active" project. Projects become active when your browse, search for a single project or create an issue

Returns:
GenericValue as a project

setSelectedProjectId

public void setSelectedProjectId(java.lang.Long id)

getDateFormat

public java.lang.String getDateFormat()

getDateTimeFormat

public java.lang.String getDateTimeFormat()

getTimeFormat

public java.lang.String getTimeFormat()

getExternalLinkUtils

public static ExternalLinkUtil getExternalLinkUtils()

getWebworkStack

public java.lang.String getWebworkStack(java.lang.String selected)
For debugging JSPs; prints the webwork stack, highlighting the specified node. Eg. called with:

Parameters:
selected - selected value in the webwork stack
Returns:
HTML string of the webwork stack

getWebworkStack

public java.lang.String getWebworkStack()
For debugging JSPs; prints the webwork stack. Eg. called with:

Returns:
HTML string of the webwork stack

getServerId

public java.lang.String getServerId()

getJiraServiceContext

public JiraServiceContext getJiraServiceContext()
Provides a service context with the current user which contains this action as its ErrorCollection.

Returns:
the JiraServiceContext.

htmlEncode

public java.lang.String htmlEncode(java.lang.String encodeMe)
Convenience instance method to call static utility from webwork EL.

Parameters:
encodeMe - a String to be HTML encoded.
Returns:
the HTML encoded string.

isInlineDialogMode

public boolean isInlineDialogMode()
This returns true if the action has been invoked as an inline dialog. This changes the way that the action sends back its responses, namely when the action is submitted and completed

Returns:
true if the action was invoked as an inline dialog

setInline

public void setInline(boolean inline)
This is the web parameter setter for invoking an action as an inline dialog

Parameters:
inline - true if the action should act as an inline dialog

returnComplete

public java.lang.String returnComplete()

returnComplete

public java.lang.String returnComplete(java.lang.String url)

returnCompleteWithInlineRedirect

protected final java.lang.String returnCompleteWithInlineRedirect(java.lang.String url)
This will return success response with body containing url to redirect. An appropriately configured client side control should perform redirect to the desired url.

Parameters:
url - URL to redirect to
Returns:
action mapping string

hasErrorMessage

protected final boolean hasErrorMessage(java.lang.String errorMsg)

hasErrorMessageByKey

protected final boolean hasErrorMessageByKey(java.lang.String errorMsgKey)

addErrorMessageIfAbsent

protected final void addErrorMessageIfAbsent(java.lang.String errorMsg)

addErrorMessageByKeyIfAbsent

protected final void addErrorMessageByKeyIfAbsent(java.lang.String errorMsgKey)

getHint

public final Hint getHint(java.lang.String context)

getRandomHint

public final Hint getRandomHint()

getHintManager

protected final HintManager getHintManager()

getConglomerateCookieValue

public java.lang.String getConglomerateCookieValue(java.lang.String cookieName,
                                                   java.lang.String key)
Retreive the value from a conglomerate Cookie from the request.

Parameters:
cookieName - The name of the conglomerate cookie
key - The key of the value
Returns:
the value (or the empty-string if it did not exist)

setConglomerateCookieValue

public void setConglomerateCookieValue(java.lang.String cookieName,
                                       java.lang.String key,
                                       java.lang.String value)
Set the value key/value pair in a conglomerate Cookie.

Parameters:
cookieName - The name of the conglomerate cookie
key - The key of the value
value - The value


Copyright © 2002-2010 Atlassian. All Rights Reserved.