Package com.morpheusdata.core.providers
Interface FormProvider
- All Superinterfaces:
PluginProvider
Provides support for defining custom forms with validation and submission
logic.
This interface allows plugins to create custom forms with server-side
validation
and processing capabilities.
- Since:
- 1.2.6
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.morpheusdata.core.providers.PluginProvider
PluginProvider.ConfigurationDriftCheckFacet<T>, PluginProvider.EventSubscriberFacet<E extends Event>, PluginProvider.UpdateFacet<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns a description of this form's purposedefault Collection<OptionTypeFieldGroup>Provides the collection of OptionTypeFieldGroup objects that define groupings for form fields.Provides the collection of OptionType fields that make up this formReturns the display name for this formdefault booleanDetermines whether the specified user has permission to access this form.default MapprepareFormData(Map data, Map opts) Optional method to transform or prepare form data before validation.submitForm(Map data, Map opts) Processes and submits the form data after successful validation.validateForm(Map data, Map opts) Validates the submitted form data before processing.Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getMorpheus, getName, getPlugin
-
Method Details
-
getFormName
String getFormName()Returns the display name for this form- Returns:
- form display name
-
getFormDescription
Returns a description of this form's purpose- Returns:
- form description
-
hasAccess
Determines whether the specified user has permission to access this form. This method allows providers to implement custom authorization logic based on user roles, permissions, or other criteria.- Parameters:
user- the user to check access for- Returns:
- true if the user can access this form, false otherwise
-
getFormFields
Collection<OptionType> getFormFields()Provides the collection of OptionType fields that make up this form- Returns:
- Collection of OptionType inputs for the form
-
getFormFieldGroups
Provides the collection of OptionTypeFieldGroup objects that define groupings for form fields. Field groups allow organizing related fields together in the UI with collapsible sections and custom headings.- Returns:
- Collection of OptionTypeFieldGroup for the form, or null/empty if no groups are defined
-
validateForm
Validates the submitted form data before processing. This method should check all required fields, data formats, business rules, etc.- Parameters:
data- the form data submitted by the useropts- additional options or context for validation- Returns:
- ServiceResponse containing validation results. If validation fails, the response should contain error messages explaining what went wrong.
-
submitForm
Processes and submits the form data after successful validation. This method will only be called if validateForm() returns a successful response.- Parameters:
data- the form data to processopts- additional options or context for submission- Returns:
- ServiceResponse containing the result of the form submission, including any data that should be returned to the caller
-
prepareFormData
Optional method to transform or prepare form data before validation. This can be used to normalize data, set defaults, or perform conversions.- Parameters:
data- the raw form dataopts- additional options or context- Returns:
- the prepared form data
-