Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Custom Builder Plugin is used for extends to extend the builder feature in addition to the default form, list, userview & process builder.
  • Custom Builder Plugin let app designer build extra definition which auto handles the load/store/merge/export/import by the platform.
  • A useable usable Custom Builder Plugin must extend org.joget.apps.app.model.CustomBuilderAbstract abstract class.

...

Custom Builder Javascript Object

English
Utility methods and fields to use in the builder javascript. 

...

Fields
appId 

The app id of current editing

appVersion 

The app version of current editing

builderType 

The builder object name return by the custom builder plugin

builderLabel 

The builder object label return by the custom builder plugin

json 

The JSON definition of current canvas

data 

The dataobject of current canvas

paletteElements 

The list of palette elements and its properties option and data.

Methods
CustomBuilder.callback(name, args)

To call a method by name

Parameters

    • name - a method name.
    • args - arguments to pass to the method call
CustomBuilder.initConfig(config)

To initialize the builder configuration by the platform

Parameters

    • config - the configuration object.
CustomBuilder.initPropertiesOptions(options)

Methods
CustomBuilder.callback(name, args)

To call a method by name

Parameters

    • name - a method name.
    • args - arguments to pass to the method call
CustomBuilder.initConfig(config)

To initialize the builder configuration by the platform

Parameters

    • config - the configuration object.
CustomBuilder.initPropertiesOptions(options)

To initialize the builder properties tab  by the platform

...

Get the value in CustomBuilder.json.

CustomBuilder.

...

mergeAndSave()

To save the builder JSON definition.

...

To trigger change event to update advance tools

CustomBuilder.updateSaveStatus(mode)

To update the save button status by the undo/redo function

Parameters

    • mode - "+" or "-" to represent undo and redo 
CustomBuilder.showMessage(message)

To fade in a message on top center of the builder

Parameters

    • message - the message to show.
CustomBuilder.getCopiedElement()

To retrieve the current copied element.

Return a object with "type" and "object" attribute. The "object" is the element object.

CustomBuilder.copy(element, type)

To copy an element object to local storage.

Parameters

    • element - the element object to copy
    • type - the type of the element object
CustomBuilder.updatePasteIcon(type)

To enable/disable all paste icons based on the type

Parameters

    • type - the type of the copied element
CustomBuilder.editProperties(elementClass, elementProperties)

To edit the properties of an element

Parameters

    • elementClass - the element plugin class name
    • elementProperties - the element properties to edit
CustomBuilder.uuid()

To generate uuid.

Create Custom Plugin Interface/Abstract Class for Custom Builder

  1. Create a maven project contains only plugin interface, abstract class and APIs. This maven project will share with other developers who want to extend the feature of a custom builder.
  2. Include the maven project as a dependency of the custom builder project.
  3. Modify the custom builder project POM file to adding the package of plugin interface, abstract class and APIs to the <Export-Package>.

    Code Block
    languagejava
    <Export-Package>org.joget.pbuilder,org.joget.pbuilder.api.*</Export-Package>
  4. Register the plugin interface and abstract class in Activator class

    Code Block
    languagejava
    PluginManager.registerCustomPluginInterface(new CustomPluginInterface(PageWidget.class, "pageBuilder.pageWidget", PageBuilder.MESSAGE_PATH));

Sample Plugins

...