Package com.atlassian.jira.issue.fields
Class AbstractOrderableField<V>
java.lang.Object
com.atlassian.jira.issue.fields.AbstractField
com.atlassian.jira.issue.fields.AbstractOrderableField<V>
- All Implemented Interfaces:
Field
,OrderableField<V>
,SearchableField
,Comparable
- Direct Known Subclasses:
AbstractOrderableNavigableFieldImpl
,ArchivedDateSystemField
,ArchivedUserSystemField
,AttachmentSystemField
,CommentSystemField
,IssueLinksSystemField
,TimeTrackingSystemField
,WorklogSystemField
-
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
ConstructorsConstructorDescriptionAbstractOrderableField
(String id, String name, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager) AbstractOrderableField
(String id, String name, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, SearchHandlerFactory searcherHandlerFactory) -
Method Summary
Modifier and TypeMethodDescriptionReturnSearchHandler
for the field.protected ApplicationProperties
getBulkEditHtml
(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters) Returns HTML that should be shown when the issue is being bulk edited.getCreateHtml
(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Returns the HTML that should be shown when the issue is being created.getEditHtml
(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Returns HTML that should be shown when the issue is being edited.protected FieldLayoutItem
getFieldLayoutItemForBulkOperation
(BulkEditBean bulkEditBean) protected Issue
getIssueForBulkOperation
(BulkEditBean bulkEditBean) protected PermissionManager
protected abstract Object
getRelevantParams
(Map<String, String[]> params) getVelocityParams
(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParams) getVelocityParams
(Issue issue) getVelocityParams
(Map<String, Object> displayParams) getViewHtml
(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue) protected boolean
hasBulkUpdatePermission
(BulkEditBean bulkEditBean, Issue issue) boolean
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
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 void
validateBulkEditHtmlProperties
(BulkEditBean bulkEditBean) 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 java.lang.Comparable
compareTo
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
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
-
Constructor Details
-
AbstractOrderableField
public AbstractOrderableField(String id, String name, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager) -
AbstractOrderableField
public AbstractOrderableField(String id, String name, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, SearchHandlerFactory searcherHandlerFactory)
-
-
Method Details
-
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 interfaceOrderableField<V>
- Parameters:
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- 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 interfaceOrderableField<V>
- Parameters:
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- Issue- Returns:
- HTML that should be shown when the issue is being edited.
-
createAssociatedSearchHandler
Description copied from interface:SearchableField
ReturnSearchHandler
for the field. This object tells JIRA how to search for values within the field.- Specified by:
createAssociatedSearchHandler
in interfaceSearchableField
- 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 theOrderableField.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 forFieldLayoutItem
and the first issue in the collection}- Specified by:
getBulkEditHtml
in interfaceOrderableField<V>
- Parameters:
operationContext
- OperationContextaction
- ActionbulkEditBean
- BulkEditBeandisplayParameters
- Map of display parameters.- Returns:
- HTML that should be shown when the issue is being edited.
-
validateBulkEditHtmlProperties
-
getFieldLayoutItemForBulkOperation
-
getIssueForBulkOperation
-
getViewHtml
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue) - Specified by:
getViewHtml
in interfaceOrderableField<V>
-
hasParam
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 interfaceOrderableField<V>
- Parameters:
parameters
- Map of parameters.- Returns:
- True if a relevant parameter is available in the input.
-
populateFromParams
public void populateFromParams(Map<String, Object> fieldValuesHolder, Map<String, String[]> parameters) Description copied from interface:OrderableField
Populate the fieldValuesHolder with a value from (web) parameters.- Specified by:
populateFromParams
in interfaceOrderableField<V>
- Parameters:
fieldValuesHolder
- The fieldValuesHolder Map to be populated.parameters
- Map of HTTP parameters.
-
renderTemplate
-
getApplicationProperties
-
getRelevantParams
-
getVelocityParams
-
getVelocityParams
-
getVelocityParams
-
valuesEqual
-
isHidden
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
-
hasPermission
-
hasBulkUpdatePermission
-
getPermissionManager
-