Package com.morpheusdata.model
Class OptionType
java.lang.Object
com.morpheusdata.model.MorpheusModel
com.morpheusdata.model.OptionType
- All Implemented Interfaces:
IModelCodeName,IModelUuidCodeName,Serializable
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.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Accountprotected Stringprotected Booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Booleanprotected Stringprotected Booleanprotected Booleanprotected Stringprotected Stringprotected Integerprotected Booleanprotected Booleanprotected Stringprotected Booleanprotected Stringprotected Booleanprotected Booleanprotected Booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Integerprotected Stringprotected BooleanIf this was sourced as a direct input on a form or not.protected Booleanprotected Booleanprotected Stringprotected Stringprotected Stringprotected Booleanthis field is for form functionality only, will not save to the domain object.protected OptionType.InputTypeprotected Stringprotected Booleanthese fields are for indicating a field is input for a local credentialprotected Longprotected Longprotected Longprotected Longprotected Booleanto support multitenant check in gspprotected Stringprotected Booleanprotected Stringprotected Stringprotected Stringprotected Booleanprotected Stringprotected Booleanprotected StringControls when this optionType is indicated as required on the form Format is 'fieldName:regex'.protected Booleanprotected Booleanprotected Booleanprotected Booleanprotected Booleanprotected Stringprotected Stringprotected Stringprotected StringControls when this optionType is visible Format is 'fieldName:regex'.protected Stringprotected StringFields inherited from class com.morpheusdata.model.MorpheusModel
config, id -
Constructor Summary
Constructors -
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, seegetDependsOnGets 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, seegetFieldGroupI18nCodeGets the field label of the current Option Type.Gets the field name of the current option type.Convenience method for binding data, seegetHelpTextI18nCodeGets 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.SELECToption.Convenience method for binding data, seegetPlaceHolderTextGets 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 uuidvoidsetAccount(Account account) voidsetAddTemplate(String addTemplate) voidsetAdvanced(Boolean advanced) voidsetApiList(String apiList) voidsetBlockCLass(String blockCLass) voidsetCategory(String category) voidSets the Unique code representation of the option type.voidsetContextualDefault(Boolean contextualDefault) voidsetConversionType(String conversionType) voidsetCreatable(Boolean creatable) voidvoidsetDefaultValue(String defaultValue) Sets a String representation of the default value for the current Input.voidsetDependsOn(String dependsOn) Sets the code of an option type that this option type depends on.voidsetDependsOnCode(String dependsOn) Convenience method for binding data, seesetDependsOnvoidsetDisplayOrder(Integer displayOrder) Sets the display order position of the following Option Type.voidsetDisplayValueOnDetails(Boolean displayValueOnDetails) Sets if this option type is visible on resource detail views.voidsetEditable(Boolean editable) Sets whether or not this option type is editable.voidsetEditTemplate(String editTemplate) voidsetEnabled(Boolean enabled) voidsetEvarName(String evarName) voidsetExcludeFromSearch(Boolean excludeFromSearch) voidsetExportEvar(Boolean exportEvar) voidsetExportMeta(Boolean exportMeta) voidsetFieldAddOn(String fieldAddOn) voidsetFieldClass(String fieldClass) voidsetFieldCode(String fieldCode) voidsetFieldComponent(String fieldComponent) voidsetFieldCondition(String fieldCondition) voidsetFieldContext(String fieldContext) Sets the field context which is the primary object the field is being saved onto.voidsetFieldEvar(String fieldEvar) voidsetFieldGetContext(String fieldGetContext) voidsetFieldGetName(String fieldGetName) voidsetFieldGroup(String fieldGroup) Sets the field group which is the name that is used to group fields together in the user interface.voidsetFieldGroupCode(String fieldGroupI18nCode) Convenience method for binding data, seesetFieldGroupI18nCodevoidsetFieldGroupI18nCode(String fieldGroupI18nCode) voidsetFieldInput(String fieldInput) voidsetFieldLabel(String fieldLabel) Sets the field label of the current Option Type.voidsetFieldName(String fieldName) Sets the field name of the current option type.voidsetFieldSet(String fieldSet) voidsetFieldSetContext(String fieldSetContext) voidsetFieldSetName(String fieldSetName) voidsetFieldSize(Integer fieldSize) voidvoidsetFormField(Boolean formField) voidvoidsetGroupExpand(Boolean groupExpand) voidsetHelpBlock(String helpText) voidsetHelpBlockCode(String helpTextI18nCode) Convenience method for binding data, seesetHelpTextI18nCodevoidsetHelpText(String helpText) Gets the help text pertaining to an input.voidsetHelpTextI18nCode(String helpTextI18nCode) voidsetIdTemplate(String idTemplate) voidsetIgnoreField(Boolean ignoreField) voidsetInputType(OptionType.InputType inputType) Sets the type of Input this option type represents.voidsetLabelClass(String labelClass) voidsetLocalCredential(Boolean localCredential) voidsetMaxLength(Long maxLength) voidvoidsetMinLength(Long minLength) voidvoidsetMultiTenant(Boolean multiTenant) voidvoidsetNoBlank(Boolean noBlank) voidsetNoSelection(String noSelection) voidsetOptionSource(String optionSource) Sets the option source api method endpoint to hit when using theOptionType.InputType.SELECToption.voidsetOptionSourceType(String optionSourceType) voidsetOwnerEditable(Boolean ownerEditable) voidsetPlaceHolder(String placeHolderText) Convenience method for binding data, seesetPlaceHolderTextvoidsetPlaceHolderText(String placeHolderText) Sets an inputs placeholder text for helpful display when awaiting input on a field.voidsetRequired(Boolean required) Sets the required flag off of the option type.voidsetRequireOnCode(String requireOnCode) voidsetSecretField(Boolean secretField) voidsetShowOnCreate(Boolean showOnCreate) Sets whether or not this option type is visible on create forms.voidsetShowOnEdit(Boolean showOnEdit) Sets if this option type is visible on edit forms.voidsetTenantEditable(Boolean tenantEditable) voidsetTenantVisible(Boolean tenantVisible) voidSets the uuid.voidsetVerifyPattern(String verifyPattern) voidsetViewTemplate(String viewTemplate) voidsetVisibleOnCode(String visibleOnCode) voidsetWrapperClass(String wrapperClass) voidsetWrapperSelector(String wrapperSelector) Methods inherited from class com.morpheusdata.model.MorpheusModel
getConfig, getConfigMap, getConfigProperty, getDirtyProperties, getDirtyPropertyValues, getId, getProperties, isDirty, markClean, markDirty, markDirty, setConfig, setConfigMap, setConfigProperty, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getNamein 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:
getCodein 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.SELECToption. 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.SELECToption. 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:
getUuidin 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
-