com.atlassian.jira.issue.managers
Class DefaultCustomFieldManager

java.lang.Object
  extended bycom.atlassian.jira.issue.managers.DefaultCustomFieldManager
All Implemented Interfaces:
CustomFieldManager

public class DefaultCustomFieldManager
extends Object
implements CustomFieldManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.issue.CustomFieldManager
PLUGIN_KEY
 
Constructor Summary
DefaultCustomFieldManager(com.atlassian.plugin.PluginManager pluginManager, OfBizDelegator delegator, FieldConfigSchemeManager fieldConfigSchemeManager, JiraAuthenticationContext authenticationContext, ConstantsManager constantsManager, ProjectManager projectManager, PermissionManager permissionManager, FieldConfigContextPersister contextPersister, FieldScreenManager fieldScreenManager, RendererManager rendererManager)
           
 
Method Summary
 void associateCustomFieldContext(CustomField customField, List contexts, List issueTypes)
           
 CustomField createCustomField(String fieldName, String description, CustomFieldType fieldType, CustomFieldSearcher customFieldSearcher, List contexts, List issueTypes)
           
 CustomField getCustomFieldInstance(org.ofbiz.core.entity.GenericValue customFieldGv)
           
 CustomField getCustomFieldObject(Long id)
          Get a CustomField by ID.
 CustomField getCustomFieldObject(String key)
          Get a CustomField by its text key (eg 'customfield_10000').
 CustomField getCustomFieldObjectByName(String customFieldName)
          Retrieve the first custom field object with the specified name.
 List getCustomFieldObjects()
           
 List getCustomFieldObjects(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use getCustomFieldObjects(com.atlassian.jira.issue.Issue)
 List getCustomFieldObjects(Issue issue)
          Get all CustomFields in scope for this issue's project/type.
 List getCustomFieldObjects(Long projectId, List issueTypeIds)
           
 List getCustomFieldObjects(Long projectId, String issueTypeId)
           
 List getCustomFieldObjects(SearchContext searchContext)
           
 Collection getCustomFieldObjectsByName(String customFieldName)
          Retrieve custom field(s) of a certain name.
 List getCustomFields()
           
 List getCustomFields(String issueType, Long projectId, int customFieldType)
           
 CustomFieldSearcher getCustomFieldSearcher(String key)
          Retrieve a custom field searcher by its type key.
 Class getCustomFieldSearcherClass(String key)
           
 List getCustomFieldSearchers(CustomFieldType customFieldType)
           
 List getCustomFieldsForType(String typeId)
          Return custom fields specific to a certain type of issue.
 CustomFieldType getCustomFieldType(String key)
          Retrieve a custom field type by its type key.
 List getCustomFieldTypes()
           
 List getGlobalCustomFieldObjects()
           
 void refresh()
           
 void removeCustomField(CustomField customField)
           
 void removeCustomFieldValues(org.ofbiz.core.entity.GenericValue issue)
           
 void removeIssueTypeAssociations(org.ofbiz.core.entity.GenericValue issueType)
           
 void removeProjectAssociations(org.ofbiz.core.entity.GenericValue project)
           
 void removeProjectCategoryAssociations(org.ofbiz.core.entity.GenericValue projectCategory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCustomFieldManager

public DefaultCustomFieldManager(com.atlassian.plugin.PluginManager pluginManager,
                                 OfBizDelegator delegator,
                                 FieldConfigSchemeManager fieldConfigSchemeManager,
                                 JiraAuthenticationContext authenticationContext,
                                 ConstantsManager constantsManager,
                                 ProjectManager projectManager,
                                 PermissionManager permissionManager,
                                 FieldConfigContextPersister contextPersister,
                                 FieldScreenManager fieldScreenManager,
                                 RendererManager rendererManager)
Method Detail

createCustomField

public CustomField createCustomField(String fieldName,
                                     String description,
                                     CustomFieldType fieldType,
                                     CustomFieldSearcher customFieldSearcher,
                                     List contexts,
                                     List issueTypes)
                              throws org.ofbiz.core.entity.GenericEntityException
Specified by:
createCustomField in interface CustomFieldManager
Throws:
org.ofbiz.core.entity.GenericEntityException

associateCustomFieldContext

public void associateCustomFieldContext(CustomField customField,
                                        List contexts,
                                        List issueTypes)

getCustomFieldTypes

public List getCustomFieldTypes()
Specified by:
getCustomFieldTypes in interface CustomFieldManager

getCustomFieldType

public CustomFieldType getCustomFieldType(String key)
Description copied from interface: CustomFieldManager
Retrieve a custom field type by its type key.

Specified by:
getCustomFieldType in interface CustomFieldManager
Parameters:
key - Type identifier constructed from plugin XML. Eg. the system types are specified in system-customfiedltypes-plugin.xml:
 <atlassian-plugin key="com.atlassian.jira.plugin.system.customfieldtypes" name="Custom Field Types & Searchers">
   ...
   <customfield-type key="float" name="Number Field"
 ...
 
To access the 'Number Field' type, the key would then be 'com.atlassian.jira.plugin.system.customfieldtypes:float' (the first part can be referred to via CreateCustomField.FIELD_TYPE_PREFIX).

getCustomFieldSearchers

public List getCustomFieldSearchers(CustomFieldType customFieldType)
Specified by:
getCustomFieldSearchers in interface CustomFieldManager

getCustomFieldSearcher

public CustomFieldSearcher getCustomFieldSearcher(String key)
Description copied from interface: CustomFieldManager
Retrieve a custom field searcher by its type key.

Specified by:
getCustomFieldSearcher in interface CustomFieldManager
Parameters:
key - Type identifier constructed from plugin XML. Eg. the system types are specified in system-customfiedltypes-plugin.xml:
 <atlassian-plugin key="com.atlassian.jira.plugin.system.customfieldtypes" name="Custom Field Types & Searchers">
   ...
    <customfield-searcher key="exactnumber" name="Number Searcher"

 ...
 
To access the 'Number Searcher' searcher, the key would then be 'com.atlassian.jira.plugin.system.customfieldtypes:exactnumber' (the first part can be referred to via CreateCustomField.FIELD_TYPE_PREFIX).

getCustomFieldSearcherClass

public Class getCustomFieldSearcherClass(String key)
Specified by:
getCustomFieldSearcherClass in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects(Issue issue)
Get all CustomFields in scope for this issue's project/type.

Specified by:
getCustomFieldObjects in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects(org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use getCustomFieldObjects(com.atlassian.jira.issue.Issue)

Specified by:
getCustomFieldObjects in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects(Long projectId,
                                  String issueTypeId)
Specified by:
getCustomFieldObjects in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects(Long projectId,
                                  List issueTypeIds)
Specified by:
getCustomFieldObjects in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects(SearchContext searchContext)
Specified by:
getCustomFieldObjects in interface CustomFieldManager

getCustomFieldObject

public CustomField getCustomFieldObject(Long id)
Description copied from interface: CustomFieldManager
Get a CustomField by ID.

Specified by:
getCustomFieldObject in interface CustomFieldManager
Parameters:
id - ID of field, eg. 10000
Returns:
The CustomField or null.

getCustomFieldObject

public CustomField getCustomFieldObject(String key)
Description copied from interface: CustomFieldManager
Get a CustomField by its text key (eg 'customfield_10000').

Specified by:
getCustomFieldObject in interface CustomFieldManager
Parameters:
key - Eg. 'customfield_10000'
Returns:
The CustomField or null if not found.

getCustomFieldObjectByName

public CustomField getCustomFieldObjectByName(String customFieldName)
Description copied from interface: CustomFieldManager
Retrieve the first custom field object with the specified name. WARNING: Custom Field names are no longer guaranteed to be unique. This method returns the first named custom field. Use CustomFieldManager.getCustomFieldObjectsByName(String) to retrieve all custom fields.

Specified by:
getCustomFieldObjectByName in interface CustomFieldManager
Parameters:
customFieldName -
Returns:
The first named CustomField, or null if not found.

getCustomFieldObjectsByName

public Collection getCustomFieldObjectsByName(String customFieldName)
Description copied from interface: CustomFieldManager
Retrieve custom field(s) of a certain name.

Specified by:
getCustomFieldObjectsByName in interface CustomFieldManager

getCustomFieldObjects

public List getCustomFieldObjects()
Specified by:
getCustomFieldObjects in interface CustomFieldManager

getGlobalCustomFieldObjects

public List getGlobalCustomFieldObjects()
Specified by:
getGlobalCustomFieldObjects in interface CustomFieldManager

refresh

public void refresh()
Specified by:
refresh in interface CustomFieldManager

getCustomFieldsForType

public List getCustomFieldsForType(String typeId)
                            throws org.ofbiz.core.entity.GenericEntityException
Return custom fields specific to a certain type of issue.

Parameters:
typeId - Custom field type (eg. IssueFieldConstants.NEWFEATURE_TYPE_ID
Returns:
List of CustomField GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getCustomFields

public List getCustomFields(String issueType,
                            Long projectId,
                            int customFieldType)
                     throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

getCustomFields

public List getCustomFields()
                     throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

removeCustomField

public void removeCustomField(CustomField customField)
                       throws org.ofbiz.core.entity.GenericEntityException
Specified by:
removeCustomField in interface CustomFieldManager
Throws:
org.ofbiz.core.entity.GenericEntityException

removeCustomFieldValues

public void removeCustomFieldValues(org.ofbiz.core.entity.GenericValue issue)
                             throws org.ofbiz.core.entity.GenericEntityException
Specified by:
removeCustomFieldValues in interface CustomFieldManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getCustomFieldInstance

public CustomField getCustomFieldInstance(org.ofbiz.core.entity.GenericValue customFieldGv)
Specified by:
getCustomFieldInstance in interface CustomFieldManager

removeProjectAssociations

public void removeProjectAssociations(org.ofbiz.core.entity.GenericValue project)
Specified by:
removeProjectAssociations in interface CustomFieldManager

removeProjectCategoryAssociations

public void removeProjectCategoryAssociations(org.ofbiz.core.entity.GenericValue projectCategory)
Specified by:
removeProjectCategoryAssociations in interface CustomFieldManager

removeIssueTypeAssociations

public void removeIssueTypeAssociations(org.ofbiz.core.entity.GenericValue issueType)
Specified by:
removeIssueTypeAssociations in interface CustomFieldManager


Copyright © 2002-2006 Atlassian. All Rights Reserved.