Interface ICustomFieldsService
- All Superinterfaces:
ICustomFieldsProvider
An extension of
ICustomFieldsProvider
that is aware of conditionally defined custom fields.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A Prototype annotation key, that defines the field name whose value can switch between different custom field sets.static final String
A Prototype annotation key, that defines the location of the custom field configuration file for the prototype.Fields inherited from interface com.polarion.subterra.base.data.model.ICustomFieldsProvider
CONFLICT_PREFIX
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigurationListener
(IConfigListener listener) Registers the listener, which will be notified after a change in custom field configuration occurs.getCustomField
(IPObject instance, String featureId) Similar toICustomFieldsProvider.getCustomField(String, String, com.polarion.subterra.base.data.identification.IContextId)
, but based on the given instance.getCustomFields
(String prototypeName, IContextId contextId, String controlValue) Collects all custom fields for the specified prototype and control value.getCustomFieldTypesFor
(String prototypeName) Gets all selectable types for the custom fields of the object of the given prototype.getValidCustomFieldIds
(IPObject instance) Methods inherited from interface com.polarion.subterra.base.data.model.ICustomFieldsProvider
getAllCustomFields, getControlField, getCustomField, getCustomField, getDefinedCustomFields, getListCustomField, getListCustomField, isCustomFieldDefined, isCustomFieldDefined
-
Field Details
-
ANNOTATION_KEY_DEFINITION_FILE
A Prototype annotation key, that defines the location of the custom field configuration file for the prototype.- See Also:
-
ANNOTATION_KEY_CONTROL_FIELD
A Prototype annotation key, that defines the field name whose value can switch between different custom field sets.- See Also:
-
-
Method Details
-
getValidCustomFieldIds
- Parameters:
instance
- The instance of a Module, WorkItem, TestRun etc. (notnull
)- Returns:
- The list of
String
custom field ids that are configured for the giveninstance
. (This includes the conditional ids, based on the object field values.)
-
getCustomField
Similar toICustomFieldsProvider.getCustomField(String, String, com.polarion.subterra.base.data.identification.IContextId)
, but based on the given instance. (Works correctly with conditional custom fields.)- Parameters:
instance
- The instance of a Module, WorkItem, TestRun etc. (notnull
)featureId
- The custom field id e.g. "targetRelease", "risk" (notnull
)- Returns:
- The custom field definition (not
null
).
-
getCustomFields
@NotNull Collection<ICustomField> getCustomFields(@NotNull String prototypeName, @NotNull IContextId contextId, @Nullable String controlValue) Collects all custom fields for the specified prototype and control value. If the control value is specified, only type-specific fields will be collected. (Otherwise only non type-specific fields will be collected.)- Parameters:
prototypeName
- The prototype of the object e.g. "WorkItem" (notnull
).contextId
- For example, of a project.controlValue
- The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption ornull
if there is no control field.- Since:
- 3.6.2
-
getCustomFieldTypesFor
Gets all selectable types for the custom fields of the object of the given prototype.- Parameters:
prototypeName
- The prototype of the object, for example, "WorkItem" (notnull
).- Since:
- 3.8.3
-
addConfigurationListener
Registers the listener, which will be notified after a change in custom field configuration occurs. The listener only gets notified about permanent changes, not in-transaction (uncommitted) changes.- Parameters:
listener
- The listener to notify- Since:
- 3.21.1
-