java.lang.Object
com.inet.taskplanner.server.api.field.Field
Direct Known Subclasses:
BooleanField, ColorField, CurrencyField, DateField, FilenameField, FloatField, FolderField, GroupField, 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 a e.g. 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 to replace the placeholder in it's value for a serial 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 should 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 should 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 should 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 should 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 evaluates as OR-associated.
      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 evaluates as OR-associated.
      Parameters:
      conditions - the fields for the condition
      Since:
      taskplanner 3.0
    • getType

      public String getType()
      Returns the type of the field which 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 which 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 which 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 to be should in front of the component
      Returns:
      the label to be should in front of the component
      Since:
      taskplanner 3.0
    • setLabel

      public void setLabel(String label)
      Sets the label to be should in front of the component
      Parameters:
      label - the label to be should 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)
      Override to replace the placeholders with the 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)
      Override to replace the placeholders with the 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)
      Replace placeholders in given string with values in given properties. Placeholders of missing values will be removed.
      Parameters:
      value - the value to replace
      properties - the properties with what to replace
      Returns:
      the replaced String.
      Since:
      taskplanner 3.0