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, Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.IllegalArgumentAware
Direct Known Subclasses:
AbstractAddPortlet, 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, Administrators, AssociateFieldToScreens, BugzillaImport, BulkEditUserGroups, CantBrowseCreatedIssue, CleanData, CloneWorkflow, ComponentBrowser, ConfigureCustomField, ConfigureFieldLayoutScheme, ConfigureFieldScreen, ConfigureIssueCache, ConfigureIssueTypeScreenScheme, ConfigurePortalPages, ConfirmInstallationWithLicense, ConfirmNewInstallationWithOldLicense, CreateDraftWorkflow, DateRangePicker, DeleteCustomField, DeleteLinkType, DeletePortalPage, DeletePortlet, DeleteWorkflowTransitions, DisableSubTasks, EditAnnouncementBanner, EditCustomField, EditFieldLayoutItemRendererConfirmation, EditIssueTypeScreenScheme, EditLinkType, EditListener, EditPortalPage, EditService, EditSubTaskIssueTypes, EditWorkflow, FavouriteFilters, FilterPickerPopup, ForgotPassword, FuncTestWriter, IconPicker, IDashboard, ImportWorkflow, IndexOptimize, IntegrityChecker, IssuePicker, JellyRunner, JiraSupportRequest, JiraWizardActionSupport, JiraXMLImport, LDAPConfigurer, ListEventTypes, ListWorkflows, Logout, MailQueueAdmin, MailServerActionSupport, ManageConfigurationScheme, ManageSubTasks, MantisImport, ProjectActionSupport, ProjectEmail, ProjectImportResultsAction, ProjectImportSelectBackup, ProjectImportSelectProject, ProjectImportSummary, PublishDraftWorkflow, RecentIssueHistory, ReleaseNote, RepositoryActionSupport, RestoreDefaultDashboard, SchedulerAdmin, SchemeToolsAction, SelectFieldLayoutScheme, SelectIssueTypeScreenScheme, SelectProjectCategory, SelectProjectRepository, SelectScreenScheme, SendBulkMail, SendTestMail, SessionTimeoutMessage, SetupLicense, SetupPortal, ShowConstantsHelp, Signup, TaskAdmin, TimeTrackingAdmin, VersionBrowser, ViewCustomFields, ViewGroup, ViewIssueTypeScreenSchemes, ViewLicense, ViewLinkTypes, ViewListeners, ViewLogging, ViewPlugins, ViewProjects, ViewSchemes, ViewServices, ViewSystemInfo, ViewTrustedApplications, ViewUserProjectRoles, ViewWorkflowXml, WikiRendererHelpAction, WikiRendererPreviewAction

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

Field Summary
static String ISSUE_NOT_FOUND_RESULT
           
static String PERMISSION_VIOLATION_RESULT
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  Collection savedFilters
           
protected  org.ofbiz.core.entity.GenericValue selectedProject
           
 
Fields inherited from class com.atlassian.jira.action.JiraActionSupport
log
 
Fields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessages
 
Fields inherited from interface com.atlassian.jira.util.I18nHelper
DEFAULT_RESOURCE_BUNDLE
 
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  String forceRedirect(String redirect)
          This method will force a server redirect.
 Map getAssignableUsers(org.ofbiz.core.entity.GenericValue entity)
           
 Map getAssignableUsers(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue issue)
           
protected  Collection getCachedGroups()
           
 ComponentManager getComponentManager()
           
 ConstantsManager getConstantsManager()
           
 String getDateFormat()
           
 String getDateTimeFormat()
           
 String getDescTranslation(org.ofbiz.core.entity.GenericValue issueConstantGV)
           
static ExternalLinkUtil getExternalLinkUtils()
           
 Field getField(String id)
           
 Collection getFlushedErrorMessages()
          Get error messages, then get rid of them.
protected  GlobalPermissionManager getGlobalPermissionManager()
           
 JiraServiceContext getJiraServiceContext()
          Provides a service context with the current user which contains this action as its ErrorCollection.
 String getLanguage()
           
 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)
           
 String getRedirect(String defaultUrl)
          Get a definitive result with a redirect upon success.
 User getRemoteUser()
           
 String getReturnUrl()
           
 List getSearchSortReverseDescriptions(SearchRequest searchRequest)
           
 org.ofbiz.core.entity.GenericValue getSelectedProject()
          Gets the "active" project.
 Project getSelectedProjectObject()
           
 String getServerId()
           
 String getText(String key)
          If called from a JSP page that is not associated with an action, look for key in the default JiraWebActionSupport.properties file
 String getTimeFormat()
           
 String getUserFullName(String username)
           
 VersionManager getVersionManager()
           
 String getWebworkStack()
          For debugging JSPs; prints the webwork stack.
 String getWebworkStack(String selected)
          For debugging JSPs; prints the webwork stack, highlighting the specified node.
 String htmlEncode(String encodeMe)
          Convenience instance method to call static utility from webwork EL.
 boolean isHasIssuePermission(int permissionsId, org.ofbiz.core.entity.GenericValue issue)
           
 boolean isHasIssuePermission(String permName, org.ofbiz.core.entity.GenericValue issue)
           
 boolean isHasPermission(int permissionsId)
           
 boolean isHasPermission(String permName)
           
 boolean isHasPermission(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(String permName, org.ofbiz.core.entity.GenericValue project)
           
 boolean isSystemAdministrator()
           
 boolean isUserExists(String username)
           
 void setReturnUrl(String returnUrl)
           
 void setSelectedProjectId(Long id)
           
 
Methods inherited from class com.atlassian.jira.action.JiraActionSupport
addErrorMessages, addErrorMessages, addErrors, addIllegalArgumentException, execute, getActionName, getApplicationProperties, getDefaultResourceBundle, getDelegator, getJiraLocaleUtils, getLocale, getResult, getText, getText, getText, getText, getText, getText, getUnescapedText, getUserPreferences, getWatcherManager, hasAnyErrors, isEnterprise, isIndexing, isProfessional, isProfessionalOrEnterprise, isStandard, removeKeyOrAddError
 
Methods inherited from class webwork.action.ActionSupport
addError, addErrorMessage, doDefault, doExecute, doValidation, 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
setCommand
 

Field Detail

PERMISSION_VIOLATION_RESULT

public static final String PERMISSION_VIOLATION_RESULT
See Also:
Constant Field Values

ISSUE_NOT_FOUND_RESULT

public static final String ISSUE_NOT_FOUND_RESULT
See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request

savedFilters

protected Collection savedFilters

selectedProject

protected org.ofbiz.core.entity.GenericValue selectedProject
Constructor Detail

JiraWebActionSupport

public JiraWebActionSupport()
Method Detail

getRemoteUser

public User getRemoteUser()
Specified by:
getRemoteUser in class JiraActionSupport

getRedirect

public String getRedirect(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 String forceRedirect(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(String permName)

isHasPermission

public boolean isHasPermission(int permissionsId)

isHasIssuePermission

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

isHasIssuePermission

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

isHasProjectPermission

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

isHasProjectPermission

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

isHasPermission

public boolean isHasPermission(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()

getCachedGroups

protected Collection getCachedGroups()

getConstantsManager

public ConstantsManager getConstantsManager()

isUserExists

public boolean isUserExists(String username)

getUserFullName

public String getUserFullName(String username)

getAssignableUsers

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

getAssignableUsers

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

getProjectManager

public ProjectManager getProjectManager()

getVersionManager

public VersionManager getVersionManager()

getText

public String getText(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(String id)

getSearchSortReverseDescriptions

public List getSearchSortReverseDescriptions(SearchRequest searchRequest)

getComponentManager

public ComponentManager getComponentManager()

getOutlookDate

public OutlookDate getOutlookDate()

getNameTranslation

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

getDescTranslation

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

getReturnUrl

public String getReturnUrl()

setReturnUrl

public void setReturnUrl(String returnUrl)

getFlushedErrorMessages

public Collection 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 String getLanguage()
                   throws IOException
Throws:
IOException

getSelectedProjectObject

public Project getSelectedProjectObject()
                                 throws PermissionException
Throws:
PermissionException

getSelectedProject

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

Returns:
GenericValue as a project
Throws:
PermissionException - if has no permission to browse selected project

setSelectedProjectId

public void setSelectedProjectId(Long id)

getDateFormat

public String getDateFormat()

getDateTimeFormat

public String getDateTimeFormat()

getTimeFormat

public String getTimeFormat()

getExternalLinkUtils

public static ExternalLinkUtil getExternalLinkUtils()

getWebworkStack

public String getWebworkStack(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 String getWebworkStack()
For debugging JSPs; prints the webwork stack. Eg. called with:

Returns:
HTML string of the webwork stack

getServerId

public 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 String htmlEncode(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.


Copyright © 2002-2009 Atlassian. All Rights Reserved.