Class OptionType

java.lang.Object
com.morpheusdata.model.MorpheusModel
com.morpheusdata.model.OptionType
All Implemented Interfaces:
IModelCodeName, IModelUuidCodeName

public class OptionType extends MorpheusModel implements IModelUuidCodeName
A Model representation of an input / option that is represented either in a UI or CLI. This allows an Integration to specify custom inputs for various configuration screens where custom data may need to be provided. This could include provisioning options as well as cloud configuration options. There are several different input types as well as display orders. This used to belong in seed within the main Morpheus appliance but since plugins are being separated this must be provided by the relevant provider interface.
  • Field Details

    • account

      protected Account account
    • name

      protected String name
    • code

      protected String code
    • category

      protected String category
    • required

      protected Boolean required
    • editable

      protected Boolean editable
    • enabled

      protected Boolean enabled
    • uuid

      protected String uuid
    • noSelection

      protected String noSelection
    • minVal

      protected Long minVal
    • maxVal

      protected Long maxVal
    • minLength

      protected Long minLength
    • maxLength

      protected Long maxLength
    • fieldContext

      protected String fieldContext
    • fieldClass

      protected String fieldClass
    • fieldLabel

      protected String fieldLabel
    • fieldCode

      protected String fieldCode
    • fieldName

      protected String fieldName
    • fieldGetName

      protected String fieldGetName
    • fieldSetName

      protected String fieldSetName
    • fieldGetContext

      protected String fieldGetContext
    • fieldSetContext

      protected String fieldSetContext
    • fieldInput

      protected String fieldInput
    • fieldSize

      protected Integer fieldSize
    • fieldSet

      protected String fieldSet
    • fieldCondition

      protected String fieldCondition
    • fieldAddOn

      protected String fieldAddOn
    • fieldEvar

      protected String fieldEvar
    • fieldComponent

      protected String fieldComponent
    • fieldGroup

      protected String fieldGroup
    • fieldGroupI18nCode

      protected String fieldGroupI18nCode
    • labelClass

      protected String labelClass
    • blockCLass

      protected String blockCLass
    • wrapperClass

      protected String wrapperClass
    • wrapperSelector

      protected String wrapperSelector
    • inputType

      protected OptionType.InputType inputType
    • displayOrder

      protected Integer displayOrder
    • placeHolderText

      protected String placeHolderText
    • defaultValue

      protected String defaultValue
    • helpText

      protected String helpText
    • helpTextI18nCode

      protected String helpTextI18nCode
    • optionSourceType

      protected String optionSourceType
    • optionSource

      protected String optionSource
    • dependsOn

      protected String dependsOn
    • requireOnCode

      protected String requireOnCode
      Controls when this optionType is indicated as required on the form Format is 'fieldName:regex'. e.g. 'config.haMode:ACTIVE_STANDBY' Where fieldName is the full name of another input on the form and regex is a regular expression used to test against the value for the input named 'fieldName'. If a match is obtained, the optionType is inidicated as required. Default match behavior for multiple rules is matchAny. The match type can be customized with a 'matchAll::' or 'matchAny::' prefix. Examples: matchAll::domain.fieldName1:value1,config.fieldName2:value1,domain.fieldName3:(value1|value2|value3) matchAny::config.filedName1:value1,config.fieldName2:^some.*?regex$ Usage logic can be found in option-type-form.js
    • visibleOnCode

      protected String visibleOnCode
      Controls when this optionType is visible Format is 'fieldName:regex'. e.g. 'config.haMode:ACTIVE_STANDBY' Where fieldName is the full name of another input on the form and regex is a regular expression used to test against the value for the input named 'fieldName'. If a match is obtained, the optionType is visible. Default match behavior for multiple rules is matchAny. The match type can be customized with a 'matchAll::' or 'matchAny' prefix. Examples: matchAll::domain.fieldName1:value1,config.fieldName2:value1,domain.fieldName3:(value1|value2|value3) matchAny::config.filedName1:value1,config.fieldName2:^some.*?regex$ Usage logic can be found in option-type-form.js
    • showOnEdit

      protected Boolean showOnEdit
    • displayValueOnDetails

      protected Boolean displayValueOnDetails
    • showOnCreate

      protected Boolean showOnCreate
    • verifyPattern

      protected String verifyPattern
    • format

      protected String format
    • evarName

      protected String evarName
    • conversionType

      protected String conversionType
    • viewTemplate

      protected String viewTemplate
    • editTemplate

      protected String editTemplate
    • addTemplate

      protected String addTemplate
    • idTemplate

      protected String idTemplate
    • apiList

      protected String apiList
    • ownerEditable

      protected Boolean ownerEditable
    • tenantEditable

      protected Boolean tenantEditable
    • tenantVisible

      protected Boolean tenantVisible
    • creatable

      protected Boolean creatable
    • global

      protected Boolean global
    • custom

      protected Boolean custom
    • advanced

      protected Boolean advanced
    • exportEvar

      protected Boolean exportEvar
    • exportMeta

      protected Boolean exportMeta
    • groupExpand

      protected Boolean groupExpand
    • noBlank

      protected Boolean noBlank
    • contextualDefault

      protected Boolean contextualDefault
    • secretField

      protected Boolean secretField
    • excludeFromSearch

      protected Boolean excludeFromSearch
    • formField

      protected Boolean formField
      If this was sourced as a direct input on a form or not. If true, it is hidden from the main ui inputs list
    • ignoreField

      protected Boolean ignoreField
      this field is for form functionality only, will not save to the domain object.
    • localCredential

      protected Boolean localCredential
      these fields are for indicating a field is input for a local credential
    • multiTenant

      protected Boolean multiTenant
      to support multitenant check in gsp
  • Constructor Details

    • OptionType

      public OptionType()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface IModelCodeName
    • setName

      public void setName(String name)
    • getCode

      public String getCode()
      Gets the Unique code representation of the option type. This is used for tracking changes and should be globally unique. It also allows for multiple provider types to reuse the same input field if they share the same option set.
      Specified by:
      getCode in interface IModelCodeName
      Returns:
      unique String code identifier for this particular Option Type
    • setCode

      public void setCode(String code)
      Sets the Unique code representation of the option type. This is used for tracking changes and should be globally unique. It also allows for multiple provider types to reuse the same input field if they share the same option set.
      Parameters:
      code - unique String code identifier for this particular Option Type
    • getFieldLabel

      public String getFieldLabel()
      Gets the field label of the current Option Type. The Field Label is the human readable label that is typically displayed left of the input prompt in most UI representations.
      Returns:
      Human readable Field Label
    • setFieldLabel

      public void setFieldLabel(String fieldLabel)
      Sets the field label of the current Option Type. The Field Label is the human readable label that is typically displayed left of the input prompt in most UI representations.
      Parameters:
      fieldLabel - Human readable Field Label
    • getFieldName

      public String getFieldName()
      Gets the field name of the current option type. The Field Name is typically the actual property name the field correlates to. It can be period seperated for referencing nested objects and is typically combined with the fieldContext. (example: config.provider.name).
      Returns:
      the field name of the property being saved
    • setFieldName

      public void setFieldName(String fieldName)
      Sets the field name of the current option type. The Field Name is typically the actual property name the field correlates to. It can be period seperated for referencing nested objects and is typically combined with the fieldContext. (example: config.provider.name).
      Parameters:
      fieldName - the field name of the property being saved
    • getFieldContext

      public String getFieldContext()
      Gets the field context which is the primary object the field is being saved onto. This could be something like 'instance' or 'config'. It typically gets combined with field names such as a fieldName of 'name' with a context of 'instance' would get combined to save onto 'instance.name' within Morpheus data model.
      Returns:
      the field context to be used for determining where the value is saved
    • setFieldContext

      public void setFieldContext(String fieldContext)
      Sets the field context which is the primary object the field is being saved onto. This could be something like 'instance' or 'config'. It typically gets combined with field names such as a fieldName of 'name' with a context of 'instance' would get combined to save onto 'instance.name' within Morpheus data model.
      Parameters:
      fieldContext - the field context to be used for determining where the value is saved
    • getFieldGroup

      public String getFieldGroup()
      Gets the field group which is the name that is used to group fields together in the user interface. To have all fields at the same level, do not specify a field group.
      Returns:
      the field group to be used for grouping fields together
    • setFieldGroup

      public void setFieldGroup(String fieldGroup)
      Sets the field group which is the name that is used to group fields together in the user interface. To have all fields at the same level, do not specify a field group.
      Parameters:
      fieldGroup - the field group to be used for grouping fields together
    • getInputType

      public OptionType.InputType getInputType()
      Gets the type of Input this option type represents. This could range in type and be anything from a free form text field to a dropdown with remote loaded data from an getOptionSource().
      Returns:
      the type of input this option type correlates to.
    • setInputType

      public void setInputType(OptionType.InputType inputType)
      Sets the type of Input this option type represents. This could range in type and be anything from a free form text field to a dropdown with remote loaded data from an getOptionSource().
      Parameters:
      inputType - the type of input this option type correlates to.
    • getDisplayOrder

      public Integer getDisplayOrder()
      Gets the display order position of the following Option Type. The Display order is sorted ascending numerically. Sometimes it may be advised to use multiples when incrementing the display order to allow for injection points between them.
      Returns:
      the Numerical display order (typically starting at 0) of the input.
    • setDisplayOrder

      public void setDisplayOrder(Integer displayOrder)
      Sets the display order position of the following Option Type. The Display order is sorted ascending numerically. Sometimes it may be advised to use multiples when incrementing the display order to allow for injection points between them.
      Parameters:
      displayOrder - the Numerical display order (typically starting at 0) of the input.
    • getPlaceHolderText

      public String getPlaceHolderText()
      Gets an inputs placeholder text for helpful display when awaiting input on a field. A placeholder text can be helpful hint to the user as to what type of input should go in the associated field.
      Returns:
      the place holder input text
    • getPlaceHolder

      public String getPlaceHolder()
      Convenience method for binding data, see getPlaceHolderText
    • setPlaceHolderText

      public void setPlaceHolderText(String placeHolderText)
      Sets an inputs placeholder text for helpful display when awaiting input on a field. A placeholder text can be helpful hint to the user as to what type of input should go in the associated field.
      Parameters:
      placeHolderText - the place holder input text
    • setPlaceHolder

      public void setPlaceHolder(String placeHolderText)
      Convenience method for binding data, see setPlaceHolderText
    • getDefaultValue

      public String getDefaultValue()
      Returns a String representation of the default value for the current Input. When a user first is prompted for input if no input is given by the user, this default value is used.
      Returns:
      the default value of the following input option
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
      Sets a String representation of the default value for the current Input. When a user first is prompted for input if no input is given by the user, this default value is used.
      Parameters:
      defaultValue - the default value of the following input option
    • getRequired

      public Boolean getRequired()
      Gets the required flag off of the option type. This determines if an input is user required or not. The CLI and UI will use this flag as an initial validation step to ensure a user has at least entered a value.
      Returns:
      the required flag to determine if an input requires a value or not
    • setRequired

      public void setRequired(Boolean required)
      Sets the required flag off of the option type. This determines if an input is user required or not. The CLI and UI will use this flag as an initial validation step to ensure a user has at least entered a value.
      Parameters:
      required - the required flag to determine if an input requires a value or not
    • getHelpText

      public String getHelpText()
      Gets the help text pertaining to an input. Some inputs have help text that display below them to give better context for the user when determining what value to enter. This data is optional.
      Returns:
      the descriptive help block of text for an input
    • getHelpBlock

      public String getHelpBlock()
    • setHelpText

      public void setHelpText(String helpText)
      Gets the help text pertaining to an input. Some inputs have help text that display below them to give better context for the user when determining what value to enter. This data is optional.
      Parameters:
      helpText - the descriptive help block of text for an input
    • setHelpBlock

      public void setHelpBlock(String helpText)
    • getOptionSource

      public String getOptionSource()
      Gets the option source api method endpoint to hit when using the OptionType.InputType.SELECT option. This allows a remote data source query to be queried for loading dynamic data. It also can take a POST request with the values of previously entered inputs to use as a way to filter the available options. This should be globally unique.
      Returns:
      option source api method for loading dynamic options
    • setOptionSource

      public void setOptionSource(String optionSource)
      Sets the option source api method endpoint to hit when using the OptionType.InputType.SELECT option. This allows a remote data source query to be queried for loading dynamic data. It also can take a POST request with the values of previously entered inputs to use as a way to filter the available options. This should be globally unique.
      Parameters:
      optionSource - option source api method for loading dynamic options
    • getDependsOn

      public String getDependsOn()
      Gets the code of an option type that this option type depends on. Some option types depend on input from previous option types. By placing the code or fieldName representation of that field into this input, this field will refresh upon changes made to that previous input
      Returns:
      the code of the parent option type
    • getDependsOnCode

      public String getDependsOnCode()
      Convenience method for binding data, see getDependsOn
    • setDependsOn

      public void setDependsOn(String dependsOn)
      Sets the code of an option type that this option type depends on. Some option types depend on input from previous option types. By placing the code or fieldName representation of that field into this input, this field will refresh upon changes made to that previous input
      Parameters:
      dependsOn - the code of the parent option type
    • setDependsOnCode

      public void setDependsOnCode(String dependsOn)
      Convenience method for binding data, see setDependsOn
    • getEditable

      public Boolean getEditable()
      Specifies whether this option type is editable on edit. This sometimes is the case where a field can be set on create but not changed later
      Returns:
      whether or not this option type value is editable
    • setEditable

      public void setEditable(Boolean editable)
      Sets whether or not this option type is editable. This sometimes is the case where a field can be set on create but not changed later
      Parameters:
      editable - whether or not this field is editable upon edit and not just create
    • getShowOnCreate

      public Boolean getShowOnCreate()
      Specifies whether this option type is visible on create forms. This sometimes is the case where a field can be set on create but not changed later nor does it make sense to display it after create.
      Returns:
      whether or not this option type is visible upon create
    • setShowOnCreate

      public void setShowOnCreate(Boolean showOnCreate)
      Sets whether or not this option type is visible on create forms. This sometimes is the case where a field can be set on create but not changed later, nor does it make sense to display it after create.
      Parameters:
      showOnCreate - whether or not this option type is visible upon create
    • getShowOnEdit

      public Boolean getShowOnEdit()
      Specifies if this option type is visible on edit forms. This sometimes is the case where a field can be set on create but not changed later nor does it make sense to display it after create.
      Returns:
      determines if this option type is visible upon edit
    • setShowOnEdit

      public void setShowOnEdit(Boolean showOnEdit)
      Sets if this option type is visible on edit forms. This sometimes is the case where a field can be set on create but not changed later, nor does it make sense to display it after create.
      Parameters:
      showOnEdit - determines if this option type is visible upon edit
    • getFieldClass

      public String getFieldClass()
    • setFieldClass

      public void setFieldClass(String fieldClass)
    • getLocalCredential

      public Boolean getLocalCredential()
    • setLocalCredential

      public void setLocalCredential(Boolean localCredential)
    • getDisplayValueOnDetails

      public Boolean getDisplayValueOnDetails()
      Specifies if this option type is visible on resource detail views.
      Returns:
      determines if this option type is visible upon edit
    • setDisplayValueOnDetails

      public void setDisplayValueOnDetails(Boolean displayValueOnDetails)
      Sets if this option type is visible on resource detail views.
      Parameters:
      displayValueOnDetails - determines if this option type is visible on resource detail views
    • getCategory

      public String getCategory()
    • setCategory

      public void setCategory(String category)
    • getEnabled

      public Boolean getEnabled()
    • setEnabled

      public void setEnabled(Boolean enabled)
    • getUuid

      public String getUuid()
      returns the uuid
      Specified by:
      getUuid in interface IModelUuidCodeName
      Returns:
      the uuid of the current record
    • setUuid

      public void setUuid(String uuid)
      Sets the uuid. In this class this should not be called directly
      Parameters:
      uuid - the uuid of the current record
    • getNoSelection

      public String getNoSelection()
    • setNoSelection

      public void setNoSelection(String noSelection)
    • getMinVal

      public Long getMinVal()
    • setMinVal

      public void setMinVal(Long minVal)
    • getMaxVal

      public Long getMaxVal()
    • setMaxVal

      public void setMaxVal(Long maxVal)
    • getMinLength

      public Long getMinLength()
    • setMinLength

      public void setMinLength(Long minLength)
    • getMaxLength

      public Long getMaxLength()
    • setMaxLength

      public void setMaxLength(Long maxLength)
    • getFieldCode

      public String getFieldCode()
    • setFieldCode

      public void setFieldCode(String fieldCode)
    • getFieldGetName

      public String getFieldGetName()
    • setFieldGetName

      public void setFieldGetName(String fieldGetName)
    • getFieldSetName

      public String getFieldSetName()
    • setFieldSetName

      public void setFieldSetName(String fieldSetName)
    • getFieldGetContext

      public String getFieldGetContext()
    • setFieldGetContext

      public void setFieldGetContext(String fieldGetContext)
    • getFieldSetContext

      public String getFieldSetContext()
    • setFieldSetContext

      public void setFieldSetContext(String fieldSetContext)
    • getFieldInput

      public String getFieldInput()
    • setFieldInput

      public void setFieldInput(String fieldInput)
    • getFieldSize

      public Integer getFieldSize()
    • setFieldSize

      public void setFieldSize(Integer fieldSize)
    • getFieldSet

      public String getFieldSet()
    • setFieldSet

      public void setFieldSet(String fieldSet)
    • getFieldCondition

      public String getFieldCondition()
    • setFieldCondition

      public void setFieldCondition(String fieldCondition)
    • getFieldAddOn

      public String getFieldAddOn()
    • setFieldAddOn

      public void setFieldAddOn(String fieldAddOn)
    • getFieldEvar

      public String getFieldEvar()
    • setFieldEvar

      public void setFieldEvar(String fieldEvar)
    • getFieldComponent

      public String getFieldComponent()
    • setFieldComponent

      public void setFieldComponent(String fieldComponent)
    • getFieldGroupI18nCode

      public String getFieldGroupI18nCode()
    • getFieldGroupCode

      public String getFieldGroupCode()
      Convenience method for binding data, see getFieldGroupI18nCode
    • setFieldGroupI18nCode

      public void setFieldGroupI18nCode(String fieldGroupI18nCode)
    • setFieldGroupCode

      public void setFieldGroupCode(String fieldGroupI18nCode)
      Convenience method for binding data, see setFieldGroupI18nCode
    • getLabelClass

      public String getLabelClass()
    • setLabelClass

      public void setLabelClass(String labelClass)
    • getBlockCLass

      public String getBlockCLass()
    • setBlockCLass

      public void setBlockCLass(String blockCLass)
    • getWrapperClass

      public String getWrapperClass()
    • setWrapperClass

      public void setWrapperClass(String wrapperClass)
    • getWrapperSelector

      public String getWrapperSelector()
    • setWrapperSelector

      public void setWrapperSelector(String wrapperSelector)
    • getHelpTextI18nCode

      public String getHelpTextI18nCode()
    • getHelpBlockCode

      public String getHelpBlockCode()
      Convenience method for binding data, see getHelpTextI18nCode
    • setHelpTextI18nCode

      public void setHelpTextI18nCode(String helpTextI18nCode)
    • setHelpBlockCode

      public void setHelpBlockCode(String helpTextI18nCode)
      Convenience method for binding data, see setHelpTextI18nCode
    • getOptionSourceType

      public String getOptionSourceType()
    • setOptionSourceType

      public void setOptionSourceType(String optionSourceType)
    • getRequireOnCode

      public String getRequireOnCode()
    • setRequireOnCode

      public void setRequireOnCode(String requireOnCode)
    • getVisibleOnCode

      public String getVisibleOnCode()
    • setVisibleOnCode

      public void setVisibleOnCode(String visibleOnCode)
    • getVerifyPattern

      public String getVerifyPattern()
    • setVerifyPattern

      public void setVerifyPattern(String verifyPattern)
    • getFormat

      public String getFormat()
    • setFormat

      public void setFormat(String format)
    • getEvarName

      public String getEvarName()
    • setEvarName

      public void setEvarName(String evarName)
    • getConversionType

      public String getConversionType()
    • setConversionType

      public void setConversionType(String conversionType)
    • getViewTemplate

      public String getViewTemplate()
    • setViewTemplate

      public void setViewTemplate(String viewTemplate)
    • getEditTemplate

      public String getEditTemplate()
    • setEditTemplate

      public void setEditTemplate(String editTemplate)
    • getAddTemplate

      public String getAddTemplate()
    • setAddTemplate

      public void setAddTemplate(String addTemplate)
    • getIdTemplate

      public String getIdTemplate()
    • setIdTemplate

      public void setIdTemplate(String idTemplate)
    • getApiList

      public String getApiList()
    • setApiList

      public void setApiList(String apiList)
    • getOwnerEditable

      public Boolean getOwnerEditable()
    • setOwnerEditable

      public void setOwnerEditable(Boolean ownerEditable)
    • getTenantEditable

      public Boolean getTenantEditable()
    • setTenantEditable

      public void setTenantEditable(Boolean tenantEditable)
    • getTenantVisible

      public Boolean getTenantVisible()
    • setTenantVisible

      public void setTenantVisible(Boolean tenantVisible)
    • getCreatable

      public Boolean getCreatable()
    • setCreatable

      public void setCreatable(Boolean creatable)
    • getGlobal

      public Boolean getGlobal()
    • setGlobal

      public void setGlobal(Boolean global)
    • getCustom

      public Boolean getCustom()
    • setCustom

      public void setCustom(Boolean custom)
    • getAdvanced

      public Boolean getAdvanced()
    • setAdvanced

      public void setAdvanced(Boolean advanced)
    • getExportEvar

      public Boolean getExportEvar()
    • setExportEvar

      public void setExportEvar(Boolean exportEvar)
    • getExportMeta

      public Boolean getExportMeta()
    • setExportMeta

      public void setExportMeta(Boolean exportMeta)
    • getGroupExpand

      public Boolean getGroupExpand()
    • setGroupExpand

      public void setGroupExpand(Boolean groupExpand)
    • getNoBlank

      public Boolean getNoBlank()
    • setNoBlank

      public void setNoBlank(Boolean noBlank)
    • getContextualDefault

      public Boolean getContextualDefault()
    • setContextualDefault

      public void setContextualDefault(Boolean contextualDefault)
    • getSecretField

      public Boolean getSecretField()
    • setSecretField

      public void setSecretField(Boolean secretField)
    • getExcludeFromSearch

      public Boolean getExcludeFromSearch()
    • setExcludeFromSearch

      public void setExcludeFromSearch(Boolean excludeFromSearch)
    • getIgnoreField

      public Boolean getIgnoreField()
    • setIgnoreField

      public void setIgnoreField(Boolean ignoreField)
    • getMultiTenant

      public Boolean getMultiTenant()
    • setMultiTenant

      public void setMultiTenant(Boolean multiTenant)
    • getAccount

      public Account getAccount()
    • setAccount

      public void setAccount(Account account)
    • getFormField

      public Boolean getFormField()
    • setFormField

      public void setFormField(Boolean formField)