com.atlassian.jira.issue.fields
Class CustomFieldImpl

java.lang.Object
  extended bycom.atlassian.jira.issue.fields.AbstractField
      extended bycom.atlassian.jira.issue.fields.NavigableFieldImpl
          extended bycom.atlassian.jira.issue.fields.CustomFieldImpl
All Implemented Interfaces:
CustomField, Field, HideableField, NavigableField, OrderableField, RequirableField

public class CustomFieldImpl
extends NavigableFieldImpl
implements CustomField, OrderableField, HideableField


Field Summary
static java.lang.String ENTITY_CF_TYPE_KEY
           
static java.lang.String ENTITY_CUSTOM_FIELD_SEARCHER
           
static java.lang.String ENTITY_DESCRIPTION
           
static java.lang.String ENTITY_ID
           
static java.lang.String ENTITY_ISSUETYPE
           
static java.lang.String ENTITY_NAME
           
static java.lang.String ENTITY_PROJECT
           
 
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING
 
Constructor Summary
CustomFieldImpl(org.ofbiz.core.entity.GenericValue customField, CustomFieldManager customFieldManager)
           
 
Method Summary
 int compare(org.ofbiz.core.entity.GenericValue issue1, org.ofbiz.core.entity.GenericValue issue2)
           
 void createValue(org.ofbiz.core.entity.GenericValue issue, java.lang.Object value)
           
 java.util.Comparator getComparator()
           
 CustomFieldSearcher getCustomFieldSearcher()
           
 CustomFieldType getCustomFieldType()
           
 CustomFieldParams getCustomFieldValues(java.util.Map customFieldValuesHolder)
          Get the custom field string values that are relevant to this particular custom field
 java.lang.String getDescription()
           
 org.ofbiz.core.entity.GenericValue getGenericValue()
          Deprecated.  
 java.lang.String getIssueType()
           
 java.lang.String getName()
           
 Options getOptions(java.lang.String key, ProjectIssueType projectIssueType)
          A list of the available options for this custom field.
 org.ofbiz.core.entity.GenericValue getProject()
          This method returns the project in which the custom field has been associated with .
protected  CustomFieldParams getRelevantParams(java.util.Map params)
           
 java.lang.String getSearchDescription(SearchParameter searchParameter)
           
 java.lang.Object getValue(org.ofbiz.core.entity.GenericValue 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.
 java.lang.Object getValueFromParams(java.util.Map params)
          Get a custom field value from the map of parameters passed.
 void index(org.apache.lucene.document.Document doc, org.ofbiz.core.entity.GenericValue issue)
           
 boolean isEditable()
           
 boolean isInScope(com.opensymphony.user.User remoteUser, org.ofbiz.core.entity.GenericValue project, java.util.List issueTypes)
          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 isIssueTypeCustomField()
           
 boolean isProjectCustomField()
           
 boolean isSortable()
           
 java.util.List makeSearchParameter(CustomFieldParams params)
           
 void populateDefaults(java.util.Map customFieldValuesHolder)
           
 void populateFromIssue(java.util.Map customFieldValuesHolder, org.ofbiz.core.entity.GenericValue issue)
           
 void populateFromParams(java.util.Map customFieldValuesHolder, java.util.Map params)
           
 void populateFromSearchRequest(java.util.Map customFieldValuesHolder, SearchRequest searchRequest)
           
 java.util.Set remove()
          return set of issues affected
 void setCustomFieldSearcher(CustomFieldSearcher searcher)
           
 void setDescription(java.lang.String description)
           
 void setIssueType(java.lang.String issueType)
           
 void setName(java.lang.String name)
           
 void store()
           
 java.lang.String toString()
           
 ChangeItemBean updateValue(org.ofbiz.core.entity.GenericValue issue, java.lang.Object newValue)
           
 void validateParams(java.util.Map params, ErrorCollection errorCollectionToAddTo)
           
(package private)  boolean valuesEqual(java.lang.Object v1, java.lang.Object v2)
           
(package private)  boolean valuesEqual1(java.lang.Object v1, java.lang.Object v2)
           
 
Methods inherited from class com.atlassian.jira.issue.fields.NavigableFieldImpl
getColumnHeadingKey, getDefaultSortOrder, setComparator, setDefaultSortOrder, setSortable
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractField
equals, getId, getNameKey, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getColumnHeadingKey, getDefaultSortOrder
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getNameKey
 

Field Detail

ENTITY_CF_TYPE_KEY

public static final java.lang.String ENTITY_CF_TYPE_KEY
See Also:
Constant Field Values

ENTITY_CUSTOM_FIELD_SEARCHER

public static final java.lang.String ENTITY_CUSTOM_FIELD_SEARCHER
See Also:
Constant Field Values

ENTITY_NAME

public static final java.lang.String ENTITY_NAME
See Also:
Constant Field Values

ENTITY_ISSUETYPE

public static final java.lang.String ENTITY_ISSUETYPE
See Also:
Constant Field Values

ENTITY_PROJECT

public static final java.lang.String ENTITY_PROJECT
See Also:
Constant Field Values

ENTITY_ID

public static final java.lang.String ENTITY_ID
See Also:
Constant Field Values

ENTITY_DESCRIPTION

public static final java.lang.String ENTITY_DESCRIPTION
See Also:
Constant Field Values
Constructor Detail

CustomFieldImpl

public CustomFieldImpl(org.ofbiz.core.entity.GenericValue customField,
                       CustomFieldManager customFieldManager)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface CustomField

setName

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

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface CustomField

setDescription

public void setDescription(java.lang.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

store

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

getGenericValue

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

Specified by:
getGenericValue in interface CustomField

getIssueType

public java.lang.String getIssueType()
Specified by:
getIssueType in interface CustomField

setIssueType

public void setIssueType(java.lang.String issueType)
Specified by:
setIssueType in interface CustomField

isProjectCustomField

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

isIssueTypeCustomField

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

getProject

public org.ofbiz.core.entity.GenericValue getProject()
This method returns the project in which the custom field has been associated with .

Specified by:
getProject in interface CustomField
Returns:
Throws:
java.lang.IllegalArgumentException - if not a Project custom field

isInScope

public boolean isInScope(com.opensymphony.user.User remoteUser,
                         org.ofbiz.core.entity.GenericValue project,
                         java.util.List issueTypes)
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
Returns:

getCustomFieldType

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

getValue

public java.lang.Object getValue(org.ofbiz.core.entity.GenericValue 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:
CustomField.getValueFromParams(java.util.Map)

index

public void index(org.apache.lucene.document.Document doc,
                  org.ofbiz.core.entity.GenericValue issue)
Specified by:
index in interface CustomField

updateValue

public ChangeItemBean updateValue(org.ofbiz.core.entity.GenericValue issue,
                                  java.lang.Object newValue)
Specified by:
updateValue in interface CustomField

valuesEqual1

boolean valuesEqual1(java.lang.Object v1,
                     java.lang.Object v2)

valuesEqual

boolean valuesEqual(java.lang.Object v1,
                    java.lang.Object v2)

compare

public int compare(org.ofbiz.core.entity.GenericValue issue1,
                   org.ofbiz.core.entity.GenericValue issue2)
Specified by:
compare in interface CustomField

getComparator

public java.util.Comparator getComparator()
Specified by:
getComparator in interface NavigableField
Overrides:
getComparator in class NavigableFieldImpl

isSortable

public boolean isSortable()
Specified by:
isSortable in interface NavigableField
Overrides:
isSortable in class NavigableFieldImpl

isEditable

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

makeSearchParameter

public java.util.List makeSearchParameter(CustomFieldParams params)
Specified by:
makeSearchParameter in interface CustomField

getSearchDescription

public java.lang.String getSearchDescription(SearchParameter searchParameter)
Specified by:
getSearchDescription in interface CustomField

getOptions

public Options getOptions(java.lang.String key,
                          ProjectIssueType projectIssueType)
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

populateDefaults

public void populateDefaults(java.util.Map customFieldValuesHolder)
Specified by:
populateDefaults in interface CustomField

populateFromParams

public void populateFromParams(java.util.Map customFieldValuesHolder,
                               java.util.Map params)
Specified by:
populateFromParams in interface CustomField

populateFromIssue

public void populateFromIssue(java.util.Map customFieldValuesHolder,
                              org.ofbiz.core.entity.GenericValue issue)
Specified by:
populateFromIssue in interface CustomField

populateFromSearchRequest

public void populateFromSearchRequest(java.util.Map customFieldValuesHolder,
                                      SearchRequest searchRequest)
Specified by:
populateFromSearchRequest in interface CustomField

getValueFromParams

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

This method is only used when creating an issue, and the value is passed back to CustomField.createValue(org.ofbiz.core.entity.GenericValue, java.lang.Object)

Specified by:
getValueFromParams in interface CustomField
Returns:
An obj
Throws:
CustomFieldValidationException

createValue

public void createValue(org.ofbiz.core.entity.GenericValue issue,
                        java.lang.Object value)
Specified by:
createValue in interface CustomField

validateParams

public void validateParams(java.util.Map params,
                           ErrorCollection errorCollectionToAddTo)
Specified by:
validateParams in interface CustomField

getCustomFieldValues

public CustomFieldParams getCustomFieldValues(java.util.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 collection of String objects

remove

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

Specified by:
remove in interface CustomField

getRelevantParams

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

toString

public java.lang.String toString()


Copyright © 2002-2005 Atlassian. All Rights Reserved.