Interface ICustomFieldsService

All Superinterfaces:
ICustomFieldsProvider

public interface ICustomFieldsService extends ICustomFieldsProvider
An extension of ICustomFieldsProvider that is aware of conditionally defined custom fields.
  • Field Details

    • ANNOTATION_KEY_DEFINITION_FILE

      @NotNull static final String 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

      @NotNull static final String 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

      @NotNull Collection<String> getValidCustomFieldIds(@NotNull IPObject instance)
      Parameters:
      instance - The instance of a Module, WorkItem, TestRun etc. (not null)
      Returns:
      The list of String custom field ids that are configured for the given instance. (This includes the conditional ids, based on the object field values.)
    • getCustomField

      @NotNull ICustomField getCustomField(@NotNull IPObject instance, @NotNull String featureId)
      Similar to ICustomFieldsProvider.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. (not null)
      featureId - The custom field id e.g. "targetRelease", "risk" (not null)
      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" (not null).
      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 or null if there is no control field.
      Since:
      3.6.2
    • getCustomFieldTypesFor

      @NotNull Collection<ICustomFieldType> getCustomFieldTypesFor(@NotNull String prototypeName)
      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" (not null).
      Since:
      3.8.3
    • addConfigurationListener

      void addConfigurationListener(@NotNull IConfigListener listener)
      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