Interface StructureGenerator
- All Known Subinterfaces:
ActionHandlingGenerator<T>
,ActionHandlingGenerator.Extender
,ActionHandlingGenerator.Grouper
,ActionHandlingGenerator.Inserter
,ActionHandlingGenerator.Sorter
,ConfigurableGenerator
,StructureGenerator.Extender
,StructureGenerator.Filter
,StructureGenerator.Grouper
,StructureGenerator.Inserter
,StructureGenerator.Sorter
- All Known Implementing Classes:
AbstractGenerator
,AbstractGenerator.Extender
,AbstractGenerator.Filter
,AbstractGenerator.Grouper
,AbstractGenerator.Inserter
,AbstractGenerator.Sorter
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
An implementor inserts new items into the containing structure.static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDefaultFormParameters
(Map<String, Object> form) Fills the parameter map for the edit form Velocity template with default values for a new generator item of this type.void
Given the generator-specific parameters, fills the parameter map for the summary Velocity template.void
Given the generator-specific parameters, fills the parameter map for the edit form Velocity template.buildParametersFromForm
(Map<String, Object> form, ErrorCollection errors) Validates the parameters from the edit HTML form and constructs a serializable map of generator-specific parameters.boolean
Checks if this generator is currently available in the Automation menu on UI.
-
Method Details
-
addDefaultFormParameters
void addDefaultFormParameters(@NotNull Map<String, Object> form) throws GeneratorUnavailableExceptionFills the parameter map for the edit form Velocity template with default values for a new generator item of this type.- Parameters:
form
- form template parameters (output)- Throws:
GeneratorUnavailableException
- if the operation cannot be performed
-
addParametersToForm
void addParametersToForm(@NotNull Map<String, Object> parameters, @NotNull Map<String, throws GeneratorUnavailableExceptionObject> form) Given the generator-specific parameters, fills the parameter map for the edit form Velocity template.- Parameters:
parameters
- generator parameters (input)form
- edit form template parameters (output)- Throws:
GeneratorUnavailableException
- if the operation cannot be performed
-
buildParametersFromForm
@NotNull Map<String,Object> buildParametersFromForm(@NotNull Map<String, Object> form, @NotNull ErrorCollection errors) throws GeneratorUnavailableExceptionValidates the parameters from the edit HTML form and constructs a serializable map of generator-specific parameters.
Any errors for invalid input parameters must be reported to the provided
ErrorCollection
; if it contains any error messages after this method is called, they are reported to the user and the resulting map is ignored.The resulting parameter map could be stored in the database or transferred over the wire, so it must be serializable to JSON. We advise that you put in only simple objects (strings, numbers, booleans), serializable maps, or lists thereof.
- Parameters:
form
- the parameters from the edit HTML form (input)errors
- the collector for error messages (output)- Returns:
- serializable map of generator-specific parameters
- Throws:
GeneratorUnavailableException
- if the operation cannot be performed
-
addParametersForSummary
void addParametersForSummary(@NotNull Map<String, Object> parameters, @NotNull Map<String, Object> summaryParameters) Given the generator-specific parameters, fills the parameter map for the summary Velocity template.
- Parameters:
parameters
- generator parameters (input)summaryParameters
- summary template parameters (output)
-
isAvailable
boolean isAvailable()Checks if this generator is currently available in the Automation menu on UI.
For example, a generator can be unavailable when a certain plug-in is missing, or a certain application feature is disabled.
Note that Structure doesn't stop work of existing generator items if the generator is unavailable. Structure only hides the generator from the Automation menu so users can't create new items from UI.
- Returns:
- true if the generator must be available in the Automation menu
-