Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
import org.joget.plugin.base.Plugin; import org.joget.plugin.base.PluginManager; PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager"); //get plugin Plugin plugin = pluginManager.getPlugin("org.joget.apps.form.lib.TextField");
public final static java.lang.String ESCAPE_JAVASCRIPT = "javascript";
Format used by processPluginTranslation method to escape javascript syntax in message.
public java.lang.Object execute(java.lang.String name, java.util.Map properties)
public boolean disable(java.lang.String name)
Disable plugin
public java.lang.String getBaseDirectory()
Retrieves plugin base directory from system setup
public java.lang.Object getBean(java.lang.String beanName)
Gets a class bean from ApplicationContext
public java.util.Set<java.lang.String> getBlackList()
Used by system to retrieves a list of black list plugin classname
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Gets the current Http Request
public java.lang.String getMessage(java.lang.String key, java.lang.String pluginName, java.lang.String translationPath)
Method used to get message from plugin message bundle
public org.joget.plugin.base.Plugin getPlugin(java.lang.String name)
Returns a plugin, from either the OSGI container and the classpath. Plugins from the OSGI container will take priority if there are conflicting classes.
public java.lang.String getPluginFreeMarkerTemplate(java.util.Map data, final java.lang.String pluginName, final java.lang.String templatePath, java.lang.String translationPath)
Method used to gets freemarker template from plugin jar
public java.util.ResourceBundle getPluginMessageBundle(java.lang.String pluginName, java.lang.String translationPath)
Reads a message bundle from a plugin.
public java.io.InputStream getPluginResource(java.lang.String pluginName, java.lang.String resourceUrl) throws java.io.IOException
Retrieves an InputStream to a resource from a plugin. The plugin may either be from OSGI container or system classpath.
public java.net.URL getPluginResourceURL(java.lang.String pluginName, java.lang.String resourceUrl)
Retrieves a URL to a resource from a plugin. The plugin may either be from OSGI container or system classpath.
public java.util.Set<java.lang.String> getScanPackageList()
Used by system to retrieves a list of custom scanning packages
public java.util.Collection<org.joget.plugin.base.Plugin> list(java.lang.Class clazz)
Returns a list of plugins, both from the OSGI container and the classpath. Plugins from the OSGI container will take priority if there are conflicting classes.
Parameters:
clazz - Optional filter for type of plugins to return, null will return all.
public java.util.Collection<org.joget.plugin.base.Plugin> listOsgiPlugin(java.lang.Class clazz)
Returns a list of plugins from the OSGI container only.
Parameters:
clazz - Optional filter for type of plugins to return, null will return all.
public java.util.Map<java.lang.String, org.joget.plugin.base.Plugin> loadPluginMap(java.lang.Class clazz)
Returns a map of plugins with class name as key, both from the OSGI container and the classpath. Plugins from the OSGI container will take priority if there are conflicting classes.
Parameters:
clazz - Optional filter for type of plugins to return, null will return all.
public java.lang.String processPluginTranslation(java.lang.String content, java.lang.String pluginName, java.lang.String translationPath)
Method used to parse the message key to message in a content based on plugin
public java.lang.String processPluginTranslation(java.lang.String content, java.lang.String pluginName, java.lang.String translationPath, java.lang.String escapeType)
Method used to parse the message key to message in a content based on plugin message bundle. Option to escape javascript in the message.
public java.lang.String readPluginResourceAsString(java.lang.String pluginName, java.lang.String resourceUrl, java.lang.Object[] arguments, boolean removeNewLines, java.lang.String translationPath)
Reads a resource from a plugin. java.util.Formatter text patterns supported.
public void refresh()
Find and install plugins from the baseDirectory
public void setBlackList(java.util.Set<java.lang.String> blackList)
Used by system to sets a list of black list plugin classname
public void setScanPackageList(java.util.Set<java.lang.String> scanPackageList)
Used by system to sets a list of custom scanning packages
public java.lang.Object testPlugin(java.lang.String name, java.lang.String location, java.util.Map properties, boolean override)
Method used to test a plugin
public boolean uninstall(java.lang.String name)
Uninstall/remove a plugin, and delete the plugin file
public boolean uninstall(java.lang.String name, boolean deleteFile)
Uninstall/remove a plugin, option to deleting the plugin file
public void uninstallAll(boolean deleteFiles)
Uninstall/remove all plugin, without deleting the plugin file
public boolean upload(java.lang.String filename, java.io.InputStream in)
Install a new plugin