|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.fields.CustomFieldImpl
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 |
public static final String ENTITY_CF_TYPE_KEY
public static final String ENTITY_CUSTOM_FIELD_SEARCHER
public static final String ENTITY_NAME
public static final String ENTITY_ISSUETYPE
public static final String ENTITY_PROJECT
public static final String ENTITY_ID
public static final String ENTITY_DESCRIPTION
public static final String ENTITY_TABLE_NAME
Constructor Detail |
public CustomFieldImpl(org.ofbiz.core.entity.GenericValue customField, CustomFieldManager customFieldManager, JiraAuthenticationContext authenticationContext, ConstantsManager constantsManager, FieldConfigSchemeManager fieldConfigSchemeManager, PermissionManager permissionManager, RendererManager rendererManager)
Method Detail |
public void store()
store
in interface CustomField
public boolean isInScope(User remoteUser, org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
isInScope
in interface CustomField
issueTypeIds
- Eg ["1", "2"] for Bugs and New Featurespublic FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
getFirstRelevantConfig
in interface CustomField
public FieldConfig getReleventConfig(SearchContext searchContext)
CustomField
FieldConfig
that is relevent to all issue contexts in the search context
getReleventConfig
in interface CustomField
searchContext
- public boolean isInScope(User user, SearchContext searchContext)
isInScope
in interface CustomField
public void validateFromActionParams(Map params, ErrorCollection errorCollection, FieldConfig config)
validateFromActionParams
in interface CustomField
public Object getValue(Issue issue)
CustomField
Multiselects will return a list, dates a date,
getValue
in interface CustomField
OrderableField.getValueFromParams(java.util.Map)
public boolean isRenderable()
isRenderable
in interface RenderableField
public void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
OrderableField
updateValue
in interface OrderableField
fieldLayoutItem
- for this field within this contextissue
- Issue this field is part ofmodifiedValue
- new value to set field to. Cannot be null.issueChangeHolder
- an object to record any changes made to the issue by this method.public String prettyPrintChangeHistory(String changeHistory)
prettyPrintChangeHistory
in interface NavigableField
public String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
NavigableField
prettyPrintChangeHistory
in interface NavigableField
changeHistory
-
public boolean isEditable()
isEditable
in interface CustomField
public Options getOptions(String key, JiraContextNode jiraContextNode)
CustomField
As this is just used by the view layer, it can be a list of objects
getOptions
in interface CustomField
public Options getOptions(String key, FieldConfig config, JiraContextNode contextNode)
getOptions
in interface CustomField
public void populateDefaults(Map customFieldValuesHolder, Issue issue)
OrderableField
populateDefaults
in interface OrderableField
public FieldConfig getRelevantConfig(IssueContext issueContext)
getRelevantConfig
in interface CustomField
public FieldConfig getRelevantConfig(Issue issue)
CustomField
getRelevantConfig
in interface CustomField
public void populateFromParams(Map customFieldValuesHolder, Map params)
OrderableField
populateFromParams
in interface OrderableField
public void populateFromIssue(Map customFieldValuesHolder, Issue issue)
OrderableField
populateFromIssue
in interface OrderableField
public Object getValueFromParams(Map params) throws FieldValidationException
OrderableField
getValueFromParams
in interface OrderableField
FieldValidationException
public void populateParamsFromString(Map fieldValuesHolder, String stringValue, Issue issue) throws FieldValidationException
OrderableField
populateParamsFromString
in interface OrderableField
FieldValidationException
- if cannot convert to a value from the given stringpublic List getConfigurationItemTypes()
ConfigurableField
FieldConfigItemType
objects. This opens up possibilties for configurable custom fields
getConfigurationItemTypes
in interface ConfigurableField
FieldConfigItemType
@NotNullpublic List getAssociatedSearchers()
SearchableField
getAssociatedSearchers
in interface SearchableField
Class
objects of type @IssueSearcher
. Empty list if no searchers are required.
Must not be nullpublic void createValue(Issue issue, Object value)
OrderableField
createValue
in interface OrderableField
issue
- Issue this field is part ofvalue
- Value to store in this field (eg. Collection for Version fields). Cannot be null.public void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
OrderableField
validateParams
in interface OrderableField
issue
- this is passed to get the value of other fields that may or may not have been modifiedfieldScreenRenderLayoutItem
- public CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
CustomField
getCustomFieldValues
in interface CustomField
customFieldValuesHolder
- containing all params
CustomFieldParams
of String
objectspublic Set remove()
CustomField
remove
in interface CustomField
protected CustomFieldParams getRelevantParams(Map params)
params
-
public String toString()
public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
getColumnViewHtml
in interface NavigableField
protected I18nHelper getI18nHelper()
public String getHiddenFieldId()
NavigableField
getHiddenFieldId
in interface NavigableField
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getCreateHtml
in interface OrderableField
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
OrderableField
getCreateHtml
in interface OrderableField
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getEditHtml
in interface OrderableField
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
OrderableField
getEditHtml
in interface OrderableField
public String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters)
OrderableField
getBulkEditHtml
in interface OrderableField
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
getViewHtml
in interface OrderableField
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters)
getViewHtml
in interface OrderableField
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters)
getViewHtml
in interface OrderableField
public boolean isShown(Issue issue)
OrderableField
isShown
in interface OrderableField
public Object getDefaultValue(Issue issue)
OrderableField
getDefaultValue
in interface OrderableField
issue
- public void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
OrderableField
updateIssue
in interface OrderableField
fieldLayoutItem
- issue
- fieldValueHolder
- public MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
OrderableField
needsMove
in interface OrderableField
public void populateForMove(Map fieldValuesHolder, Issue originalIssue, Issue targetIssue)
OrderableField
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.
populateForMove
in interface OrderableField
public void removeValue(MutableIssue issue)
OrderableField
removeValue
in interface OrderableField
public boolean hasValue(Issue issue)
OrderableField
hasValue
in interface OrderableField
public String getId()
RenderableField
getId
in interface Field
public String getValueFromIssue(Issue issue)
RenderableField
getValueFromIssue
in interface RenderableField
issue
- identifies the issue that will contain the value for this field.
public Long getIdAsLong()
getIdAsLong
in interface CustomField
public List getConfigurationSchemes()
getConfigurationSchemes
in interface CustomField
public void setConfigurationSchemes(List configurationSchemes)
public String getNameKey()
Field
getNameKey
in interface Field
public List getAssociatedProjectCategories()
getAssociatedProjectCategories
in interface CustomField
public List getAssociatedProjects()
CustomField
getAssociatedProjects
in interface CustomField
public List getAssociatedIssueTypes()
CustomField
getAssociatedIssueTypes
in interface CustomField
public boolean isGlobal()
CustomField
isGlobal
in interface CustomField
public boolean isAllProjects()
isAllProjects
in interface CustomField
public boolean isAllIssueTypes()
isAllIssueTypes
in interface CustomField
public boolean isEnabled()
CustomField
isEnabled
in interface CustomField
public String availableForBulkEdit(BulkEditBean bulkEditBean)
OrderableField
availableForBulkEdit
in interface OrderableField
bulkEditBean
- holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)
protected static boolean areDifferent(Object obj1, Object obj2)
obj1
- the first object to compareobj2
- the second object to compare
protected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean, Issue issue)
public String getName()
Field
getName
in interface Field
public void setName(String name)
setName
in interface CustomField
public String getDescription()
getDescription
in interface CustomField
public void setDescription(String description)
setDescription
in interface CustomField
public CustomFieldSearcher getCustomFieldSearcher()
getCustomFieldSearcher
in interface CustomField
public void setCustomFieldSearcher(CustomFieldSearcher searcher)
setCustomFieldSearcher
in interface CustomField
public CustomFieldType getCustomFieldType()
getCustomFieldType
in interface CustomField
public String getColumnHeadingKey()
getColumnHeadingKey
in interface NavigableField
public String getColumnCssClass()
getColumnCssClass
in interface NavigableField
public String getDefaultSortOrder()
NavigableField
getDefaultSortOrder
in interface NavigableField
NavigableField.ORDER_ASCENDING
or NavigableField.ORDER_DESCENDING
boolean valuesEqual(Object v1, Object v2)
public int compare(Issue issue1, Issue issue2)
compare
in interface CustomField
public LuceneFieldSorter getSorter()
SortableCustomFieldSearcher
then return
SortableCustomFieldSearcher.getSorter(CustomField)
. Else return null.
getSorter
in interface NavigableField
NavigableField.getSortComparatorSource()
DocumentIssueImpl
,
MappedSortComparator
public org.apache.lucene.search.SortComparatorSource getSortComparatorSource()
SortableCustomFieldSearcher
or a custom field that implements SortableCustomField
.
If neither are found, this method returns null.
getSortComparatorSource
in interface NavigableField
public boolean equals(Object o)
public int hashCode()
public org.ofbiz.core.entity.GenericValue getGenericValue()
getGenericValue
in interface CustomField
public int compareTo(Object o)
compareTo
in interface Comparable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |