Fluent builder for a JsTableActionHandler, exposed to app and library JS code as controllerMappings.newTableActionHandlerBuilder(). Set an id, title, description and any configuration fields, name the JS functions that implement the lifecycle hooks you need, then call build() to construct the handler and register it as one of the table uploader actions available in the app.

Group: Builders

Extends: AbstractFieldsBuilder


Properties

PropertyReturnsDescription
afterFileFnStringName of the JS function currently set to implement afterFile.
afterRowFnStringName of the JS function currently set to implement afterRow.
descriptionStringDescription currently set on this builder.
fieldsList<ExtraField>Configuration fields currently set on this builder.
idStringIdentifier currently set on this builder.
processRowFnStringName of the JS function currently set to implement processRow.
titleStringDisplay title currently set on this builder.
transformFileFnStringName of the JS function currently set to implement transformFile.
validateRowFnStringName of the JS function currently set to implement validateRow.

Methods

build() · id(String id) · title(String title) · description(String description) · transformFileFn(String transformFileFn) · transformRowFn(String transformRowFn) · validateRowFn(String validateRowFn) · processRowFn(String processRowFn) · afterRowFn(String afterRowFn) · afterFileFn(String afterFileFn) · getId() · setId(String id) · getTitle() · setTitle(String title) · getFields() · setFields(List<ExtraField> fields) · getDescription() · setDescription(String description) · getTransformFileFn() · getValidateRowFn() · getProcessRowFn() · getAfterFileFn() · getAfterRowFn()

build()

Returns: JsTableActionHandler

Constructs a JsTableActionHandler from the id, title, fields and JS hook function names set on this builder. If the controller mapping engine has not yet finished initialising, the new handler is also added to its list of table action handlers, making it available for use in table uploaders.

id(String id)

Returns: JsTableActionHandlerBuilder

Sets the unique identifier for the handler being built.

ParameterDescription
idthe handler's identifier

title(String title)

Returns: JsTableActionHandlerBuilder

Sets the display title shown to an admin when choosing this action for a table uploader.

ParameterDescription
titlethe handler's display title

description(String description)

Returns: JsTableActionHandlerBuilder

Sets the description shown for this action.

ParameterDescription
descriptionthe handler's description

transformFileFn(String transformFileFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement transformFile, which runs before validation and can rewrite the whole set of imported rows without making any database changes.

ParameterDescription
transformFileFnthe name of the JS function to invoke

transformRowFn(String transformRowFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement transformRow, which runs before validation and can rewrite a single imported row without making any database changes.

ParameterDescription
transformRowFnthe name of the JS function to invoke

validateRowFn(String validateRowFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement validateRow during the validation phase. The function must not change the database, and should return null if the row is valid or an error message describing the problem.

ParameterDescription
validateRowFnthe name of the JS function to invoke

processRowFn(String processRowFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement processRow during the processing phase (not during validation), where the function is expected to make its database changes for the row.

ParameterDescription
processRowFnthe name of the JS function to invoke

afterRowFn(String afterRowFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement afterRow, invoked once processing of a row has finished.

ParameterDescription
afterRowFnthe name of the JS function to invoke

afterFileFn(String afterFileFn)

Returns: JsTableActionHandlerBuilder

Names the JS function called to implement afterFile, invoked once the whole file has finished processing, with the accumulated import statistics available to it.

ParameterDescription
afterFileFnthe name of the JS function to invoke

getId()

Returns: String

Identifier currently set on this builder.

setId(String id)

Returns: void

Sets the unique identifier for the handler being built.

ParameterDescription
idthe handler's identifier

getTitle()

Returns: String

Display title currently set on this builder.

setTitle(String title)

Returns: void

Sets the display title shown to an admin when choosing this action for a table uploader.

ParameterDescription
titlethe handler's display title

getFields()

Returns: List<ExtraField>

Configuration fields currently set on this builder.

setFields(List<ExtraField> fields)

Returns: void

Replaces the configuration fields set on this builder.

ParameterDescription
fieldsthe configuration fields for the handler being built

getDescription()

Returns: String

Description currently set on this builder.

setDescription(String description)

Returns: void

Sets the description shown for this action.

ParameterDescription
descriptionthe handler's description

getTransformFileFn()

Returns: String

Name of the JS function currently set to implement transformFile.

getValidateRowFn()

Returns: String

Name of the JS function currently set to implement validateRow.

getProcessRowFn()

Returns: String

Name of the JS function currently set to implement processRow.

getAfterFileFn()

Returns: String

Name of the JS function currently set to implement afterFile.

getAfterRowFn()

Returns: String

Name of the JS function currently set to implement afterRow.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.