Class Field

java.lang.Object
com.inet.taskplanner.server.api.field.Field
Direct Known Subclasses:
BooleanField, ColorField, CurrencyField, DateField, FilenameField, FloatField, FolderField, GroupField, HtmlTextAreaField, LabelField, LinkField, NumberField, PasswordField, RangeField, SelectField, SelectInputField, SelectInputFieldMulti, TableField, TextAreaField, TextField, TimeField

@JsonData public abstract class Field extends Object
A field represents a component in the settings of, for example, a trigger or job. Each property that should be configured by the user in the web GUI must be provided as a field.
The Field is also responsible for replacing placeholders in its value for a series task.
Since:
taskplanner 3.0
  • Constructor Details

    • Field

      protected Field(FieldType type, String key, String label)
      Creates the field instance.
      Parameters:
      type - the type of the field
      key - the key that is stored in the definition
      label - the label to be shown in front of the component
      Since:
      taskplanner 3.0
    • Field

      protected Field(String type, String key, String label)
      Creates the field instance.
      Parameters:
      type - the type of the field
      key - the key that is stored in the definition
      label - the label to be shown in front of the component
      Since:
      taskplanner 3.0
    • Field

      protected Field(FieldType type, String key, String label, boolean valueSavable)
      Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.
      Parameters:
      type - the type of the field
      key - the key that is stored in the definition
      label - the label to be shown in front of the component
      valueSavable - true if the value should be stored, false otherwise
      Since:
      taskplanner 3.0
    • Field

      protected Field(String type, String key, String label, boolean valueSavable)
      Creates the field instance with the possibility to define whether the setting will be stored in the definition or not.
      Parameters:
      type - the type of the field
      key - the key that is stored in the definition
      label - the label to be shown in front of the component
      valueSavable - true if the value should be stored, false otherwise
      Since:
      taskplanner 3.0
  • Method Details

    • getConditions

      public List<FieldCondition> getConditions()
      Returns the fields for the condition. These conditions are combined with OR.
      Returns:
      the fields for the condition
      Since:
      taskplanner 3.0
    • setConditions

      public void setConditions(List<FieldCondition> conditions)
      Sets the fields for the condition. These conditions are combined with OR.
      Parameters:
      conditions - the fields for the condition
      Since:
      taskplanner 3.0
    • getType

      public String getType()
      Returns the type of the field that defines how the field is displayed
      Returns:
      the type of the field
      Since:
      taskplanner 3.0
    • setType

      public void setType(FieldType type)
      Sets the type of the field that defines how the field is displayed
      Parameters:
      type - the type of the field
      Since:
      taskplanner 3.0
    • setType

      public void setType(String type)
      Sets the type of the field that defines how the field is displayed
      Parameters:
      type - the type of the field
      Since:
      taskplanner 3.0
    • getKey

      public String getKey()
      Returns the key that is stored in the definition
      Returns:
      the key that is stored in the definition
      Since:
      taskplanner 3.0
    • setKey

      public void setKey(String key)
      Sets the key that is stored in the definition
      Parameters:
      key - the key that is stored in the definition
      Since:
      taskplanner 3.0
    • getLabel

      public String getLabel()
      Returns the label shown in front of the component.
      Returns:
      the label shown in front of the component
      Since:
      taskplanner 3.0
    • setLabel

      public void setLabel(String label)
      Sets the label shown in front of the component.
      Parameters:
      label - the label to be shown in front of the component
      Since:
      taskplanner 3.0
    • getPlaceholder

      public String getPlaceholder()
      Returns the placeholder text that is displayed if the field is left empty
      Returns:
      the placeholder text
      Since:
      taskplanner 3.0
    • setPlaceholder

      public void setPlaceholder(String placeholder)
      Sets the placeholder text that is displayed if the field is left empty
      Parameters:
      placeholder - the placeholder text
      Since:
      taskplanner 3.0
    • getValue

      public String getValue()
      Returns the current value of the field
      Returns:
      the current value of the field
      Since:
      taskplanner 3.0
    • setValue

      public void setValue(String value)
      Sets the current value of the field
      Parameters:
      value - the current value of the field
      Since:
      taskplanner 3.0
    • isValueSavable

      protected boolean isValueSavable()
      Returns whether the value should be stored
      Returns:
      true if the value should be stored, false otherwise
      Since:
      taskplanner 3.0
    • setValueSavable

      protected void setValueSavable(boolean valueSavable)
      Sets whether the value should be stored
      Parameters:
      valueSavable - true if the value should be stored, false otherwise
      Since:
      taskplanner 3.0
    • isUpdateValuesOnChange

      public boolean isUpdateValuesOnChange()
      Returns whether the whole values of the fields in the current dialog should be updated if the value of the current field changes
      Returns:
      true if the values should be updated, false otherwise
      Since:
      taskplanner 3.0
    • setUpdateValuesOnChange

      public void setUpdateValuesOnChange(boolean updateValuesOnChange)
      Sets whether the whole values of the fields in the current dialog should be updated if the value of the current field changes
      Parameters:
      updateValuesOnChange - true if the values should be updated, false otherwise
      Since:
      taskplanner 3.0
    • patchSeriesPlaceholderInValue

      public String patchSeriesPlaceholderInValue(@Nullable String value, @Nonnull Map<String,String> seriesProperties)
      Overrides this method to replace placeholders with values from the series.
      Parameters:
      value - the value to be patched
      seriesProperties - properties from the current series set
      Returns:
      the new value with replaced placeholders
      Since:
      taskplanner 3.0
    • patchResultPlaceholderInValue

      public String patchResultPlaceholderInValue(@Nullable String value, @Nonnull List<JobResultContainer> results)
      Overrides this method to replace placeholders with values from the results.
      Parameters:
      value - the value to be patched
      results - the results that contain the meta properties that are replaced
      Returns:
      the new value with replaced placeholders
      Since:
      taskplanner 3.0
    • replaceSeriesPlaceholders

      protected final String replaceSeriesPlaceholders(String value, Map<String,String> properties)
      Replaces placeholders in the given string with values from the given properties. Placeholders for missing values are removed.
      Parameters:
      value - the value to replace
      properties - the properties with which to replace placeholders
      Returns:
      the replaced string
      Since:
      taskplanner 3.0