Class AbstractIssueSelectAction
java.lang.Object
webwork.action.ActionSupport
com.atlassian.jira.web.action.JiraWebActionSupport
com.atlassian.jira.web.action.ProjectActionSupport
com.atlassian.jira.web.action.IssueActionSupport
com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
- All Implemented Interfaces:
ErrorCollection,I18nHelper,IssueSummaryAware,HttpServletVariables,AuthorizationSupport,Serializable,webwork.action.Action,webwork.action.CommandDriven,webwork.action.IllegalArgumentAware
- Direct Known Subclasses:
AbstractViewIssue,AttachTemporaryFile,CreateIssue,DeleteAttachment,DeleteComment,DeleteLink,DeleteRemoteIssueLink,EditLabels,ManageWatchers,SimpleWorkflowAction,ViewSubtaskFragmentAction,ViewVoters,VoteOrWatchIssue
public abstract class AbstractIssueSelectAction
extends IssueActionSupport
implements IssueSummaryAware
An abstract action that should be extended by any action which wants to 'select' an issue
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
JiraWebActionSupport.MessageTypeNested 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 TypeFieldDescriptionprotected Longstatic final StringThis is used by subclasses to indicate that the issue is not valid because the caller does not have permission to view it.static final StringFields inherited from class com.atlassian.jira.web.action.IssueActionSupport
attachmentManagerFields inherited from class com.atlassian.jira.web.action.ProjectActionSupport
projectManagerFields inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
ISSUE_NOT_FOUND_RESULT, log, PERMISSION_VIOLATION_RESULT, request, RETURN_URL_PARAMETER, savedFilters, SECURITY_BREACH_RESULTFields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessagesFields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOur terrible action hierarchy makes this call necessaryprotectedAbstractIssueSelectAction(SubTaskManager subTaskManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorMessage(String message) Add error message relating to system state (not field-specific).protected voidEnsures that the current issue is valid for the calling user.booleanbooleangetId()Get Id of current issue.org.ofbiz.core.entity.GenericValuegetIssue()Gets the current issue's GenericValue.Returns the currentIssue.protected MutableIssueThis can be called by sub class to read the current value of the issueObject variable WITHOUT causing a database readGets the relative path to the current issue.getKey()Get key of current issue.Get the default layout bean for most actions.Returns the parent of the currentIssueorg.ofbiz.core.entity.GenericValuegetSecurityLevel(Long id) protected SubTaskManagerThis is used by the issue summary decorator to add the left-hand side decoration.Gets the relative path to the current issue.booleanDetermines whether the current user can edit or resolve this issue.booleanisEditable(Issue issue) Determines whether the current user can edit or resolve an specified issue.booleanisHasEditIssuePermission(Issue issue) booleanbooleanIn comparison to isIssueExists() this method performs a permission check and returns true if the issue exists and the user has sufficient permissions.booleanDetermines whether the issue is a sub task - i.e.booleanTests whether the sub-tasks are turned on and whether the the current issue is a 'parent' issue, i.e.booleanisWorkflowAllowsEdit(Issue issue) protected Stringprotected IssueBecause some of the code works on the issueGV object (such as voting code) directly the issueObject variable representation can get out of synch with the underlying GVvoidSet the the current issue by its id.protected IssuesetIssueObject(Issue issueObject) Once this is called, the underlying issueGV and id and key will be updated to reflect the issue in play.voidSet current issue by its key.voidsetViewIssueKey(String viewIssueKey) Methods inherited from class com.atlassian.jira.web.action.IssueActionSupport
addIssueToHistory, getAttachmentManager, getCurrentDateTimeInUsersTimezone, getCurrentFailedLoginCount, getCurrentJQL, getCustomFieldManager, getDaysPerWeek, getEverLoggedIn, getFormToken, getHoursPerDay, getIssueManager, getLastFailedLogin, getLastLogin, getLoginCount, getPossibleVersions, getPossibleVersionsReleasedFirst, getPrettyDuration, getPreviousLogin, getSearchRequest, getSelectedIssueId, getSessionPagerFilterManager, getSessionSearchRequestManager, getSessionSearchRequestManagerFactory, getSessionSelectedIssueManager, getTotalFailedLoginCount, getUrlEncoded, getWorkflow, getWorkflowTransitionDescription, getWorkflowTransitionDisplayName, isCustomFieldHidden, isElevatedSecurityCheckRequired, isFieldHidden, isFieldHidden, isTimeTrackingEnabled, setFormToken, setSearchRequest, setSelectedIssueId, updateSearchRequestMethods inherited from class com.atlassian.jira.web.action.ProjectActionSupport
getBrowsableProjects, getSelectedProjectId, setSelectedProject, setSelectedProjectMethods inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
addError, addErrorCollection, addErrorMessage, addErrorMessageByKeyIfAbsent, addErrorMessageIfAbsent, addErrorMessages, addErrorMessages, addErrors, addIllegalArgumentException, addMessageToResponse, addReason, addReasons, checkIfUrlIsAllowed, execute, forceRedirect, getActionName, getAdministratorContactLink, getApplicationProperties, getAuthorizationSupport, getComponentInstanceOfType, getConglomerateCookieValue, getConstantsManager, getDateFormat, getDateTimeFormat, getDateTimeFormatter, getDefaultResourceBundle, getDescTranslation, getDescTranslation, getDmyDateFormatter, getEmptyResponse, getErrorMessages, getErrors, getField, getFlushedErrorMessages, getGlobalPermissionManager, getHint, getHintManager, getHttpRequest, getHttpResponse, getHttpSession, getI18nHelper, getJiraContactHelper, getJiraServiceContext, getKeysForPrefix, getLanguage, getLocale, getLoggedInApplicationUser, getLoggedInUser, getNameTranslation, getNameTranslation, getOfBizDelegator, getOutboundWhitelistProvider, getOutlookDate, getPermissionManager, getProjectManager, getRandomHint, getReasons, getRedirect, getRedirect, getRedirectSanitiser, getRequestSourceType, getResourceBundle, getResult, getReturnUrl, getReturnUrlForCancelLink, getSearchSortDescriptions, getSelectedProject, getSelectedProjectObject, getServerId, getServletContext, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTimeFormat, getUnescapedText, getUntransformedRawText, getUriValidator, getUserFullName, getUserManager, getUserPreferences, getUserProjectHistoryManager, getVersionManager, getWebworkStack, getWebworkStack, getXsrfToken, hasAnyErrors, hasErrorMessage, hasErrorMessageByKey, hasGlobalPermission, hasGlobalPermission, hasIssuePermission, hasIssuePermission, hasIssuePermission, hasPermission, hasProjectPermission, hasProjectPermission, htmlEncode, insertContextPath, isAdministrator, isIndexing, isInlineDialogMode, isKeyDefined, isSystemAdministrator, isUserExists, isUserExistsByKey, isUserExistsByName, removeKeyOrAddError, returnComplete, returnComplete, returnCompleteWithInlineRedirect, returnCompleteWithInlineRedirectAndMsg, returnCompleteWithInlineRedirectAndMsg, returnMsgToUser, returnMsgToUser, setConglomerateCookieValue, setInline, setReasons, setReturnUrl, setSelectedProjectId, tagMauEventWithApplication, tagMauEventWithProject, urlEncodeMethods inherited from class webwork.action.ActionSupport
addError, 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, setErrorMessagesMethods inherited from interface com.atlassian.jira.web.action.issue.IssueSummaryAware
getLoggedInApplicationUser
-
Field Details
-
ISSUE_PERMISSION_ERROR
This is used by subclasses to indicate that the issue is not valid because the caller does not have permission to view it.- See Also:
-
PREPOPULATED_ISSUE_OBJECT
-
id
-
-
Constructor Details
-
AbstractIssueSelectAction
protected AbstractIssueSelectAction()Our terrible action hierarchy makes this call necessary -
AbstractIssueSelectAction
-
-
Method Details
-
isIssueExists
public boolean isIssueExists() -
isIssueValid
public boolean isIssueValid()In comparison to isIssueExists() this method performs a permission check and returns true if the issue exists and the user has sufficient permissions. It will also add to this action's error messages if the issue does not exist of is not accessible.- Returns:
- true if the issue exists and the user has sufficient permissions otherwise false.
-
getIssue
@Nonnull public org.ofbiz.core.entity.GenericValue getIssue() throws IssueNotFoundException, IssuePermissionExceptionGets the current issue's GenericValue. This will perform a permission and existence check on the issue- Returns:
- A generic value which contains the data of the current issue.
- Throws:
IssuePermissionException- if the current user does not have permission to read the issueIssueNotFoundException- if the issue does not exist- See Also:
-
getIssueObject
Returns the currentIssue. This method performs the same security checks asgetIssue().- Returns:
- The current issue.
- Throws:
IssuePermissionException- if the current user does not have permission to read the issueIssueNotFoundException- if the issue does not exist- See Also:
-
getMutableIssue
@Nonnull public MutableIssue getMutableIssue() throws IssueNotFoundException, IssuePermissionException -
refreshIssueObject
Because some of the code works on the issueGV object (such as voting code) directly the issueObject variable representation can get out of synch with the underlying GVYou can call this method to refresh the issueObject back to the current issueGV value.
- Returns:
- a fresh IssueObject that is backed by the current issueGV object
-
getIssueObjectWithoutDatabaseRead
This can be called by sub class to read the current value of the issueObject variable WITHOUT causing a database readWe need this because the CreateIssue variants dont have an issue to read and use this mechanims to make the create happen. The code instatiates an empty unsaved MutableIssue on create and clone and the like.
This kinda sucks BUT here we are.
- Returns:
- the current value of the issueObject variable
-
getId
Get Id of current issue.- Returns:
- Integer Id, or null if issue not set
-
getKey
Get key of current issue.- Returns:
- Issue key, or null if not set
-
setIssueObject
Once this is called, the underlying issueGV and id and key will be updated to reflect the issue in play.- Parameters:
issueObject- the MutableIssue that has been created or read from the database- Returns:
- that same issue object
-
setId
Set the the current issue by its id.- Parameters:
id- Eg. fromIssue.getId()
-
setKey
Set current issue by its key.- Parameters:
key- Issue key.
-
getProject
-
getProjectObject
-
getSecurityLevel
- Throws:
Exception
-
getViewIssueKey
-
setViewIssueKey
-
redirectToView
- Throws:
Exception
-
getViewUrl
Gets the relative path to the current issue. It does not include thecontext path.- Returns:
- The relative path to the current issue.
-
getIssuePath
Gets the relative path to the current issue. It does not include thecontext path.- Returns:
- The relative path to the current issue.
-
isEditable
public boolean isEditable()Determines whether the current user can edit or resolve this issue.- Returns:
- whether the current user can edit or resolve this issue.
-
isEditable
Determines whether the current user can edit or resolve an specified issue.- Parameters:
issue- The issue in play.- Returns:
- whether the current user can edit or resolve an specified issue.
-
isHasEditIssuePermission
-
isWorkflowAllowsEdit
-
cameFromIssue
public boolean cameFromIssue() -
cameFromParent
public boolean cameFromParent() -
getSummaryIssue
This is used by the issue summary decorator to add the left-hand side decoration.- Specified by:
getSummaryIssuein interfaceIssueSummaryAware- Returns:
- The issue to display on the left hand side
-
getLayoutBean
Get the default layout bean for most actions. This will work for 99% of actions, but specific actions may want different views, and can override this method.- Specified by:
getLayoutBeanin interfaceIssueSummaryAware
-
getSubTaskManager
-
isSubTask
public boolean isSubTask()Determines whether the issue is a sub task - i.e. if it has any incoming sub-task issue links- Returns:
- whether the issue is a sub task.
-
isSubTaskCreatable
public boolean isSubTaskCreatable()Tests whether the sub-tasks are turned on and whether the the current issue is a 'parent' issue, i.e. it is not a sub-task, as we do not allow a sub-task hierarchy. Also test whether the user has CREATE issue permission for the current project. Sub-tasks are always created in the same project as its parent issue.Since 3.4, we also need to check whether the project has any sub-task issue types
-
getParentIssueObject
Returns the parent of the currentIssue- Returns:
- the parent issue object
-
addErrorMessage
Description copied from interface:ErrorCollectionAdd error message relating to system state (not field-specific).- Specified by:
addErrorMessagein interfaceErrorCollection- Overrides:
addErrorMessagein classwebwork.action.ActionSupport- Parameters:
message- Error message.
-
assertIssueIsValid
Ensures that the current issue is valid for the calling user. If it does not exist or the calling user does not have sufficient permissions, throws an exception.- Throws:
IssueNotFoundException- if the issue does not existIssuePermissionException- if the calling user does not have permission to view the issue- See Also:
-