Class JiraWebActionSupport
- All Implemented Interfaces:
ErrorCollection,I18nHelper,HttpServletVariables,AuthorizationSupport,Serializable,webwork.action.Action,webwork.action.CommandDriven,webwork.action.IllegalArgumentAware
- Direct Known Subclasses:
A11yPersonalSettings,AboutPage,AbstractConfigureFieldLayout,AbstractConstantAction,AbstractConvertIssue,AbstractDashboardAdministration,AbstractEditConfigurationItemAction,AbstractEditFieldLayoutItem,AbstractEditFieldLayoutSchemeAction,AbstractFieldScreenSchemeAction,AbstractManagableOptionsAction,AbstractPage,AbstractPermissionCheckAction,AbstractPrioritySchemesAction,AbstractProjectImportProgress,AbstractProjectImportUsersMissing,AbstractProjectRole,AbstractRoleActorAction,AbstractSchemeAware,AbstractSchemeAwareAction,AbstractSetupAction,AbstractWorkflowAction,AbstractWorkflowDraftResultAction,AcknowledgeTask,AddFieldConfiguration,AddFieldConfigurationScheme,AddIssueTypeScreenScheme,AddIssueTypeScreenScreenSchemeAssociation,AddIssueTypeToFieldConfigurationAssociation,AddNewIssueTypeToScheme,AddPortalPage,AddUser,AdjustFavourite,AdvancedApplicationProperties,AllUsersRememberMeCookies,AnonymizeUser,ApplicationAccess,AssociatedProjectsForCustomField,AssociatedScreensForCustomField,AssociateFieldToScreens,AutomationGlobalAdminAction,AutomationProjectAdminAction,AutomationWelcomeAction,BasicJiraCreditsPage,BrowseArchivedIssues,BrowseProjects,BulkEditUserGroups,CantBrowseCreatedIssue,ChangePassword,ClearRememberMeCookies,CloneWorkflow,CommittedResponseExceptionThrowingAction,ComponentEditAction,ConfigureCrowdServer,ConfigureCustomField,ConfigureField,ConfigureFieldLayoutScheme,ConfigureFieldScreen,ConfigureIssueTypeScreenScheme,ConfigurePortalPages,ConfirmNewInstallationWithOldLicense,ContactAdministrators,CopyFieldLayout,CreateDraftWorkflow,CurrentUsersList,Dashboard,DeleteCustomField,DeleteJobRunner,DeleteLinkType,DeletePortalPage,DisableSubTasks,EditAnnouncementBanner,EditAvatarSettings,EditCrowdApplication,EditCustomField,EditDarkFeatures,EditDefaultDashboard,EditFieldLayout,EditFieldLayoutItemRendererConfirmation,EditFieldScreen,EditIssueTypeScreenScheme,EditLevel,EditLinkType,EditListener,EditNestedGroups,EditPortalPage,EditProfile,EditService,EditSubTaskIssueTypes,EditWorkflowDispatcher,EditWorkflowScheme,EmailTemplatesSettings,Error404,FavouriteFilters,FilterPickerPopup,FirstUseFlowAction,ForgotLoginDetails,IconPicker,ImportResult,ImportWorkflow,IndexOptimize,IntegrityCheckerAction,IssuePicker,JiraWizardActionSupport,JmxMonitoringAction,LandingPage,LeaveAdmin,ListEventTypes,Logout,MailQueueAdmin,ManageCacheInstrumentation,ManageConfigurationScheme,ManageSubTasks,ManageTerminology,MigratePrioritySchemeAction,MigratePrioritySchemeProgress,MyJiraHome,PreparedReferenceAction,ProjectActionSupport,ProjectEmail,ProjectImportResultsAction,ProjectImportSelectBackup,ProjectImportSelectProject,ProjectImportSummary,ProjectPermissions,ProjectSidebarAction,PulpRenderAction,RecentIssueHistory,ReferenceAction,ReferenceComponentAction,ReferenceComponentImportAction,ReferenceModuleTypeAction,ReferenceResourceAction,ReferenceSoyAction,ReleaseNote,ReplicationSettings,ResetFailedLoginCount,ResetPassword,ResourcePhaseCheckpointsAction,RestoreDefaultDashboard,SchedulerAdmin,SelectFieldLayoutScheme,SelectIssueTypeScreenScheme,SelectProjectCategory,SendBulkMail,ServiceExecutor,SessionTimeoutMessage,ShowConstantsHelp,ShowTimeTrackingHelp,Signup,SiteDarkFeatures,TerminologyHelp,TimeTrackingAdmin,TranslateCustomField,UpdateMyJiraHome,UpdateUserPreferences,VersionAction,VersionEditAction,ViewCacheDetails,ViewCachesByRequest,ViewCacheStats,ViewCustomFields,ViewDefaultProjectRoleActors,ViewEventAction,ViewFieldLayouts,ViewFieldScreens,ViewGroup,ViewInstrumentation,ViewIssueTypeScreenSchemes,ViewKeyboardShortcuts,ViewLinkTypes,ViewListeners,ViewLogging,ViewPrioritySchemesForPriority,ViewProjectRoleActors,ViewProjectRoles,ViewProjects,ViewSchemes,ViewSchemes,ViewServices,ViewSystemFields,ViewSystemInfo,ViewUpgrades,ViewUris,ViewUserHover,ViewUserProjectRoles,ViewWorkflowsForStatus,ViewWorkflowXml,WebSudoAuthenticate,WikiRendererHelpAction,XsrfErrorAction
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents a type of message that the browser will display after the next page load.Nested classes/interfaces inherited from interface com.atlassian.jira.util.ErrorCollection
ErrorCollection.ReasonNested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final org.apache.log4j.Loggerstatic final Stringprotected jakarta.servlet.http.HttpServletRequestDeprecated.static final Stringprotected Collectionstatic final StringFields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessagesFields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(String field, String message, ErrorCollection.Reason reason) Add a field-specific error message.voidaddErrorCollection(ErrorCollection errors) Populate this ErrorCollection with general and field-specific errors.voidaddErrorMessage(String message, ErrorCollection.Reason reason) Add error message relating to system state (not field-specific), and a reason.protected final voidaddErrorMessageByKeyIfAbsent(String errorMsgKey) protected final voidaddErrorMessageIfAbsent(String errorMsg) voidaddErrorMessages(Collection<String> errorMessages) Append new error messages to those already collected.voidaddErrorMessages(webwork.dispatcher.ActionResult aResult) voidAppend new field-specific errors to those already collected.voidaddIllegalArgumentException(String fieldName, IllegalArgumentException e) Override this method from ActionSupport.protected voidaddMessageToResponse(String msg, String type, boolean closeable, String target) This will populate the the custom Atlassian header with the details of a pop-up message.voidaddReason(ErrorCollection.Reason reason) Add a reason why the function has not been performed.voidaddReasons(Set<ErrorCollection.Reason> reasons) Add reasons why the function has not been performed.booleanexecute()protected StringforceRedirect(String redirect) This method will force a server redirect, with no security checks.final Stringfinal StringGet the link, with Internationalised text for contacting the administrators of JIRA.protected AuthorizationSupportprotected <T> TgetComponentInstanceOfType(Class<T> clazz) This can be called to get a component from theComponentAccessor.getConglomerateCookieValue(String cookieName, String key) Retrieve the value from a conglomerate Cookie from the request.Returns a DateTimeFormatter that can be used to format times and dates in the user's time zone usingDateTimeStyle.RELATIVE.Returns the defaultResourceBundlewithin JIRA, which does not include translations provided by plugins.getDescTranslation(IssueConstant issueConstant) Deprecated.UseConstantsManagerinstead.getDescTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV) Deprecated.UseConstantsManagerinstead.Returns a DateTimeFormatter that can be used to format dates in the user's time zone usingDateTimeStyle.DATE.Returns an empty response code (204)Get all non field-specific error messages.Get all field-specific errors.Get error messages, then get rid of them.protected GlobalPermissionManagerfinal Hintprotected final HintManagerjakarta.servlet.http.HttpServletRequestjakarta.servlet.http.HttpServletResponsejakarta.servlet.http.HttpSessionprotected I18nHelperProvides a service context with the current user which contains this action as itsErrorCollection.getKeysForPrefix(String prefix) Given a prefix for an i18n key, this method will return all keys that start with the prefix specified.Deprecated.UsegetLoggedInUser().getNameTranslation(IssueConstant issueConstant) Deprecated.UseConstantsManagerinstead.getNameTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV) Deprecated.UseConstantsManagerinstead.protected OutboundWhitelistProviderDeprecated.UsegetDateTimeFormatter()instead.protected PermissionManagerfinal HintA set of well known reasons why the function has not been performed.getRedirect(String defaultUrl) Redirects to the value ofgetReturnUrl(), falling back todefaultUrlif thereturnUrlis not set.getRedirect(String defaultUrl, boolean allowUnsafeRedirect) Redirects to the value ofgetReturnUrl(), falling back todefaultUrlif thereturnUrlis not set.protected final RedirectSanitiserReturns a RedirectSanitiser implementation.Returns an enum type representing how the action was invoked.Returns the consolidated ResourceBundle for this I18nHelper, which includes translations provided by plugins.Get a definitive result.The cancel links should not included the selectedIssueId, otherwise when returning to the issue navigator an issue updated notification will be shown.getSearchSortDescriptions(SearchRequest searchRequest) Gets the last viewed project that the user visited and still has permission to see.Gets the last viewed project that the user visited and still has permission to see.jakarta.servlet.ServletContextCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be found.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6) Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7) Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7, Object value8) Called to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundCalled to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7) Called to return the formatted text of the specified i18n keygetText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9) Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetUnescapedText(String key) Called to return the un-formatted text of the specified i18n key or the key itself if no message can be foundSame asI18nHelper.getUnescapedText(String)but does not apply anyTranslationTransforms.getUserFullName(String username) com.atlassian.core.user.preferences.Preferencesprotected UserProjectHistoryManagerFor debugging JSPs; prints the webwork stack.getWebworkStack(String selected) For debugging JSPs; prints the webwork stack, highlighting the specified node.booleanWhether any errors (of any type - field-specific or otherwise) have been collected.protected final booleanhasErrorMessage(String errorMsg) protected final booleanhasErrorMessageByKey(String errorMsgKey) booleanhasGlobalPermission(GlobalPermissionKey globalPermissionKey) Returns true if the logged in user has the given global permission.booleanhasGlobalPermission(String permissionKey) Returns true if the logged in user has the given global permission.booleanhasIssuePermission(int permissionsId, Issue issue) Returns true if the logged in user has the given permission type on the given Issue.booleanhasIssuePermission(ProjectPermissionKey projectPermissionKey, Issue issue) Returns true if the logged in user has the given permission on the given Issue.booleanhasIssuePermission(String permissionKey, Issue issue) Returns true if the logged in user has the given permission type on the given Issue.booleanhasPermission(int permissionsId) Deprecated.booleanhasProjectPermission(int permissionsId, Project project) booleanhasProjectPermission(ProjectPermissionKey projectPermissionKey, Project project) Returns true if the logged in user has the given permission on the given project.htmlEncode(String encodeMe) Convenience instance method to call static utility from webwork EL.protected StringinsertContextPath(String url) Prepends the context path to the URL if it begins with a forward slash (this is commonly used for redirects within a JIRA instance).booleanbooleanbooleanThis returns true if the action has been invoked as an inline dialog.booleanisKeyDefined(String key) For the given key, checks whether such a key is defined in the locale context represented by this helper instance.booleanbooleanisUserExists(String username) Deprecated.UseisUserExistsByName(String)orisUserExistsByKey(String)instead, as appropriate.booleanisUserExistsByKey(String userkey) booleanisUserExistsByName(String username) protected voidremoveKeyOrAddError(Map params, String key, String messageKey) Checks if descriptorParams contains key and removes it, otherwise adds the error message with the given message key.returnComplete(String url) protected final StringThis will return success response with body containing url to redirect.protected StringreturnCompleteWithInlineRedirectAndMsg(String url, String msg, JiraWebActionSupport.MessageType type, boolean closeable, String target) This will redirect likereturnCompleteWithInlineRedirect(String), and will also populate the response with the details of a pop-up message to be displayed on the redirected page.protected StringreturnCompleteWithInlineRedirectAndMsg(String url, String msg, String type, boolean closeable, String target) Deprecated.since 5.1.protected StringreturnMsgToUser(String url, String msg, JiraWebActionSupport.MessageType type, boolean closeable, String target) This will redirect likereturnComplete(), and will also populate the response with the details of a pop-up message to be displayed on the redirected page.protected StringreturnMsgToUser(String url, String msg, String type, boolean closeable, String target) Deprecated.since 5.1.voidsetConglomerateCookieValue(String cookieName, String key, String value) Set the value key/value pair in a conglomerate Cookie.voidsetInline(boolean inline) This is the web parameter setter for invoking an action as an inline dialogvoidsetReasons(Set<ErrorCollection.Reason> reasons) Set reasons why the function has not been performed.voidsetReturnUrl(String returnUrl) voidprotected voidtagMauEventWithApplication(MauApplicationKey applicationKey) protected voidtagMauEventWithProject(Project project) Encodes the given string intoapplication/x-www-form-urlencodedformat, using the JIRA encoding scheme to obtain the bytes for unsafe characters.Methods inherited from class webwork.action.ActionSupport
addError, addErrorMessage, doDefault, doExecute, doValidation, getCommandName, getHasErrorMessages, getHasErrors, getPropertyEditorMessage, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface webwork.action.CommandDriven
getCommandName, setCommandMethods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, addErrorMessage, setErrorMessages
-
Field Details
-
log
protected final org.apache.log4j.Logger log -
RETURN_URL_PARAMETER
- See Also:
-
PERMISSION_VIOLATION_RESULT
- See Also:
-
SECURITY_BREACH_RESULT
- See Also:
-
ISSUE_NOT_FOUND_RESULT
- See Also:
-
request
protected jakarta.servlet.http.HttpServletRequest requestDeprecated.since 6.0 - usegetHttpRequest()instead.- See Also:
-
savedFilters
-
-
Constructor Details
-
JiraWebActionSupport
protected JiraWebActionSupport()
-
-
Method Details
-
getLoggedInUser
@IncompatibleReturnType(since="7.0", was="com.atlassian.crowd.embedded.api.User") public ApplicationUser getLoggedInUser()- Returns:
- The logged-in user.
-
getLoggedInApplicationUser
Deprecated.UsegetLoggedInUser(). Since v7.0- Returns:
- The logged in user.
-
getXsrfToken
-
getHttpRequest
public jakarta.servlet.http.HttpServletRequest getHttpRequest()- Specified by:
getHttpRequestin interfaceHttpServletVariables- Returns:
- the
HttpServletRequestin play - See Also:
-
getHttpSession
public jakarta.servlet.http.HttpSession getHttpSession()- Specified by:
getHttpSessionin interfaceHttpServletVariables- Returns:
- the
HttpSessionin play - See Also:
-
getHttpResponse
public jakarta.servlet.http.HttpServletResponse getHttpResponse()- Specified by:
getHttpResponsein interfaceHttpServletVariables- Returns:
- the
HttpServletResponsein play - See Also:
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfaceHttpServletVariables- Returns:
- the
ServletContextof the JIRA web application - See Also:
-
getApplicationProperties
-
getUriValidator
-
getGlobalPermissionManager
-
getPermissionManager
-
getUserProjectHistoryManager
-
getConstantsManager
-
getProjectManager
-
getVersionManager
-
getOutlookDate
Deprecated.UsegetDateTimeFormatter()instead. Since v5.0. -
getDateTimeFormatter
Returns a DateTimeFormatter that can be used to format times and dates in the user's time zone usingDateTimeStyle.RELATIVE.- Returns:
- a DateTimeFormatter
-
getDmyDateFormatter
Returns a DateTimeFormatter that can be used to format dates in the user's time zone usingDateTimeStyle.DATE.- Returns:
- a DateTimeFormatter
-
getJiraContactHelper
-
getUserManager
-
getAdministratorContactLink
Get the link, with Internationalised text for contacting the administrators of JIRA. This link is present on many pages across the bredth of JIRA and so centralised here.- Returns:
- html String of the contact administrators link.
-
getHintManager
-
getAuthorizationSupport
-
getOutboundWhitelistProvider
-
getRedirect
Redirects to the value ofgetReturnUrl(), falling back todefaultUrlif thereturnUrlis not set. This method clears thereturnUrl. If there are any errors, this method returns "ERROR". If no errors are reported, NONE is returned. If this method is called as if it were non-web, it returns SUCCESS. If the URL starts with '/' it is interpreted as context-relative.Off-site redirects
Starting from JIRA 6.0, this method will not redirect to a URL that is considered "unsafe" as perRedirectSanitiser.makeSafeRedirectUrl(String). UsegetRedirect(String, boolean)to allow unsafe redirects for URLs that do not contain possibly malicious user input.- Parameters:
defaultUrl- default URL to redirect to- Returns:
- either ERROR, SUCCESS or NONE as defined in
Action - See Also:
-
getRedirect
Redirects to the value ofgetReturnUrl(), falling back todefaultUrlif thereturnUrlis not set. This method clears thereturnUrl. If there are any errors, this method returns "ERROR". If no errors are reported, NONE is returned. If this method is called as if it were non-web, it returns SUCCESS. If the URL starts with '/' it is interpreted as context-relative. IfallowUnsafeRedirectis true, this method will not perform validation on the value ofreturnUrlordefaultUrl. This can introduce serious security problems, so use with care. In particular, you should only use use this method ifdefaultUrlhas already been sanitised (via whitelisting). It mightServletForwarder.forwardSafely(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse, java.net.URI)instead of redirecting. If blocked by any exportedForwardAuthorizerOSGi service, it will fall back to redirecting.- Parameters:
defaultUrl- default URL to redirect toallowUnsafeRedirect- whether to allow unsafe redirects (e.g.javascript:or off-site URLs).- Returns:
- either ERROR, SUCCESS or NONE as defined in
Action - Since:
- v5.1.5
- See Also:
-
forceRedirect
This method will force a server redirect, with no security checks. It doesn't clear the return URL and will always go to the redirect URL. For security reasons, prefergetRedirect(String), which checks that the redirect URL is safe.- Parameters:
redirect- redirect URL- Returns:
Action.NONE. It'll just redirect to where you've specified- See Also:
-
hasPermission
public boolean hasPermission(int permissionsId) Deprecated.UsehasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey)instead. Since v6.4.Returns true if the logged in user has the given permission type.- Specified by:
hasPermissionin interfaceAuthorizationSupport- Parameters:
permissionsId- the permission type- Returns:
- true if the logged in user has the given permission type.
-
hasGlobalPermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given global permission.This method is intended to be used in Java code. If you are using JSP / Velocity / Soy Templates, it is probably easier to call
AuthorizationSupport.hasGlobalPermission(String)instead.- Specified by:
hasGlobalPermissionin interfaceAuthorizationSupport- Parameters:
globalPermissionKey- the permission to check- Returns:
- true if the logged in user has the given global permission.
- See Also:
-
hasGlobalPermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given global permission.This method is intended to be used in JSP / Velocity / Soy Templates. If you are using Java directly, it is recommended to call
AuthorizationSupport.hasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey)instead.Note that this method takes a Global Permission Key, which is a different value to the old "permission name" that some previous methods would accept - see
GlobalPermissionKeyfor correct values of the system permissions.- Specified by:
hasGlobalPermissionin interfaceAuthorizationSupport- Parameters:
permissionKey- the permission to check- Returns:
- true if the logged in user has the given global permission.
- See Also:
-
hasIssuePermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given permission type on the given Issue.This method is intended for use in Velocity templates / JSPs etc. Within Java code you should prefer the method that takes a ProjectPermissionKey.
Note that this method takes a Permission Key, which is a different value to the old "permission name" that some previous methods would accept - see
ProjectPermissionsfor correct values of the system permissions.- Specified by:
hasIssuePermissionin interfaceAuthorizationSupport- Parameters:
permissionKey- the permission key as a Stringissue- the Issue- Returns:
- true if the logged in user has the given permission type on the given Issue.
- See Also:
-
hasIssuePermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given permission type on the given Issue.- Specified by:
hasIssuePermissionin interfaceAuthorizationSupport- Parameters:
permissionsId- the permission typeissue- the Issue- Returns:
- true if the logged in user has the given permission type on the given Issue.
-
hasIssuePermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given permission on the given Issue.- Specified by:
hasIssuePermissionin interfaceAuthorizationSupport- Parameters:
projectPermissionKey- the permission to checkissue- the Issue- Returns:
- true if the logged in user has the given permission on the given Issue.
- See Also:
-
hasProjectPermission
Deprecated.Returns true if the logged in user has the given permission type on the given Project.- Specified by:
hasProjectPermissionin interfaceAuthorizationSupport- Parameters:
permissionsId- the permission typeproject- the Project- Returns:
- true if the logged in user has the given permission type on the given Project.
-
hasProjectPermission
Description copied from interface:AuthorizationSupportReturns true if the logged in user has the given permission on the given project.- Specified by:
hasProjectPermissionin interfaceAuthorizationSupport- Parameters:
projectPermissionKey- the permission to checkproject- the project- Returns:
- true if the logged in user has the given permission on the given Issue.
-
isSystemAdministrator
public boolean isSystemAdministrator() -
isAdministrator
public boolean isAdministrator() -
isUserExists
Deprecated.UseisUserExistsByName(String)orisUserExistsByKey(String)instead, as appropriate. Since v6.0.Old name forisUserExistsByName(String)- Parameters:
username- the username to check- Returns:
trueif the username is associated with an existing user;falseotherwise
-
isUserExistsByName
-
isUserExistsByKey
-
getUserFullName
-
addErrorCollection
Description copied from interface:ErrorCollectionPopulate this ErrorCollection with general and field-specific errors.- Specified by:
addErrorCollectionin interfaceErrorCollection- Parameters:
errors- ErrorCollection whose errors/messages we obtain.
-
addError
Description copied from interface:ErrorCollectionAdd a field-specific error message.- Specified by:
addErrorin interfaceErrorCollection- Parameters:
field- Field name, eg. "assignee"message- Error message.reason- Reason for the error.
-
addErrorMessage
Description copied from interface:ErrorCollectionAdd error message relating to system state (not field-specific), and a reason.- Specified by:
addErrorMessagein interfaceErrorCollection- Parameters:
message- Error message.reason- Reason for the error.
-
addReason
Description copied from interface:ErrorCollectionAdd a reason why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.- Specified by:
addReasonin interfaceErrorCollection- Parameters:
reason- a well known reasons why the function has not been performed.
-
addReasons
Description copied from interface:ErrorCollectionAdd reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.- Specified by:
addReasonsin interfaceErrorCollection- Parameters:
reasons- a set of well known reasons why the function has not been performed.
-
setReasons
Description copied from interface:ErrorCollectionSet reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.- Specified by:
setReasonsin interfaceErrorCollection- Parameters:
reasons- a set of well known reasons why the function has not been performed.
-
getReasons
Description copied from interface:ErrorCollectionA set of well known reasons why the function has not been performed. The reasons may be used by callers of services to set return codes etc. for example in REST services.- Specified by:
getReasonsin interfaceErrorCollection- Returns:
- a set of well known reasons why the function has not been performed.
-
getField
-
getSearchSortDescriptions
-
getNameTranslation
Deprecated.UseConstantsManagerinstead. Since v6.0. -
getNameTranslation
Deprecated.UseConstantsManagerinstead. Since v6.0. -
getDescTranslation
Deprecated.UseConstantsManagerinstead. Since v6.0. -
getDescTranslation
Deprecated.UseConstantsManagerinstead. Since v6.0. -
getReturnUrl
-
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
-
getFlushedErrorMessages
Description copied from interface:ErrorCollectionGet error messages, then get rid of them.- Specified by:
getFlushedErrorMessagesin interfaceErrorCollection- Returns:
- The (now cleared) error messages.
-
getLanguage
- Throws:
IOException
-
getSelectedProject
Gets the last viewed project that the user visited and still has permission to see.- Returns:
- the last project the user visited.
- See Also:
-
getSelectedProjectObject
Gets the last viewed project that the user visited and still has permission to see. This is a legacy synonym forgetSelectedProject()- Returns:
- the last project the user visited.
- See Also:
-
setSelectedProjectId
-
getDateFormat
-
getDateTimeFormat
-
getTimeFormat
-
getWebworkStack
For debugging JSPs; prints the webwork stack, highlighting the specified node. Eg. called with: invalid input: '<'webwork:property value="/webworkStack('../../..')" escape="false"/>- Parameters:
selected- selected value in the webwork stack- Returns:
- HTML string of the webwork stack
-
getWebworkStack
For debugging JSPs; prints the webwork stack. Eg. called with: invalid input: '<'webwork:property value="/webworkStack" escape="false"/>- Returns:
- HTML string of the webwork stack
-
getServerId
-
getJiraServiceContext
Provides a service context with the current user which contains this action as itsErrorCollection.- Returns:
- the JiraServiceContext.
-
htmlEncode
Convenience instance method to call static utility from webwork EL.- Parameters:
encodeMe- a String to be HTML encoded.- Returns:
- the HTML encoded string.
-
urlEncode
Encodes the given string intoapplication/x-www-form-urlencodedformat, using the JIRA encoding scheme to obtain the bytes for unsafe characters.- Parameters:
encode- the String to encode- Returns:
- a URL-encoded String
- See Also:
-
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
-
getRequestSourceType
Returns an enum type representing how the action was invoked.- Returns:
RequestSourceType
-
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
-
returnComplete
-
checkIfUrlIsAllowed
-
getEmptyResponse
Returns an empty response code (204) -
returnCompleteWithInlineRedirect
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
-
returnCompleteWithInlineRedirectAndMsg
protected String returnCompleteWithInlineRedirectAndMsg(String url, String msg, JiraWebActionSupport.MessageType type, boolean closeable, @Nullable String target) This will redirect likereturnCompleteWithInlineRedirect(String), and will also populate the response with the details of a pop-up message to be displayed on the redirected page. An appropriately configured client side control should perform the displaying of the message.- Parameters:
url- URL to redirect tomsg- message HTMLtype- type of message.closeable- if true, message pop-up has an 'X' button, otherwise pop-up fades away automaticallytarget- the target to prepend the message pop-up to. If null, the message is shown in a global spot- Returns:
- action mapping string
-
returnCompleteWithInlineRedirectAndMsg
protected String returnCompleteWithInlineRedirectAndMsg(String url, String msg, String type, boolean closeable, @Nullable String target) Deprecated.since 5.1. UsereturnCompleteWithInlineRedirectAndMsg(String, String, MessageType, boolean, String)instead.This will redirect likereturnCompleteWithInlineRedirect(String), and will also populate the response with the details of a pop-up message to be displayed on the redirected page. An appropriately configured client side control should perform the displaying of the message.- Parameters:
url- URL to redirect tomsg- message HTMLtype- type of message, see JIRA.Messages.Typescloseable- if true, message pop-up has an 'X' button, otherwise pop-up fades away automaticallytarget- the target to prepend the message pop-up to. If null, the message is shown in a global spot- Returns:
- action mapping string
-
returnMsgToUser
@Deprecated protected String returnMsgToUser(String url, String msg, String type, boolean closeable, @Nullable String target) Deprecated.since 5.1. UsereturnMsgToUser(String, String, MessageType, boolean, String)instead.This will redirect likereturnComplete(), and will also populate the response with the details of a pop-up message to be displayed on the redirected page. An appropriately configured client side control should perform the displaying of the message.- Parameters:
url- URL to redirect to. Not used in dialogsmsg- message HTMLtype- type of message, see JIRA.Messages.Typescloseable- if true, message pop-up has an 'X' button, otherwise pop-up fades away automaticallytarget- the target to prepend the message pop-up to. If null, the message is shown in a global spot- Returns:
- action mapping string
-
returnMsgToUser
protected String returnMsgToUser(String url, String msg, JiraWebActionSupport.MessageType type, boolean closeable, @Nullable String target) This will redirect likereturnComplete(), and will also populate the response with the details of a pop-up message to be displayed on the redirected page. An appropriately configured client side control should perform the displaying of the message.- Parameters:
url- URL to redirect to. Not used in dialogsmsg- message HTMLtype- type of messagecloseable- if true, message pop-up has an 'X' button, otherwise pop-up fades away automaticallytarget- the target to prepend the message pop-up to. If null, the message is shown in a global spot- Returns:
- action mapping string
-
insertContextPath
Prepends the context path to the URL if it begins with a forward slash (this is commonly used for redirects within a JIRA instance).- Parameters:
url- a String containing a URL- Returns:
- a String with the context path prepended
-
addMessageToResponse
This will populate the the custom Atlassian header with the details of a pop-up message.- Parameters:
msg- message HTMLtype- type of message, see JIRA.Messages.Typescloseable- if true, message pop-up has an 'X' button, otherwise pop-up fades away automaticallytarget- the target to prepend the message pop-up to. If null, the message is shown in a global spot.
-
hasErrorMessage
-
hasErrorMessageByKey
-
addErrorMessageIfAbsent
-
addErrorMessageByKeyIfAbsent
-
tagMauEventWithApplication
-
tagMauEventWithProject
-
getHint
-
getRandomHint
-
getConglomerateCookieValue
Retrieve the value from a conglomerate Cookie from the request.- Parameters:
cookieName- The name of the conglomerate cookiekey- The key of the value- Returns:
- the value (or the empty-string if it did not exist)
-
setConglomerateCookieValue
Set the value key/value pair in a conglomerate Cookie.- Parameters:
cookieName- The name of the conglomerate cookiekey- The key of the valuevalue- The value
-
getRedirectSanitiser
Returns a RedirectSanitiser implementation.- Returns:
- a RedirectSanitiser
-
getErrorMessages
Description copied from interface:ErrorCollectionGet all non field-specific error messages.- Specified by:
getErrorMessagesin interfaceErrorCollection- Overrides:
getErrorMessagesin classwebwork.action.ActionSupport- Returns:
- Collection of error Strings.
-
getErrors
Description copied from interface:ErrorCollectionGet all field-specific errors.- Specified by:
getErrorsin interfaceErrorCollection- Overrides:
getErrorsin classwebwork.action.ActionSupport- Returns:
- Map of String: String pairs, eg. {"assignee": "Assignee is required"}
-
getKeysForPrefix
Description copied from interface:I18nHelperGiven a prefix for an i18n key, this method will return all keys that start with the prefix specified.- Specified by:
getKeysForPrefixin interfaceI18nHelper- Parameters:
prefix- The prefix for i18n keys. May not be null- Returns:
- An immutable set of translation keys that start with the prefix specified.
-
getDefaultResourceBundle
Description copied from interface:I18nHelperReturns the defaultResourceBundlewithin JIRA, which does not include translations provided by plugins. For use cases where non-English translations are required, callI18nHelper.getResourceBundle()instead.- Specified by:
getDefaultResourceBundlein interfaceI18nHelper- Returns:
- a non-null bundle
- See Also:
-
getUnescapedText
Description copied from interface:I18nHelperCalled to return the un-formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getUnescapedTextin interfaceI18nHelper- Parameters:
key- the key of the i18n message- Returns:
- the un-formatted, translated, text or the key itself if no i18n message can be found
-
getUntransformedRawText
Description copied from interface:I18nHelperSame asI18nHelper.getUnescapedText(String)but does not apply anyTranslationTransforms.- Specified by:
getUntransformedRawTextin interfaceI18nHelper- Parameters:
key- the key of the i18n message- Returns:
- the un-formatted text or the key itself if no i18n message can be found
-
isKeyDefined
Description copied from interface:I18nHelperFor the given key, checks whether such a key is defined in the locale context represented by this helper instance. Note that the actual translation may be in the 'fallback' default locale rather than the current locale.
The contract of this is method is correlated with
I18nHelper.getUntransformedRawText(String), whereby if this method returnsfalse,I18nHelper.getUntransformedRawText(String)will return the key provided as an argument, and if this method returnstrue,I18nHelper.getUntransformedRawText(String)will generally return the translation, which in some very unlikely cases may be equal to the key.- Specified by:
isKeyDefinedin interfaceI18nHelper- Parameters:
key- translation key- Returns:
true, if any translation for such key exists,falseotherwise
-
getResourceBundle
Description copied from interface:I18nHelperReturns the consolidated ResourceBundle for this I18nHelper, which includes translations provided by plugins.- Specified by:
getResourceBundlein interfaceI18nHelper- Returns:
- a non-null bundle
- See Also:
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Overrides:
getTextin classwebwork.action.ActionSupport- Parameters:
key- the key of the i18n message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the messagevalue6- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the messagevalue6- a value to be substituted into the messagevalue7- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the messagevalue6- a value to be substituted into the messagevalue7- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7, Object value8) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the messagevalue6- a value to be substituted into the messagevalue7- a value to be substituted into the messagevalue8- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9) Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messagevalue1- a value to be substituted into the messagevalue2- a value to be substituted into the messagevalue3- a value to be substituted into the messagevalue4- a value to be substituted into the messagevalue5- a value to be substituted into the messagevalue6- a value to be substituted into the messagevalue7- a value to be substituted into the messagevalue8- a value to be substituted into the messagevalue9- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Description copied from interface:I18nHelperCalled to return the formatted text of the specified i18n key or the key itself if no message can be found.The object passed in can be an array, a
List} or a single parameter object. It will be then used as substitution parameters within the message.- Specified by:
getTextin interfaceI18nHelper- Parameters:
key- the key of the i18n messageparameters- This can be an Array, aListand Array or a single object parameter- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getUserPreferences
public com.atlassian.core.user.preferences.Preferences getUserPreferences() -
getI18nHelper
- Returns:
- the
I18nHelperassociated with this action
-
getLocale
- Specified by:
getLocalein interfaceI18nHelper- Overrides:
getLocalein classwebwork.action.ActionSupport- Returns:
- the
Localethat is associated with this I18nHelper
-
isIndexing
public boolean isIndexing() -
removeKeyOrAddError
Checks if descriptorParams contains key and removes it, otherwise adds the error message with the given message key.- Parameters:
params- the map of parameterskey- the param key to remove.messageKey- the error.
-
execute
- Specified by:
executein interfacewebwork.action.Action- Overrides:
executein classwebwork.action.ActionSupport- Throws:
Exception
-
getActionName
- Overrides:
getActionNamein classwebwork.action.ActionSupport- Returns:
- The name of this action - the unqualified class name.
-
getActionNameJspa
- Returns:
- The name of this action - the unqualified class name.
-
getResult
Get a definitive result. ReturnsAction.ERRORif there are error messages, otherwiseAction.SUCCESS.- Returns:
Action.ERRORorAction.SUCCESS
-
addErrorMessages
Description copied from interface:ErrorCollectionAppend new error messages to those already collected.- Specified by:
addErrorMessagesin interfaceErrorCollection- Parameters:
errorMessages- Collection of error strings.
-
addErrors
Description copied from interface:ErrorCollectionAppend new field-specific errors to those already collected.- Specified by:
addErrorsin interfaceErrorCollection- Parameters:
errors- of String: String pairs, eg. {"assignee": "Assignee is required"}
-
hasAnyErrors
public boolean hasAnyErrors()Description copied from interface:ErrorCollectionWhether any errors (of any type - field-specific or otherwise) have been collected.- Specified by:
hasAnyErrorsin interfaceErrorCollection- Returns:
- true if any errors (of any type - field-specific or otherwise) have been collected.
-
addErrorMessages
public void addErrorMessages(webwork.dispatcher.ActionResult aResult) -
addIllegalArgumentException
Override this method from ActionSupport. Body is copied from there, with the exception of a clause that prevents JRA-7245- Specified by:
addIllegalArgumentExceptionin interfacewebwork.action.IllegalArgumentAware- Overrides:
addIllegalArgumentExceptionin classwebwork.action.ActionSupport
-
getOfBizDelegator
-
getComponentInstanceOfType
This can be called to get a component from theComponentAccessor. Override this if you wish to change this behaviour say in unit tests.- Parameters:
clazz- the component class in question- Returns:
- the component instance
-
getHttpRequest()instead.