Create App Option

This plugin provides an additional option for creating a new app on the Create App page.

Interface

org.joget.apps.app.model.CreateAppOption

  • Under wflow-core module
  • An interface class to develop a Create App Option Plugin. 
  • Plugin required to extends org.joget.plugin.base.ExtDefaultPlugin

Interface Methods

getPluginIcon

public String getPluginIcon();
Get the icon for the option.

isAvailable

public Boolean isAvailable();
Whether this option should appear in the Create App page

createAppDefinition

public Collection<String> createAppDefinition(String appId, String appName, HttpServletRequest request);
Create app definition to database. Return errors message if fail to create app definition.

Parameters

      • appId - the app ID of new app
      • appName - the app name of the new app
      • request - HTTP Servlet Request

Plugin Properties Options

Please refer to Plugin Properties Options for more information.

Sample Usage

Below is a sample Implementation of the createAppDefinition Method

@Override
public Collection<String> createAppDefinition(String appId, String appName, HttpServletRequest request) {
    Collection<String> result = new ArrayList<>(); //to keep error messages
     
    //this will create an empty app
    AppDefinition appDef = new AppDefinition();
    appDef.setAppId(appId);
    appDef.setVersion(1l);
    appDef.setId(appId);
    appDef.setName(appName);
    appDef.setPublished(Boolean.FALSE);
    appDef.setDateCreated(new Date());
    appDef.setDateModified(new Date());
    appDefinitionDao.saveOrUpdate(appDef);
 
    return result;
}
 
 
 
Created by Damian Last modified by Aadrian on Dec 13, 2024