|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.issue.managers.DefaultCustomFieldManager
public class DefaultCustomFieldManager
Field Summary |
---|
Fields inherited from interface com.atlassian.jira.issue.CustomFieldManager |
---|
PLUGIN_KEY |
Constructor Summary | |
---|---|
DefaultCustomFieldManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
OfBizDelegator delegator,
FieldConfigSchemeManager fieldConfigSchemeManager,
JiraAuthenticationContext authenticationContext,
ConstantsManager constantsManager,
ProjectManager projectManager,
PermissionManager permissionManager,
FieldConfigContextPersister contextPersister,
FieldScreenManager fieldScreenManager,
RendererManager rendererManager,
CustomFieldValuePersister customFieldValuePersister,
NotificationSchemeManager notificationSchemeManager,
FieldManager fieldManager,
FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
void |
associateCustomFieldContext(CustomField customField,
List contexts,
List issueTypes)
|
void |
clear()
clear the cache |
CustomField |
createCustomField(String fieldName,
String description,
CustomFieldType fieldType,
CustomFieldSearcher customFieldSearcher,
List contexts,
List issueTypes)
Creates a custom field with the given name and description of the given CustomFieldType using the given CustomFieldSearcher that is displayed in the given list of contexts available to the given list of issueTypes. |
CustomField |
getCustomFieldInstance(org.ofbiz.core.entity.GenericValue customFieldGv)
Converts a customfield GenericValue to a CustomField instance. |
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<CustomField> |
getCustomFieldObjects()
Returns all custom fields. |
List<CustomField> |
getCustomFieldObjects(org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use getCustomFieldObjects(com.atlassian.jira.issue.Issue) |
List<CustomField> |
getCustomFieldObjects(Issue issue)
Get all CustomField s in scope for this issue's project/type. |
List<CustomField> |
getCustomFieldObjects(Long projectId,
List<String> issueTypeIds)
Returns the same as CustomFieldManager.getCustomFieldObjects(Long,String) but allows
to specify a list of issueTypes. |
List<CustomField> |
getCustomFieldObjects(Long projectId,
String issueTypeId)
Gets a list of custom fields for a particular project and issue type. |
List<CustomField> |
getCustomFieldObjects(SearchContext searchContext)
Returns all customfields in a particular SearchContext . |
Collection<CustomField> |
getCustomFieldObjectsByName(String customFieldName)
Retrieve custom field(s) of a certain name. |
CustomFieldSearcher |
getCustomFieldSearcher(String key)
Retrieve a custom field searcher by its type key. |
Class |
getCustomFieldSearcherClass(String key)
Retrieve a custom field searcher by its type key. |
List<CustomFieldSearcher> |
getCustomFieldSearchers(CustomFieldType customFieldType)
Retrieves all the searchers registered for a particular custom Field. |
CustomFieldType |
getCustomFieldType(String key)
Retrieve a custom field type by its type key. |
List |
getCustomFieldTypes()
Retrieve all customfieldtypes registered in the sytem. |
List<CustomField> |
getGlobalCustomFieldObjects()
Returns a list of custom fields where the CustomField.isGlobal()
is true. |
void |
onClearCache(ClearCacheEvent event)
|
void |
onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
|
void |
onPluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
|
void |
refresh()
reloads all customfields into the cache from the DB. |
void |
removeCustomField(CustomField customField)
Removes the customfield supplied including all associations and values. |
void |
removeCustomFieldPossiblyLeavingOrphanedData(Long customFieldId)
Removes the customfield supplied. |
void |
removeCustomFieldValues(org.ofbiz.core.entity.GenericValue issue)
Removes the values stored by customfields for a particular Issue. |
void |
removeProjectAssociations(org.ofbiz.core.entity.GenericValue project)
Used if a project is deleted to remove the project field associations. |
void |
removeProjectCategoryAssociations(ProjectCategory projectCategory)
Used if a project category is deleted to remove the field associations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultCustomFieldManager(com.atlassian.plugin.PluginAccessor pluginAccessor, OfBizDelegator delegator, FieldConfigSchemeManager fieldConfigSchemeManager, JiraAuthenticationContext authenticationContext, ConstantsManager constantsManager, ProjectManager projectManager, PermissionManager permissionManager, FieldConfigContextPersister contextPersister, FieldScreenManager fieldScreenManager, RendererManager rendererManager, CustomFieldValuePersister customFieldValuePersister, NotificationSchemeManager notificationSchemeManager, FieldManager fieldManager, FieldConfigSchemeClauseContextUtil fieldConfigSchemeClauseContextUtil, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
@EventListener public void onClearCache(ClearCacheEvent event)
public CustomField createCustomField(String fieldName, String description, CustomFieldType fieldType, CustomFieldSearcher customFieldSearcher, List contexts, List issueTypes) throws org.ofbiz.core.entity.GenericEntityException
CustomFieldManager
createCustomField
in interface CustomFieldManager
org.ofbiz.core.entity.GenericEntityException
- if the CustomField could not be created.public void associateCustomFieldContext(CustomField customField, List contexts, List issueTypes)
public List getCustomFieldTypes()
CustomFieldManager
getCustomFieldTypes
in interface CustomFieldManager
CustomFieldType
spublic CustomFieldType getCustomFieldType(String key)
CustomFieldManager
getCustomFieldType
in interface CustomFieldManager
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
).public List<CustomFieldSearcher> getCustomFieldSearchers(CustomFieldType customFieldType)
CustomFieldManager
<customfield-searcher key="daterange" name="Date Range picker" i18n-name-key="admin.customfield.searcher.daterange.name" class="com.atlassian.jira.issue.customfields.searchers.DateRangeSearcher">
getCustomFieldSearchers
in interface CustomFieldManager
CustomFieldSearcher
spublic CustomFieldSearcher getCustomFieldSearcher(String key)
CustomFieldManager
getCustomFieldSearcher
in interface CustomFieldManager
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
).public Class getCustomFieldSearcherClass(String key)
CustomFieldManager
getCustomFieldSearcherClass
in interface CustomFieldManager
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
).public List<CustomField> getCustomFieldObjects(Issue issue)
CustomField
s in scope for this issue's project/type.
getCustomFieldObjects
in interface CustomFieldManager
issue
- A Issue
object
CustomField
spublic List<CustomField> getCustomFieldObjects(org.ofbiz.core.entity.GenericValue issue)
getCustomFieldObjects(com.atlassian.jira.issue.Issue)
CustomFieldManager
CustomField
s that apply to a particular issue.
getCustomFieldObjects
in interface CustomFieldManager
issue
- A GenericValue
of the issue
CustomField
spublic List<CustomField> getCustomFieldObjects(Long projectId, String issueTypeId)
CustomFieldManager
getCustomFieldObjects
in interface CustomFieldManager
projectId
- Id of the projectissueTypeId
- An issue type. See ConstantsManager.ALL_ISSUE_TYPES
,
ConstantsManager.ALL_STANDARD_ISSUE_TYPES
and ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES
CustomField
spublic List<CustomField> getCustomFieldObjects(Long projectId, List<String> issueTypeIds)
CustomFieldManager
CustomFieldManager.getCustomFieldObjects(Long,String)
but allows
to specify a list of issueTypes.
getCustomFieldObjects
in interface CustomFieldManager
projectId
- Id of the projectissueTypeIds
- A list of issue types. See ConstantsManager.ALL_ISSUE_TYPES
,
ConstantsManager.ALL_STANDARD_ISSUE_TYPES
and ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES
CustomField
spublic List<CustomField> getCustomFieldObjects(SearchContext searchContext)
CustomFieldManager
SearchContext
. Also
see CustomField.isInScope(com.atlassian.crowd.embedded.api.User,com.atlassian.jira.issue.search.SearchContext)
.
getCustomFieldObjects
in interface CustomFieldManager
CustomField
spublic CustomField getCustomFieldObject(Long id)
CustomFieldManager
getCustomFieldObject
in interface CustomFieldManager
id
- ID of field, eg. 10000
CustomField
or null.public CustomField getCustomFieldObject(String key)
CustomFieldManager
getCustomFieldObject
in interface CustomFieldManager
key
- Eg. 'customfield_10000'
CustomField
or null if not found.public CustomField getCustomFieldObjectByName(String customFieldName)
CustomFieldManager
CustomFieldManager.getCustomFieldObjectsByName(String)
to retrieve all custom fields.
getCustomFieldObjectByName
in interface CustomFieldManager
CustomField
, or null if not found.public Collection<CustomField> getCustomFieldObjectsByName(String customFieldName)
CustomFieldManager
getCustomFieldObjectsByName
in interface CustomFieldManager
CustomField
s.public List<CustomField> getCustomFieldObjects()
CustomFieldManager
getCustomFieldObjects
in interface CustomFieldManager
CustomField
s.public List<CustomField> getGlobalCustomFieldObjects()
CustomFieldManager
CustomField.isGlobal()
is true.
getGlobalCustomFieldObjects
in interface CustomFieldManager
CustomField
spublic void refresh()
CustomFieldManager
refresh
in interface CustomFieldManager
public void clear()
CustomFieldManager
clear
in interface CustomFieldManager
public void removeCustomFieldPossiblyLeavingOrphanedData(Long customFieldId) throws RemoveException
CustomFieldManager
CustomFieldManager.removeCustomField(com.atlassian.jira.issue.fields.CustomField)
method, which will not leave any orphaned
data behind.
NOTE: Generally you should use the CustomFieldManager.removeCustomField(com.atlassian.jira.issue.fields.CustomField)
method to remove a custom field, as it is guaranteed to remove all data. This method should only be used if
a customfield needs to be removed when the customfieldtype for that field is no longer available!
If however the customfield object cannot be retrieved via the manager, which may be the case if the custom field
type is no longer available (a plugin may have been removed), then this method will try to lookup the custom
field directly in the database. If it doesn't exist in the database, an IllegalArgumentException will
be thrown. Otherwise, the customfield and all associated configurations will be removed. This method
will also call to the CustomFieldValuePersister.removeAllValues(String)
method to delete any values. Please note however, that if your custom field stores any other values (such
as options for example), they will have to be removed by the caller of this method, as the custom field type
is not accessible (which is usually responsible for removing such values).
removeCustomFieldPossiblyLeavingOrphanedData
in interface CustomFieldManager
customFieldId
- The id of the customField to be removed.
RemoveException
- On any error removing the custom fieldpublic void removeCustomField(CustomField customField) throws RemoveException
CustomFieldManager
removeCustomField
in interface CustomFieldManager
customField
- The CustomField
to be removed.
RemoveException
- On any error removing the custom fieldpublic void removeCustomFieldValues(org.ofbiz.core.entity.GenericValue issue) throws org.ofbiz.core.entity.GenericEntityException
CustomFieldManager
removeCustomFieldValues
in interface CustomFieldManager
issue
- The issue GenericValue
org.ofbiz.core.entity.GenericEntityException
public CustomField getCustomFieldInstance(org.ofbiz.core.entity.GenericValue customFieldGv)
CustomFieldManager
GenericValue
to a CustomField
instance.
getCustomFieldInstance
in interface CustomFieldManager
CustomField
instancepublic void removeProjectAssociations(org.ofbiz.core.entity.GenericValue project)
CustomFieldManager
removeProjectAssociations
in interface CustomFieldManager
project
- The project being deleted.public void removeProjectCategoryAssociations(ProjectCategory projectCategory)
CustomFieldManager
removeProjectCategoryAssociations
in interface CustomFieldManager
projectCategory
- The project category being deleted.@EventListener public void onPluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
@EventListener public void onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |