Usages
Used to provide additional option to create new App in 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
Method Detail
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 new app
- request - Http Servlet Request
Plugin Properties Options
Please refer to Plugin Properties Options for more information.
Sample Implementation of 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;
}