com.atlassian.jira.issue.fields
Class AbstractOrderableField

java.lang.Object
  extended by com.atlassian.jira.issue.fields.AbstractField
      extended by com.atlassian.jira.issue.fields.AbstractOrderableField
All Implemented Interfaces:
Field, OrderableField, SearchableField, Comparable
Direct Known Subclasses:
AbstractOrderableNavigableFieldImpl, AttachmentSystemField, CommentSystemField, IssueLinksSystemField, TimeTrackingSystemField, WorklogSystemField

public abstract class AbstractOrderableField
extends AbstractField
implements OrderableField


Field Summary
 
Fields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContext
 
Fields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH
 
Constructor Summary
AbstractOrderableField(String id, String name, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, SearchHandlerFactory searcherHandlerFactory)
           
 
Method Summary
 SearchHandler createAssociatedSearchHandler()
          Return SearchHandler for the field.
protected  ApplicationProperties getApplicationProperties()
           
 String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters)
          Returns HTML that should be shown when the issue is being bulk edited.
 String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
          Returns the HTML that should be shown when the issue is being created.
 String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
          Returns HTML that should be shown when the issue is being edited.
protected  PermissionManager getPermissionManager()
           
protected abstract  Object getRelevantParams(Map params)
           
protected  Map<String,Object> getVelocityParams(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParams)
           
protected  Map<String,Object> getVelocityParams(Issue issue)
           
 String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
           
protected  boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean, Issue issue)
           
 boolean hasParam(Map parameters)
          Basic implementation where the relevant params object is null if no elements are present.
protected  boolean hasPermission(Issue issue, int permissionId)
           
protected  boolean isHidden(Collection<FieldLayout> fieldLayouts)
          Determines if the field is hidden in at least one field layout.
 void populateFromParams(Map fieldValuesHolder, Map parameters)
          Populate the fieldValuesHolder with a value from (web) parameters.
protected  boolean rendererTypesEqual(String oldRendererType, String newRendererType)
           
protected  String renderTemplate(String template, Map<String,Object> velocityParams)
           
protected  boolean valuesEqual(Object value, Object currentValue)
           
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractField
compareTo, equals, getAuthenticationContext, getId, getName, getNameKey, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.fields.OrderableField
availableForBulkEdit, canRemoveValueFromIssueObject, createValue, getCreateHtml, getDefaultValue, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, hasValue, isShown, needsMove, populateDefaults, populateForMove, populateFromIssue, populateParamsFromString, removeValueFromIssueObject, updateIssue, updateValue, validateParams
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractOrderableField

public AbstractOrderableField(String id,
                              String name,
                              VelocityTemplatingEngine templatingEngine,
                              ApplicationProperties applicationProperties,
                              JiraAuthenticationContext authenticationContext,
                              PermissionManager permissionManager,
                              SearchHandlerFactory searcherHandlerFactory)
Method Detail

getCreateHtml

public String getCreateHtml(FieldLayoutItem fieldLayoutItem,
                            OperationContext operationContext,
                            webwork.action.Action action,
                            Issue issue)
Description copied from interface: OrderableField
Returns the HTML that should be shown when the issue is being created.

Specified by:
getCreateHtml in interface OrderableField
Parameters:
fieldLayoutItem - FieldLayoutItem
operationContext - OperationContext
action - Action
issue - Issue
Returns:
the HTML that should be shown when the issue is being created.

getEditHtml

public String getEditHtml(FieldLayoutItem fieldLayoutItem,
                          OperationContext operationContext,
                          webwork.action.Action action,
                          Issue issue)
Description copied from interface: OrderableField
Returns HTML that should be shown when the issue is being edited.

Specified by:
getEditHtml in interface OrderableField
Parameters:
fieldLayoutItem - FieldLayoutItem
operationContext - OperationContext
action - Action
issue - Issue
Returns:
HTML that should be shown when the issue is being edited.

createAssociatedSearchHandler

public SearchHandler createAssociatedSearchHandler()
Description copied from interface: SearchableField
Return SearchHandler for the field. This object tells JIRA how to search for values within the field.

Specified by:
createAssociatedSearchHandler in interface SearchableField
Returns:
the SearchHandler associated with the field. Can return null when no searcher is associated with the field. This will mainly happen when a customfield is configured to have no searcher.

getBulkEditHtml

public String getBulkEditHtml(OperationContext operationContext,
                              webwork.action.Action action,
                              BulkEditBean bulkEditBean,
                              Map displayParameters)
Returns HTML that should be shown when the issue is being bulk edited. By default calls the OrderableField.getEditHtml(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.customfields.OperationContext, webwork.action.Action, com.atlassian.jira.issue.Issue, java.util.Map) method with null for FieldLayoutItem and the first issue in the collection}

Specified by:
getBulkEditHtml in interface OrderableField
Parameters:
operationContext - OperationContext
action - Action
bulkEditBean - BulkEditBean
displayParameters - Map of display parameters.
Returns:
HTML that should be shown when the issue is being edited.

getViewHtml

public String getViewHtml(FieldLayoutItem fieldLayoutItem,
                          webwork.action.Action action,
                          Issue issue)
Specified by:
getViewHtml in interface OrderableField

hasParam

public boolean hasParam(Map parameters)
Basic implementation where the relevant params object is null if no elements are present. Some fields need to override this because of their innate complex behaviour.

Specified by:
hasParam in interface OrderableField
Parameters:
parameters - Map of parameters.
Returns:
True if a relevant parameter is available in the input.

populateFromParams

public void populateFromParams(Map fieldValuesHolder,
                               Map parameters)
Description copied from interface: OrderableField
Populate the fieldValuesHolder with a value from (web) parameters.

Specified by:
populateFromParams in interface OrderableField
Parameters:
fieldValuesHolder - The fieldValuesHolder Map to be populated.
parameters - Map of parameters.

renderTemplate

protected String renderTemplate(String template,
                                Map<String,Object> velocityParams)

getApplicationProperties

protected ApplicationProperties getApplicationProperties()

getRelevantParams

protected abstract Object getRelevantParams(Map params)

getVelocityParams

protected Map<String,Object> getVelocityParams(FieldLayoutItem fieldLayoutItem,
                                               webwork.action.Action action,
                                               Issue issue,
                                               Map displayParams)

getVelocityParams

protected Map<String,Object> getVelocityParams(Issue issue)

valuesEqual

protected boolean valuesEqual(Object value,
                              Object currentValue)

isHidden

protected boolean isHidden(Collection<FieldLayout> fieldLayouts)
Determines if the field is hidden in at least one field layout.

Parameters:
fieldLayouts - the field layouts to check
Returns:
true if the field is hidden in at least one of the passed field layouts, false otherwise

rendererTypesEqual

protected boolean rendererTypesEqual(String oldRendererType,
                                     String newRendererType)

hasPermission

protected boolean hasPermission(Issue issue,
                                int permissionId)

hasBulkUpdatePermission

protected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean,
                                          Issue issue)

getPermissionManager

protected PermissionManager getPermissionManager()


Copyright © 2002-2013 Atlassian. All Rights Reserved.