You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Usages

  • Custom Builder Plugin is used for extends 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 Custom Builder Plugin must extend org.joget.apps.app.model.CustomBuilderAbstract abstract class.

Abstract Class

org.joget.apps.app.model.CustomBuilderAbstract

Method Detail

Abstract Methods
getIcon
public String getIcon();

The unique font awesome icon of the builder. Eg. "fas fa-key".

getColor
public String getColor();

The unique color code of the builder. Eg. "#85ea2d".

getObjectName
public String getObjectName();

The unique shortname of the output definition of the builder. Eg. "api", "report", etc.

getObjectLabel
public String getObjectLabel();

The unique label of the output definition of the builder. Eg. "API", "Report", etc.

getIdPrefix
public String getIdPrefix();

The prefix for created output definition ID.  Eg. "API-", "rp-", etc.

getResourceBundlePath
public String getResourceBundlePath();

The resource bundle file path. The resource bundle message key can be retrieved in the builder javascript using 'get_cbuilder_msg(String key)'.  

getBuilderConfig
public String getBuilderConfig();

The builder configuration in JSON format. Used to configure the builder callback event and the advanced tools available for the builder. Full available configuration as below. Please refer Sample Plugins on how to use this config.

All available configuration
{
    builder : {
        callbacks : { //methods name to call
            initBuilder : "", //call after initialized the builder. 
            load : "", //Call to load the definition JSON
            saveEditProperties : "", //Call after save edit properties event is trigger 
            cancelEditProperties : "" //Call after cancel edit properties event is trigger
        }
    },
    advanced_tools : { //configure the advanced tools available 
        tree_viewer : { //tree viewer to view the tree structure of the definition
            disabled : false, //to disable this tool
            childs_properties : ["elements"], //the property name which hold editable plugins
            matchers : { //matchers to customize the tree viewer
                'sample' : { //sample matcher
                    match : function (viewer, deferreds, node, jsonObj, refObj) {
                        //do something

                        return false;
                    }
                }
            }
        },
        usage : { //to check usage of the definition of this builder
            disabled : false  //to disable this tool
        },
        i18n : { //to provide i18n editor for this builder
            disabled : false, //to disable this tool
            keywords : [ //The property names which allowed for i18n 
                "label"
            ]
        },
        permission : { //to provide permission editor for this builder
            disabled : false, //to disable this tool
            permission_plugin : "org.joget.apps.form.model.FormPermission", //the permission plugin class used for this builder
            authorized : { //configure the authorized section
                property : "", //the property name to store the authorized section value
                default_value : "", //the default value for authorized property
                options : [ //the sample option for authorized section
                    {
                        key : "vissible",
                        value : "",
                        label : get_cbuilder_msg("ubuilder.visible")
                    },
                    {
                        key : "hidden",
                        value : "true",
                        label : get_cbuilder_msg("ubuilder.hidden")
                    }
                ]
            },
            unauthorized : { //configure the unauthorized section
                property : "", //the property name to store the unauthorized section value
                default_value : "", //the default value for unauthorized property
                options : [ //the sample option for unauthorized section
                    {
                        key : "vissible",
                        value : "",
                        label : get_cbuilder_msg("ubuilder.visible")
                    },
                    {
                        key : "hidden",
                        value : "true",
                        label : get_cbuilder_msg("ubuilder.hidden")
                    }
                ]
            },
            element_label_callback : "", //Method name to call for customize the element label
            element_support_plugin : [], //Plugin class name which support permission plugin configuration
            display_element_id : false, //to enable/disable to display the element id beside the element label
            childs_properties : ["elements"], //The property name to loop the child elements(plugins)
            ignore_classes : [], //The plugin class name to skip in the loop of child elements(plugins)
            render_elements_callback : "" //The method name to call to customize the rendering of child elements(plugins)
        },
        customTabsCallback : "" //Method name to call to render additional tabs in Advanced Tools. 
    }
}


Plugin Properties Options

Sample Plugins

  • Page Buider
  • No labels