com.atlassian.jira.issue.fields
Class SummarySystemField

java.lang.Object
  extended by com.atlassian.jira.issue.fields.AbstractField
      extended by com.atlassian.jira.issue.fields.AbstractOrderableField
          extended by com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
              extended by com.atlassian.jira.issue.fields.AbstractTextSystemField
                  extended by com.atlassian.jira.issue.fields.SummarySystemField
All Implemented Interfaces:
Field, MandatoryField, NavigableField, OrderableField, RenderableField, SearchableField, java.lang.Comparable

public class SummarySystemField
extends AbstractTextSystemField
implements NavigableField, MandatoryField

Copyright (c) 2002-2004 All rights reserved.


Field Summary
static java.lang.Long MAX_LEN
           
 
Fields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContext
 
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
 
Fields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH
 
Constructor Summary
SummarySystemField(com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, SummarySearchHandlerFactory searchHandlerFactory)
           
 
Method Summary
 java.lang.String availableForBulkEdit(BulkEditBean bulkEditBean)
          Determines whether the field is available for bulk editing given the BulkEditBean.
 boolean canRemoveValueFromIssueObject(Issue issue)
          Returns true if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.
 java.lang.String getColumnHeadingKey()
           
protected  java.lang.String getColumnViewTemplateName()
           
 java.lang.String getDefaultSortOrder()
          The order in which to sort the field when it is sorted for the first time.
 java.lang.Object getDefaultValue(Issue issue)
          The value that should be set on the issue if the field is not shown for some reason.
protected  java.lang.String getEditTemplateName()
           
 LuceneFieldSorter getSorter()
          A sorter to be used when sorting columns in a table.
 java.lang.String getValueFromIssue(Issue issue)
          Gets the value stored for this field on the provided issue.
 boolean isRenderable()
          Defines if a field determines itself as renderable.
 boolean isShown(Issue issue)
          Tests field specific way to determine if it should be shown or not.
 void populateFromIssue(java.util.Map fieldValuesHolder, Issue issue)
          Used to initialise the fieldValuesHolder from the current value of teh issue.
protected  void populateVelocityParams(FieldLayoutItem fieldLayoutItem, Issue issue, java.util.Map params)
           
protected  void populateVelocityParams(java.util.Map fieldValuesHolder, java.util.Map params)
           
 void removeValueFromIssueObject(MutableIssue issue)
          Removes the field value from the given MutableIssue object.
 void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, java.util.Map fieldValueHolder)
          Record the value on the issue (not saving it to the database, see updateValue).
 void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
          validate the field value
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractTextSystemField
createValue, getChangeLogFieldName, getChangelogValue, getColumnViewHtml, getCreateHtml, getEditHtml, getRelevantParams, getValueFromParams, getViewHtml, getViewHtml, hasValue, isInvertCollapsedState, needsMove, populateDefaults, populateForMove, populateParamsFromString, updateValue, valuesEqual
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
getColumnCssClass, getHiddenFieldId, getSortComparatorSource, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistory
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableField
createAssociatedSearchHandler, getApplicationProperties, getBulkEditHtml, getCreateHtml, getEditHtml, getPermissionManager, getVelocityParams, getVelocityParams, getViewHtml, hasBulkUpdatePermission, hasPermission, isHidden, populateFromParams, rendererTypesEqual, renderTemplate, valuesEqual
 
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.NavigableField
getColumnCssClass, getColumnViewHtml, getHiddenFieldId, getSortComparatorSource, prettyPrintChangeHistory, prettyPrintChangeHistory
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.atlassian.jira.issue.fields.renderer.RenderableField
getId
 

Field Detail

MAX_LEN

public static final java.lang.Long MAX_LEN
Constructor Detail

SummarySystemField

public SummarySystemField(com.atlassian.velocity.VelocityManager velocityManager,
                          ApplicationProperties applicationProperties,
                          JiraAuthenticationContext authenticationContext,
                          RendererManager rendererManager,
                          PermissionManager permissionManager,
                          SummarySearchHandlerFactory searchHandlerFactory)
Method Detail

getEditTemplateName

protected java.lang.String getEditTemplateName()
Specified by:
getEditTemplateName in class AbstractTextSystemField

getColumnViewTemplateName

protected java.lang.String getColumnViewTemplateName()
Specified by:
getColumnViewTemplateName in class AbstractTextSystemField

populateVelocityParams

protected void populateVelocityParams(java.util.Map fieldValuesHolder,
                                      java.util.Map params)
Overrides:
populateVelocityParams in class AbstractTextSystemField

populateVelocityParams

protected void populateVelocityParams(FieldLayoutItem fieldLayoutItem,
                                      Issue issue,
                                      java.util.Map params)
Overrides:
populateVelocityParams in class AbstractTextSystemField

getValueFromIssue

public java.lang.String getValueFromIssue(Issue issue)
Description copied from interface: RenderableField
Gets the value stored for this field on the provided issue.

Specified by:
getValueFromIssue in interface RenderableField
Specified by:
getValueFromIssue in class AbstractTextSystemField
Parameters:
issue - identifies the issue that will contain the value for this field.
Returns:
the value stored on this issue for this field, null if not applicable.

updateIssue

public void updateIssue(FieldLayoutItem fieldLayoutItem,
                        MutableIssue issue,
                        java.util.Map fieldValueHolder)
Description copied from interface: OrderableField
Record the value on the issue (not saving it to the database, see updateValue).

Specified by:
updateIssue in interface OrderableField
Parameters:
fieldLayoutItem - FieldLayoutItem
issue - MutableIssue
fieldValueHolder - Field Value Holder Map
See Also:
OrderableField.updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.ModifiedValue, com.atlassian.jira.issue.util.IssueChangeHolder)

removeValueFromIssueObject

public void removeValueFromIssueObject(MutableIssue issue)
Description copied from interface: OrderableField
Removes the field value from the given MutableIssue object.

Note that this operation does not actually persist the change, it just clears the value from the given Issue object. The caller will still need to call #updateValue() in order to persist the change.

Some Fields may choose to quietly ignore this request. eg The SecurityLevel Field will not remove Security Level from subtasks because the subtask must always take the Security Level of its parent issue.

Specified by:
removeValueFromIssueObject in interface OrderableField
Parameters:
issue - The issue object to be effected.
See Also:
OrderableField.canRemoveValueFromIssueObject(com.atlassian.jira.issue.Issue), OrderableField.updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.ModifiedValue, com.atlassian.jira.issue.util.IssueChangeHolder)

canRemoveValueFromIssueObject

public boolean canRemoveValueFromIssueObject(Issue issue)
Description copied from interface: OrderableField
Returns true if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.

There a few different reasons why this method may return false:

In general it is safe to call removeValueFromIssueObject() even if this method returns false, as the request will be silently ignored. However there are a couple of special fields where calling removeValueFromIssueObject() will throw an UnsupportedOperationException - eg if you try to remove the Project.

Specified by:
canRemoveValueFromIssueObject in interface OrderableField
Parameters:
issue - The Issue object.
Returns:
true if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.
See Also:
OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)

populateFromIssue

public void populateFromIssue(java.util.Map fieldValuesHolder,
                              Issue issue)
Description copied from interface: OrderableField
Used to initialise the fieldValuesHolder from the current value of teh issue. Used, for example, when showing teh Edit Issue screen to show the issue's current values.

Specified by:
populateFromIssue in interface OrderableField
Overrides:
populateFromIssue in class AbstractTextSystemField
Parameters:
fieldValuesHolder - The fieldValuesHolder Map to be populated.
issue - The Issue.

isShown

public boolean isShown(Issue issue)
Description copied from interface: OrderableField
Tests field specific way to determine if it should be shown or not.

Specified by:
isShown in interface OrderableField
Parameters:
issue - The Issue.
Returns:
true if it should be shown.

validateParams

public void validateParams(OperationContext operationContext,
                           ErrorCollection errorCollectionToAddTo,
                           I18nHelper i18n,
                           Issue issue,
                           FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
validate the field value

Specified by:
validateParams in interface OrderableField
Parameters:
operationContext - OperationContext
errorCollectionToAddTo - ErrorCollection
i18n - I18nHelper
issue - Issue
fieldScreenRenderLayoutItem - FieldScreenRenderLayoutItem

getDefaultValue

public java.lang.Object getDefaultValue(Issue issue)
Description copied from interface: OrderableField
The value that should be set on the issue if the field is not shown for some reason.

For example: The user does not have permission to see the field, or the field is not part of the create screen.

Specified by:
getDefaultValue in interface OrderableField
Parameters:
issue - the Issue.
Returns:
The default Value.

getColumnHeadingKey

public java.lang.String getColumnHeadingKey()
Specified by:
getColumnHeadingKey in interface NavigableField

getDefaultSortOrder

public java.lang.String getDefaultSortOrder()
Description copied from interface: NavigableField
The order in which to sort the field when it is sorted for the first time.

Specified by:
getDefaultSortOrder in interface NavigableField
Returns:
Either NavigableField.ORDER_ASCENDING or NavigableField.ORDER_DESCENDING

getSorter

public LuceneFieldSorter getSorter()
Description copied from interface: NavigableField
A sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.

Specified by:
getSorter in interface NavigableField
Returns:
A sorter that can be used to sort this field, or null depending on the value of NavigableField.getSortComparatorSource()
See Also:
DocumentIssueImpl, MappedSortComparator

isRenderable

public boolean isRenderable()
Description copied from interface: RenderableField
Defines if a field determines itself as renderable. This is needed because of the way that customfields are implemented. Since all the real work is done in CustomFieldTypes, if we want to treat system fields and custom fields the same way in the renderers then all custom fields must implement this interface. We therefore provide this method so that the CustomFieldImpl can delegate to the CustomFieldTypes to determine if a given custom field is renderable.

Specified by:
isRenderable in interface RenderableField
Overrides:
isRenderable in class AbstractTextSystemField
Returns:
true if the field is renderable, false otherwise.

availableForBulkEdit

public java.lang.String availableForBulkEdit(BulkEditBean bulkEditBean)
Description copied from interface: OrderableField
Determines whether the field is available for bulk editing given the BulkEditBean.

Specified by:
availableForBulkEdit in interface OrderableField
Parameters:
bulkEditBean - holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)
Returns:
null if the field is available for bulk-editing or an i18n key of the error message to show as why the field is not available.


Copyright © 2002-2010 Atlassian. All Rights Reserved.