Package com.morpheusdata.model
Class OptionType
java.lang.Object
com.morpheusdata.model.MorpheusModel
com.morpheusdata.model.OptionType
- All Implemented Interfaces:
IModelCodeName
,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.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Account
protected String
protected Boolean
protected String
protected String
protected String
protected String
protected Boolean
protected String
protected Boolean
protected Boolean
protected String
protected String
protected Integer
protected Boolean
protected Boolean
protected String
protected Boolean
protected String
protected Boolean
protected Boolean
protected Boolean
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected Integer
protected String
protected Boolean
If this was sourced as a direct input on a form or not.protected Boolean
protected Boolean
protected String
protected String
protected String
protected Boolean
this field is for form functionality only, will not save to the domain object.protected OptionType.InputType
protected String
protected Boolean
these fields are for indicating a field is input for a local credentialprotected Long
protected Long
protected Long
protected Long
protected Boolean
to support multitenant check in gspprotected String
protected Boolean
protected String
protected String
protected String
protected Boolean
protected String
protected Boolean
protected String
Controls when this optionType is indicated as required on the form Format is 'fieldName:regex'.protected Boolean
protected Boolean
protected Boolean
protected Boolean
protected Boolean
protected String
protected String
protected String
protected String
Controls when this optionType is visible Format is 'fieldName:regex'.protected String
protected String
Fields inherited from class com.morpheusdata.model.MorpheusModel
config, id
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCode()
Gets the Unique code representation of the option type.Returns a String representation of the default value for the current Input.Gets the code of an option type that this option type depends on.Convenience method for binding data, seegetDependsOn
Gets the display order position of the following Option Type.Specifies if this option type is visible on resource detail views.Specifies whether this option type is editable on edit.Gets the field context which is the primary object the field is being saved onto.Gets the field group which is the name that is used to group fields together in the user interface.Convenience method for binding data, seegetFieldGroupI18nCode
Gets the field label of the current Option Type.Gets the field name of the current option type.Convenience method for binding data, seegetHelpTextI18nCode
Gets the help text pertaining to an input.Gets the type of Input this option type represents.getName()
Gets the option source api method endpoint to hit when using theOptionType.InputType.SELECT
option.Convenience method for binding data, seegetPlaceHolderText
Gets an inputs placeholder text for helpful display when awaiting input on a field.Gets the required flag off of the option type.Specifies whether this option type is visible on create forms.Specifies if this option type is visible on edit forms.getUuid()
returns the uuidvoid
setAccount
(Account account) void
setAddTemplate
(String addTemplate) void
setAdvanced
(Boolean advanced) void
setApiList
(String apiList) void
setBlockCLass
(String blockCLass) void
setCategory
(String category) void
Sets the Unique code representation of the option type.void
setContextualDefault
(Boolean contextualDefault) void
setConversionType
(String conversionType) void
setCreatable
(Boolean creatable) void
void
setDefaultValue
(String defaultValue) Sets a String representation of the default value for the current Input.void
setDependsOn
(String dependsOn) Sets the code of an option type that this option type depends on.void
setDependsOnCode
(String dependsOn) Convenience method for binding data, seesetDependsOn
void
setDisplayOrder
(Integer displayOrder) Sets the display order position of the following Option Type.void
setDisplayValueOnDetails
(Boolean displayValueOnDetails) Sets if this option type is visible on resource detail views.void
setEditable
(Boolean editable) Sets whether or not this option type is editable.void
setEditTemplate
(String editTemplate) void
setEnabled
(Boolean enabled) void
setEvarName
(String evarName) void
setExcludeFromSearch
(Boolean excludeFromSearch) void
setExportEvar
(Boolean exportEvar) void
setExportMeta
(Boolean exportMeta) void
setFieldAddOn
(String fieldAddOn) void
setFieldClass
(String fieldClass) void
setFieldCode
(String fieldCode) void
setFieldComponent
(String fieldComponent) void
setFieldCondition
(String fieldCondition) void
setFieldContext
(String fieldContext) Sets the field context which is the primary object the field is being saved onto.void
setFieldEvar
(String fieldEvar) void
setFieldGetContext
(String fieldGetContext) void
setFieldGetName
(String fieldGetName) void
setFieldGroup
(String fieldGroup) Sets the field group which is the name that is used to group fields together in the user interface.void
setFieldGroupCode
(String fieldGroupI18nCode) Convenience method for binding data, seesetFieldGroupI18nCode
void
setFieldGroupI18nCode
(String fieldGroupI18nCode) void
setFieldInput
(String fieldInput) void
setFieldLabel
(String fieldLabel) Sets the field label of the current Option Type.void
setFieldName
(String fieldName) Sets the field name of the current option type.void
setFieldSet
(String fieldSet) void
setFieldSetContext
(String fieldSetContext) void
setFieldSetName
(String fieldSetName) void
setFieldSize
(Integer fieldSize) void
void
setFormField
(Boolean formField) void
void
setGroupExpand
(Boolean groupExpand) void
setHelpBlock
(String helpText) void
setHelpBlockCode
(String helpTextI18nCode) Convenience method for binding data, seesetHelpTextI18nCode
void
setHelpText
(String helpText) Gets the help text pertaining to an input.void
setHelpTextI18nCode
(String helpTextI18nCode) void
setIdTemplate
(String idTemplate) void
setIgnoreField
(Boolean ignoreField) void
setInputType
(OptionType.InputType inputType) Sets the type of Input this option type represents.void
setLabelClass
(String labelClass) void
setLocalCredential
(Boolean localCredential) void
setMaxLength
(Long maxLength) void
void
setMinLength
(Long minLength) void
void
setMultiTenant
(Boolean multiTenant) void
void
setNoBlank
(Boolean noBlank) void
setNoSelection
(String noSelection) void
setOptionSource
(String optionSource) Sets the option source api method endpoint to hit when using theOptionType.InputType.SELECT
option.void
setOptionSourceType
(String optionSourceType) void
setOwnerEditable
(Boolean ownerEditable) void
setPlaceHolder
(String placeHolderText) Convenience method for binding data, seesetPlaceHolderText
void
setPlaceHolderText
(String placeHolderText) Sets an inputs placeholder text for helpful display when awaiting input on a field.void
setRequired
(Boolean required) Sets the required flag off of the option type.void
setRequireOnCode
(String requireOnCode) void
setSecretField
(Boolean secretField) void
setShowOnCreate
(Boolean showOnCreate) Sets whether or not this option type is visible on create forms.void
setShowOnEdit
(Boolean showOnEdit) Sets if this option type is visible on edit forms.void
setTenantEditable
(Boolean tenantEditable) void
setTenantVisible
(Boolean tenantVisible) void
Sets the uuid.void
setVerifyPattern
(String verifyPattern) void
setViewTemplate
(String viewTemplate) void
setVisibleOnCode
(String visibleOnCode) void
setWrapperClass
(String wrapperClass) void
setWrapperSelector
(String wrapperSelector) Methods inherited from class com.morpheusdata.model.MorpheusModel
getConfig, getConfigMap, getConfigProperty, getDirtyProperties, getDirtyPropertyValues, getId, getProperties, isDirty, markClean, markDirty, markDirty, setConfig, setConfigMap, setConfigProperty, setId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.morpheusdata.model.IModelCodeName
getId
-
Field Details
-
account
-
name
-
code
-
category
-
required
-
editable
-
enabled
-
uuid
-
noSelection
-
minVal
-
maxVal
-
minLength
-
maxLength
-
fieldContext
-
fieldClass
-
fieldLabel
-
fieldCode
-
fieldName
-
fieldGetName
-
fieldSetName
-
fieldGetContext
-
fieldSetContext
-
fieldInput
-
fieldSize
-
fieldSet
-
fieldCondition
-
fieldAddOn
-
fieldEvar
-
fieldComponent
-
fieldGroup
-
fieldGroupI18nCode
-
labelClass
-
blockCLass
-
wrapperClass
-
wrapperSelector
-
inputType
-
displayOrder
-
placeHolderText
-
defaultValue
-
helpText
-
helpTextI18nCode
-
optionSourceType
-
optionSource
-
dependsOn
-
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
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
-
displayValueOnDetails
-
showOnCreate
-
verifyPattern
-
format
-
evarName
-
conversionType
-
viewTemplate
-
editTemplate
-
addTemplate
-
idTemplate
-
apiList
-
ownerEditable
-
tenantEditable
-
tenantVisible
-
creatable
-
global
-
custom
-
advanced
-
exportEvar
-
exportMeta
-
groupExpand
-
noBlank
-
contextualDefault
-
secretField
-
excludeFromSearch
-
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
this field is for form functionality only, will not save to the domain object. -
localCredential
these fields are for indicating a field is input for a local credential -
multiTenant
to support multitenant check in gsp
-
-
Constructor Details
-
OptionType
public OptionType()
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceIModelCodeName
-
setName
-
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 interfaceIModelCodeName
- Returns:
- unique String code identifier for this particular Option Type
-
setCode
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
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
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
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
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
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
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
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
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
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 angetOptionSource()
.- Returns:
- the type of input this option type correlates to.
-
setInputType
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 angetOptionSource()
.- Parameters:
inputType
- the type of input this option type correlates to.
-
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
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
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
Convenience method for binding data, seegetPlaceHolderText
-
setPlaceHolderText
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
Convenience method for binding data, seesetPlaceHolderText
-
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
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
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
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
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
-
setHelpText
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
-
getOptionSource
Gets the option source api method endpoint to hit when using theOptionType.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
Sets the option source api method endpoint to hit when using theOptionType.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
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
Convenience method for binding data, seegetDependsOn
-
setDependsOn
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
Convenience method for binding data, seesetDependsOn
-
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
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
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
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
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
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
-
setFieldClass
-
getLocalCredential
-
setLocalCredential
-
getDisplayValueOnDetails
Specifies if this option type is visible on resource detail views.- Returns:
- determines if this option type is visible upon edit
-
setDisplayValueOnDetails
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
-
setCategory
-
getEnabled
-
setEnabled
-
getUuid
returns the uuid- Specified by:
getUuid
in interfaceIModelUuidCodeName
- Returns:
- the uuid of the current record
-
setUuid
Sets the uuid. In this class this should not be called directly- Parameters:
uuid
- the uuid of the current record
-
getNoSelection
-
setNoSelection
-
getMinVal
-
setMinVal
-
getMaxVal
-
setMaxVal
-
getMinLength
-
setMinLength
-
getMaxLength
-
setMaxLength
-
getFieldCode
-
setFieldCode
-
getFieldGetName
-
setFieldGetName
-
getFieldSetName
-
setFieldSetName
-
getFieldGetContext
-
setFieldGetContext
-
getFieldSetContext
-
setFieldSetContext
-
getFieldInput
-
setFieldInput
-
getFieldSize
-
setFieldSize
-
getFieldSet
-
setFieldSet
-
getFieldCondition
-
setFieldCondition
-
getFieldAddOn
-
setFieldAddOn
-
getFieldEvar
-
setFieldEvar
-
getFieldComponent
-
setFieldComponent
-
getFieldGroupI18nCode
-
getFieldGroupCode
Convenience method for binding data, seegetFieldGroupI18nCode
-
setFieldGroupI18nCode
-
setFieldGroupCode
Convenience method for binding data, seesetFieldGroupI18nCode
-
getLabelClass
-
setLabelClass
-
getBlockCLass
-
setBlockCLass
-
getWrapperClass
-
setWrapperClass
-
getWrapperSelector
-
setWrapperSelector
-
getHelpTextI18nCode
-
getHelpBlockCode
Convenience method for binding data, seegetHelpTextI18nCode
-
setHelpTextI18nCode
-
setHelpBlockCode
Convenience method for binding data, seesetHelpTextI18nCode
-
getOptionSourceType
-
setOptionSourceType
-
getRequireOnCode
-
setRequireOnCode
-
getVisibleOnCode
-
setVisibleOnCode
-
getVerifyPattern
-
setVerifyPattern
-
getFormat
-
setFormat
-
getEvarName
-
setEvarName
-
getConversionType
-
setConversionType
-
getViewTemplate
-
setViewTemplate
-
getEditTemplate
-
setEditTemplate
-
getAddTemplate
-
setAddTemplate
-
getIdTemplate
-
setIdTemplate
-
getApiList
-
setApiList
-
getOwnerEditable
-
setOwnerEditable
-
getTenantEditable
-
setTenantEditable
-
getTenantVisible
-
setTenantVisible
-
getCreatable
-
setCreatable
-
getGlobal
-
setGlobal
-
getCustom
-
setCustom
-
getAdvanced
-
setAdvanced
-
getExportEvar
-
setExportEvar
-
getExportMeta
-
setExportMeta
-
getGroupExpand
-
setGroupExpand
-
getNoBlank
-
setNoBlank
-
getContextualDefault
-
setContextualDefault
-
getSecretField
-
setSecretField
-
getExcludeFromSearch
-
setExcludeFromSearch
-
getIgnoreField
-
setIgnoreField
-
getMultiTenant
-
setMultiTenant
-
getAccount
-
setAccount
-
getFormField
-
setFormField
-