com.atlassian.jira.issue.fields
Class CustomFieldImpl

java.lang.Object
  extended bycom.atlassian.jira.issue.fields.CustomFieldImpl
All Implemented Interfaces:
Comparable, ConfigurableField, CustomField, Field, HideableField, NavigableField, OrderableField, RenderableField, RequirableField, SearchableField

public class CustomFieldImpl
extends Object
implements CustomField

Default CustomField implementation backed by the database (a GenericValue object). Usually managed via CustomFieldManager.

Remember to call store() after calling any setter methods.


Field Summary
static String ENTITY_CF_TYPE_KEY
           
static String ENTITY_CUSTOM_FIELD_SEARCHER
           
static String ENTITY_DESCRIPTION
           
static String ENTITY_ID
           
static String ENTITY_ISSUETYPE
           
static String ENTITY_NAME
           
static String ENTITY_PROJECT
           
static String ENTITY_TABLE_NAME
           
 
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
CustomFieldImpl(org.ofbiz.core.entity.GenericValue customField, CustomFieldManager customFieldManager, JiraAuthenticationContext authenticationContext, ConstantsManager constantsManager, FieldConfigSchemeManager fieldConfigSchemeManager, PermissionManager permissionManager, RendererManager rendererManager)
           
 
Method Summary
protected static boolean areDifferent(Object obj1, Object obj2)
          Compare two objects - return false if both are null or equal.
 String availableForBulkEdit(BulkEditBean bulkEditBean)
          Determines whether the field is available for bulk editing given the BulkEditBean.
 int compare(Issue issue1, Issue issue2)
           
 int compareTo(Object o)
           
 void createValue(Issue issue, Object value)
          Create the value of the issue in the data store.
 boolean equals(Object o)
           
 List getAssociatedIssueTypes()
          Returns a list of issue types associated with this project.
 List getAssociatedProjectCategories()
           
 List getAssociatedProjects()
          Returns a list of projects associated with this project.
 List getAssociatedSearchers()
          Returns a list of searchers associated with field
 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 getColumnCssClass()
           
 String getColumnHeadingKey()
           
 String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
           
 List getConfigurationItemTypes()
          Returns a List of FieldConfigItemType objects.
 List getConfigurationSchemes()
           
 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 getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
          Returns the HTML that should be shown when the issue is being created
 CustomFieldSearcher getCustomFieldSearcher()
           
 CustomFieldType getCustomFieldType()
           
 CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
          Get the custom field string values that are relevant to this particular custom field
 String getDefaultSortOrder()
          The order in which to sort the field when it is sorted for the first time.
 Object getDefaultValue(Issue issue)
          The value that should be set on the issue if the field is not shown for some reason.
 String getDescription()
           
 String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
          Returns HTML that should be shown when the issue is being edited
 String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
          Returns HTML that should be shown when the issue is being edited
 FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
           
 org.ofbiz.core.entity.GenericValue getGenericValue()
          Deprecated.  
 String getHiddenFieldId()
          Returns the id of the field to check for visibility.
protected  I18nHelper getI18nHelper()
           
 String getId()
          Returns the identifier for this RenderableField.
 Long getIdAsLong()
           
 String getName()
          Returns i18n'ed name of the field for system fields or the name of a custom field.
 String getNameKey()
          The i18n key that is used to lookup the field's name when it is displayed
 Options getOptions(String key, FieldConfig config, JiraContextNode contextNode)
           
 Options getOptions(String key, JiraContextNode jiraContextNode)
          A list of the available options for this custom field.
 FieldConfig getRelevantConfig(Issue issue)
          Returns the field configuration applying to this field in the specified issue.
 FieldConfig getRelevantConfig(IssueContext issueContext)
           
protected  CustomFieldParams getRelevantParams(Map params)
           
 FieldConfig getReleventConfig(SearchContext searchContext)
          The FieldConfig that is relevent to all issue contexts in the search context
 org.apache.lucene.search.SortComparatorSource getSortComparatorSource()
          Return a SortComparatorSource that uses either a custom field searcher that implements SortableCustomFieldSearcher or a custom field that implements SortableCustomField.
 LuceneFieldSorter getSorter()
          If this field has a searcher, and this searcher implements SortableCustomFieldSearcher then return SortableCustomFieldSearcher.getSorter(CustomField).
 Object getValue(Issue issue)
          As far as I can tell - this is just an object that contains the value of a custom field, so that it can be passed around.
 String getValueFromIssue(Issue issue)
          Gets the value stored for this field on the provided issue.
 Object getValueFromParams(Map params)
          Get a field value from the map of parameters passed.
 String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
           
 String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters)
           
 String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters)
           
protected  boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean, Issue issue)
          Checks whether the user has the permission to execute the bulk operation for the provied issue.
 int hashCode()
           
 boolean hasValue(Issue issue)
          Determines if the field has a value for the given issue.
 boolean isAllIssueTypes()
           
 boolean isAllProjects()
           
 boolean isEditable()
           
 boolean isEnabled()
          Returns if the custom field is enabled for any issue type / projects
 boolean isGlobal()
          Returns true if the custom field applies for all projects and all issue types
 boolean isInScope(User remoteUser, org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
          Determines if the custom field based on the entities passed (project or issue type) If intities is null the method will not check whether the field is hidden for any entities but return false (unless it has been manually hidden).
 boolean isInScope(User user, SearchContext searchContext)
           
 boolean isRenderable()
          This is the conjunction point with CustomFieldTypes and this is delegated off to customField Types.
 boolean isShown(Issue issue)
          Tests field specific way to determine if it should be shown or not
 MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
          Used to determine if the field needs input from user to be moved to the new project and/or issue type.
 void populateDefaults(Map customFieldValuesHolder, Issue issue)
          Populate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet
 void populateForMove(Map fieldValuesHolder, Issue originalIssue, Issue targetIssue)
          Used to populate the fieldValueHolder with parameters for move issue screen.
 void populateFromIssue(Map customFieldValuesHolder, Issue issue)
          Used to initialise the fieldValuesHolder from the current value of teh issue.
 void populateFromParams(Map customFieldValuesHolder, Map params)
          Populate the fieldValuesHolder with a value from (web) parameters
 void populateParamsFromString(Map fieldValuesHolder, String stringValue, Issue issue)
          Used to convert from a user friendly string value and put the result into the fieldValuesHolder.
 String prettyPrintChangeHistory(String changeHistory)
           
 String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
          Used for email notification templates - allows changelog to be displayed in language of the recipient.
 Set remove()
          return set of issues affected
 void removeValue(MutableIssue issue)
          Removes the value for the given issue.
 void setConfigurationSchemes(List configurationSchemes)
           
 void setCustomFieldSearcher(CustomFieldSearcher searcher)
           
 void setDescription(String description)
           
 void setName(String name)
           
 void store()
           
 String toString()
           
 void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
          Record the value on the issue (not saving it to the database, see updateValue)
 void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
          Update the issue in the data store
 void validateFromActionParams(Map params, ErrorCollection errorCollection, FieldConfig config)
           
 void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
          Ensure that the parameters are valid
(package private)  boolean valuesEqual(Object v1, Object v2)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ENTITY_CF_TYPE_KEY

public static final String ENTITY_CF_TYPE_KEY
See Also:
Constant Field Values

ENTITY_CUSTOM_FIELD_SEARCHER

public static final String ENTITY_CUSTOM_FIELD_SEARCHER
See Also:
Constant Field Values

ENTITY_NAME

public static final String ENTITY_NAME
See Also:
Constant Field Values

ENTITY_ISSUETYPE

public static final String ENTITY_ISSUETYPE
See Also:
Constant Field Values

ENTITY_PROJECT

public static final String ENTITY_PROJECT
See Also:
Constant Field Values

ENTITY_ID

public static final String ENTITY_ID
See Also:
Constant Field Values

ENTITY_DESCRIPTION

public static final String ENTITY_DESCRIPTION
See Also:
Constant Field Values

ENTITY_TABLE_NAME

public static final String ENTITY_TABLE_NAME
See Also:
Constant Field Values
Constructor Detail

CustomFieldImpl

public CustomFieldImpl(org.ofbiz.core.entity.GenericValue customField,
                       CustomFieldManager customFieldManager,
                       JiraAuthenticationContext authenticationContext,
                       ConstantsManager constantsManager,
                       FieldConfigSchemeManager fieldConfigSchemeManager,
                       PermissionManager permissionManager,
                       RendererManager rendererManager)
Method Detail

store

public void store()
Specified by:
store in interface CustomField

isInScope

public boolean isInScope(User remoteUser,
                         org.ofbiz.core.entity.GenericValue project,
                         List issueTypeIds)
Determines if the custom field based on the entities passed (project or issue type) If intities is null the method will not check whether the field is hidden for any entities but return false (unless it has been manually hidden). If entities is an empty list the method will return false only if the field is a global custom field.

Specified by:
isInScope in interface CustomField
Parameters:
issueTypeIds - Eg ["1", "2"] for Bugs and New Features

getFirstRelevantConfig

public FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project,
                                          List issueTypeIds)
Specified by:
getFirstRelevantConfig in interface CustomField

getReleventConfig

public FieldConfig getReleventConfig(SearchContext searchContext)
Description copied from interface: CustomField
The FieldConfig that is relevent to all issue contexts in the search context

Specified by:
getReleventConfig in interface CustomField
Parameters:
searchContext -

isInScope

public boolean isInScope(User user,
                         SearchContext searchContext)
Specified by:
isInScope in interface CustomField

validateFromActionParams

public void validateFromActionParams(Map params,
                                     ErrorCollection errorCollection,
                                     FieldConfig config)
Specified by:
validateFromActionParams in interface CustomField

getValue

public Object getValue(Issue issue)
Description copied from interface: CustomField
As far as I can tell - this is just an object that contains the value of a custom field, so that it can be passed around. This is only used to communicate with the 'view' JSP.

Multiselects will return a list, dates a date,

Specified by:
getValue in interface CustomField
See Also:
OrderableField.getValueFromParams(java.util.Map)

isRenderable

public boolean isRenderable()
This is the conjunction point with CustomFieldTypes and this is delegated off to customField Types.

Specified by:
isRenderable in interface RenderableField
Returns:
true if the custom field supports interaction with the renderers, false otherwise. Text based fields will be able to interact with the renderers.

updateValue

public void updateValue(FieldLayoutItem fieldLayoutItem,
                        Issue issue,
                        ModifiedValue modifiedValue,
                        IssueChangeHolder issueChangeHolder)
Description copied from interface: OrderableField
Update the issue in the data store

Specified by:
updateValue in interface OrderableField
Parameters:
fieldLayoutItem - for this field within this context
issue - Issue this field is part of
modifiedValue - new value to set field to. Cannot be null.
issueChangeHolder - an object to record any changes made to the issue by this method.

prettyPrintChangeHistory

public String prettyPrintChangeHistory(String changeHistory)
Specified by:
prettyPrintChangeHistory in interface NavigableField

prettyPrintChangeHistory

public String prettyPrintChangeHistory(String changeHistory,
                                       I18nHelper i18nHelper)
Description copied from interface: NavigableField
Used for email notification templates - allows changelog to be displayed in language of the recipient.

Specified by:
prettyPrintChangeHistory in interface NavigableField
Parameters:
changeHistory -
Returns:
String change history formatted according to locale in i18nHelper

isEditable

public boolean isEditable()
Specified by:
isEditable in interface CustomField

getOptions

public Options getOptions(String key,
                          JiraContextNode jiraContextNode)
Description copied from interface: CustomField
A list of the available options for this custom field.

As this is just used by the view layer, it can be a list of objects

Specified by:
getOptions in interface CustomField
Returns:
A list of Objects

getOptions

public Options getOptions(String key,
                          FieldConfig config,
                          JiraContextNode contextNode)
Specified by:
getOptions in interface CustomField

populateDefaults

public void populateDefaults(Map customFieldValuesHolder,
                             Issue issue)
Description copied from interface: OrderableField
Populate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet

Specified by:
populateDefaults in interface OrderableField

getRelevantConfig

public FieldConfig getRelevantConfig(IssueContext issueContext)
Specified by:
getRelevantConfig in interface CustomField

getRelevantConfig

public FieldConfig getRelevantConfig(Issue issue)
Description copied from interface: CustomField
Returns the field configuration applying to this field in the specified issue.

Specified by:
getRelevantConfig in interface CustomField

populateFromParams

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

Specified by:
populateFromParams in interface OrderableField

populateFromIssue

public void populateFromIssue(Map customFieldValuesHolder,
                              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

getValueFromParams

public Object getValueFromParams(Map params)
                          throws FieldValidationException
Description copied from interface: OrderableField
Get a field value from the map of parameters passed. The params map may contain other parameters that are not relevant to this custom field.

Specified by:
getValueFromParams in interface OrderableField
Throws:
FieldValidationException

populateParamsFromString

public void populateParamsFromString(Map fieldValuesHolder,
                                     String stringValue,
                                     Issue issue)
                              throws FieldValidationException
Description copied from interface: OrderableField
Used to convert from a user friendly string value and put the result into the fieldValuesHolder. This method is useful for places like Jelly where the field value can be a name (e.g. issue type name) and not a regular id that is used in the web pages.

Specified by:
populateParamsFromString in interface OrderableField
Throws:
FieldValidationException - if cannot convert to a value from the given string

getConfigurationItemTypes

public List getConfigurationItemTypes()
Description copied from interface: ConfigurableField
Returns a List of FieldConfigItemType objects. This opens up possibilties for configurable custom fields

Specified by:
getConfigurationItemTypes in interface ConfigurableField
Returns:
List of FieldConfigItemType @NotNull

getAssociatedSearchers

public List getAssociatedSearchers()
Description copied from interface: SearchableField
Returns a list of searchers associated with field

Specified by:
getAssociatedSearchers in interface SearchableField
Returns:
List of @Class objects of type @IssueSearcher. Empty list if no searchers are required. Must not be null

createValue

public void createValue(Issue issue,
                        Object value)
Description copied from interface: OrderableField
Create the value of the issue in the data store.

Specified by:
createValue in interface OrderableField
Parameters:
issue - Issue this field is part of
value - Value to store in this field (eg. Collection for Version fields). Cannot be null.

validateParams

public void validateParams(OperationContext operationContext,
                           ErrorCollection errorCollectionToAddTo,
                           I18nHelper i18n,
                           Issue issue,
                           FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
Description copied from interface: OrderableField
Ensure that the parameters are valid

Specified by:
validateParams in interface OrderableField
Parameters:
issue - this is passed to get the value of other fields that may or may not have been modified
fieldScreenRenderLayoutItem -

getCustomFieldValues

public CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
Description copied from interface: CustomField
Get the custom field string values that are relevant to this particular custom field

Specified by:
getCustomFieldValues in interface CustomField
Parameters:
customFieldValuesHolder - containing all params
Returns:
a CustomFieldParams of String objects

remove

public Set remove()
Description copied from interface: CustomField
return set of issues affected

Specified by:
remove in interface CustomField

getRelevantParams

protected CustomFieldParams getRelevantParams(Map params)
Parameters:
params -
Returns:
valid Params

toString

public String toString()

getColumnViewHtml

public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
                                Map displayParams,
                                Issue issue)
Specified by:
getColumnViewHtml in interface NavigableField

getI18nHelper

protected I18nHelper getI18nHelper()

getHiddenFieldId

public String getHiddenFieldId()
Description copied from interface: NavigableField
Returns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.

Specified by:
getHiddenFieldId in interface NavigableField

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

getCreateHtml

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

Specified by:
getCreateHtml in interface OrderableField

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

getEditHtml

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

Specified by:
getEditHtml in interface OrderableField

getBulkEditHtml

public String getBulkEditHtml(OperationContext operationContext,
                              webwork.action.Action action,
                              BulkEditBean bulkEditBean,
                              Map displayParameters)
Description copied from interface: OrderableField
Returns HTML that should be shown when the issue is being bulk edited.

Specified by:
getBulkEditHtml in interface OrderableField

getViewHtml

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

getViewHtml

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

getViewHtml

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

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

getDefaultValue

public 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 -

updateIssue

public void updateIssue(FieldLayoutItem fieldLayoutItem,
                        MutableIssue issue,
                        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 -
issue -
fieldValueHolder -

needsMove

public MessagedResult needsMove(Collection originalIssues,
                                Issue targetIssue,
                                FieldLayoutItem targetFieldLayoutItem)
Description copied from interface: OrderableField
Used to determine if the field needs input from user to be moved to the new project and/or issue type. This method is called only if the field is visible in the target project/issue type.

Specified by:
needsMove in interface OrderableField

populateForMove

public void populateForMove(Map fieldValuesHolder,
                            Issue originalIssue,
                            Issue targetIssue)
Description copied from interface: OrderableField
Used to populate the fieldValueHolder with parameters for move issue screen. This field is only called if the issue needs to be updated during move, i.e. OrderableField.needsMove(java.util.Collection,com.atlassian.jira.issue.Issue,com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem) returned true, and the remote user (the one performing the move) has the permission to actually update this field.

Specified by:
populateForMove in interface OrderableField

removeValue

public void removeValue(MutableIssue issue)
Description copied from interface: OrderableField
Removes the value for the given issue. Returns a list of change items for the removed value.

Specified by:
removeValue in interface OrderableField

hasValue

public boolean hasValue(Issue issue)
Description copied from interface: OrderableField
Determines if the field has a value for the given issue.

Specified by:
hasValue in interface OrderableField

getId

public String getId()
Description copied from interface: RenderableField
Returns the identifier for this RenderableField.

Specified by:
getId in interface Field

getValueFromIssue

public 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
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.

getIdAsLong

public Long getIdAsLong()
Specified by:
getIdAsLong in interface CustomField

getConfigurationSchemes

public List getConfigurationSchemes()
Specified by:
getConfigurationSchemes in interface CustomField

setConfigurationSchemes

public void setConfigurationSchemes(List configurationSchemes)

getNameKey

public String getNameKey()
Description copied from interface: Field
The i18n key that is used to lookup the field's name when it is displayed

Specified by:
getNameKey in interface Field

getAssociatedProjectCategories

public List getAssociatedProjectCategories()
Specified by:
getAssociatedProjectCategories in interface CustomField

getAssociatedProjects

public List getAssociatedProjects()
Description copied from interface: CustomField
Returns a list of projects associated with this project. Will be null if the field is global

Specified by:
getAssociatedProjects in interface CustomField
Returns:
List of project generic values

getAssociatedIssueTypes

public List getAssociatedIssueTypes()
Description copied from interface: CustomField
Returns a list of issue types associated with this project. Will be null if the field is global

Specified by:
getAssociatedIssueTypes in interface CustomField
Returns:
List of issue type generic values

isGlobal

public boolean isGlobal()
Description copied from interface: CustomField
Returns true if the custom field applies for all projects and all issue types

Specified by:
isGlobal in interface CustomField
Returns:
boolean

isAllProjects

public boolean isAllProjects()
Specified by:
isAllProjects in interface CustomField

isAllIssueTypes

public boolean isAllIssueTypes()
Specified by:
isAllIssueTypes in interface CustomField

isEnabled

public boolean isEnabled()
Description copied from interface: CustomField
Returns if the custom field is enabled for any issue type / projects

Specified by:
isEnabled in interface CustomField
Returns:

availableForBulkEdit

public 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.

areDifferent

protected static boolean areDifferent(Object obj1,
                                      Object obj2)
Compare two objects - return false if both are null or equal. Return true otherwise.

Parameters:
obj1 - the first object to compare
obj2 - the second object to compare
Returns:
false if both are null or equal. Return true otherwise.

hasBulkUpdatePermission

protected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean,
                                          Issue issue)
Checks whether the user has the permission to execute the bulk operation for the provied issue. In case of Bulk Workflow Transition checks for nothing. In case of all others (e.g. Bulk Edit) checks for Edit permission.


getName

public String getName()
Description copied from interface: Field
Returns i18n'ed name of the field for system fields or the name of a custom field.

Specified by:
getName in interface Field

setName

public void setName(String name)
Specified by:
setName in interface CustomField

getDescription

public String getDescription()
Specified by:
getDescription in interface CustomField

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface CustomField

getCustomFieldSearcher

public CustomFieldSearcher getCustomFieldSearcher()
Specified by:
getCustomFieldSearcher in interface CustomField

setCustomFieldSearcher

public void setCustomFieldSearcher(CustomFieldSearcher searcher)
Specified by:
setCustomFieldSearcher in interface CustomField

getCustomFieldType

public CustomFieldType getCustomFieldType()
Specified by:
getCustomFieldType in interface CustomField

getColumnHeadingKey

public String getColumnHeadingKey()
Specified by:
getColumnHeadingKey in interface NavigableField

getColumnCssClass

public String getColumnCssClass()
Specified by:
getColumnCssClass in interface NavigableField

getDefaultSortOrder

public 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

valuesEqual

boolean valuesEqual(Object v1,
                    Object v2)

compare

public int compare(Issue issue1,
                   Issue issue2)
Specified by:
compare in interface CustomField

getSorter

public LuceneFieldSorter getSorter()
If this field has a searcher, and this searcher implements SortableCustomFieldSearcher then return SortableCustomFieldSearcher.getSorter(CustomField). Else return null.

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

getSortComparatorSource

public org.apache.lucene.search.SortComparatorSource getSortComparatorSource()
Return a SortComparatorSource that uses either a custom field searcher that implements SortableCustomFieldSearcher or a custom field that implements SortableCustomField. If neither are found, this method returns null.

Specified by:
getSortComparatorSource in interface NavigableField
Returns:
A SortComparatorSource that can be used to sort, or null if this field does not support sorting

equals

public boolean equals(Object o)

hashCode

public int hashCode()

getGenericValue

public org.ofbiz.core.entity.GenericValue getGenericValue()
Deprecated.  

Specified by:
getGenericValue in interface CustomField

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2002-2006 Atlassian. All Rights Reserved.