...
- [CONTEXT_PATH]/web/json/console/app/[APP_PATH]/forms/options
返回当前应用的所有可用forms。 - [CONTEXT_PATH]/web/json/console/app/[APP_PATH]/datalist/options
返回当前应用的所有可用datalist。 - [CONTEXT_PATH]/web/json/console/app/[APP_PATH]/userview/options
返回当前应用的所有可用userviews。 - [CONTEXT_PATH]/web/property/json/getElements?classname={plugin interface/abstract class name, optional}
Return all available plugins based on the classname filter.
...
- 返回基于类名过滤器的所有可用插件。
内置Javascript 函数 : 'options_callback'
DatalistBuilder.getColumnOptions(properties)
Can be used by plugins related to Datalist Builder. It return all available columns based on binder configuration.
Validator Types
- Page validator is execute during change page.
- All fields data in the same page will pass to the validator for validation.
AJAX
可以使用与Datalist Builder相关的插件。它将根据绑定器配置返回所有可用的列。
验证器类型
- 页面验证器在更改页面中执行。
- 同一页面中的所有字段数据将传递给验证器进行验证。
AJAX
- 调用URL进行验证。
- Call to a URL for validation.
- type : 'AJAX'
- url : An URL return a JSON Object with status (success or fail) & message (JSONArray of String) attribute 一个URL返回具有状态(成功或失败)和消息(StringArray of String)属性的JSON对象
- default_error_message : Optional. A string of error message.
Page Button
- 可选。一串错误消息。
页面按钮
- 页面按钮可以添加到每个页面的底部,以提供额外的功能。例如发送测试电子邮件来测试电子邮件配置或与数据库建立测试连接。
- 页面按钮将从页面和弹出对话框中收集必需的字段数据,并调用AJAX URL。
- name:此按钮的标识符。
- label :按钮的标签。
- ajax_url:执行按钮操作的URL。URL应 返回带有消息(String)属性的JSON对象。
- fields :该按钮将使用的同一页面中的字段数组名称。
- addition_fields:属性字段JSON对象的数组,将在弹出对话框中显示以收集额外的数据。
例:
- Page button can be added on the bottom of each page to provide extra feature. Such as send an test email to test the email configuration or make a test connection to database.
- Page button will collect the required fields data from the page and popup dialog and call an AJAX URL.
- name : Identifier of this button.
- label : Label of the button.
- ajax_url : A URL to execute the button action. The URL should return a JSON Object with message (String) attribute.
- fields : An array of fields name in the same page that will be used by this button.
- addition_fields : An array of Property Field JSON object that will be shown in a popup dialog to collect extra data.
Example:
Code Block language js buttons : [{ name : 'testmail', label : 'Send Test Email', ajax_url : '[CONTEXT_PATH]/web/json/app[APP_PATH]/plugin/org.joget.apps.app.lib.EmailTool/service?action=testmail', fields : ['host', 'port', 'security', 'username', 'password'], addition_fields : [ { name : 'from', label : 'From', type : 'textfield', required : 'True' }, { name : 'toSpecific', label : 'To', type : 'textfield', required : 'True' } ] }]
...
变量
[CONTEXT_PATH]
- 该变量将被当前URL的上下文路径替换。
- 通常用于属性属性值,即URL
- 示例:
- This variable will be replaced by Context Path of current URL.
- Usually used in property attribute value which is URL
- Example : '[CONTEXT_PATH] /web/property/json/getElements?classname=org.joget.apps.form.model.FormValidator'
- Resulted URL : 结果网址:'/jw/web/property/json/getElements?classname=org.joget.apps.form.model.FormValidator'
[APP_PATH]
- 此变量将被当前URL的当前应用程序Id和应用程序版本所替代。
- 通常用于属性属性值,即URL
- 示例
- This variable will be replaced by Current App Id and App Version of current URL.
- Usually used in property attribute value which is URL
- Example : '[CONTEXT_PATH]/web/json/console/app[APP_PATH]/datalist/options'
- Resulted URL 结果URL : '/jw/web/json/console/app/crm/3/datalist/options'
Retrieve Properties Value in Plugin
检索插件中的属性值
- 所有插件必须扩展“orgAll the plugin must extends the "org.joget.plugin.base.ExtDefaultPlugin" abstract class. We can use the ExtDefaultPlugin”抽象类。我们可以使用 "Object getProperty(String)" and 和 "String getPropertyString(String)" method to retrieve the configured properties.
...
- 方法来检索配置的属性
单值字段
| Code Block | ||
|---|---|---|
| ||
String value = getPropertyString("property_name"); |
...
多值字段
| Code Block | ||
|---|---|---|
| ||
String[] values = getPropertyString("property_name").split(";"); |
...
| Code Block | ||
|---|---|---|
| ||
Object columns = getProperty("property_name");
if (columns != null) {
for (Object colObj : (Object[]) columns) {
Map col = (Map) colObj;
String col1_value = (String) opt.get("col1_key");
String col2_value = (String) opt.get("col2_key");
}
} |
...
元素选择框(Element Select
...
Box)
| Code Block | ||
|---|---|---|
| ||
import org.joget.plugin.base.PluginManager;
import org.joget.apps.app.service.AppUtil;
import org.joget.plugin.base.ExtDefaultPlugin;
Object element = getProperty("property_name");
if (element != null && element instanceof Map) {
Map elementMap = (Map) element;
String className = (String) elementMap.get("className");
Map<String, Object> properties = (Map<String, Object>) elementMap.get("properties");
//convert it to plugin
PluginManager pm = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
ExtDefaultPlugin plugin = (ExtDefaultPlugin) pm.getPlugin(className);
if (plugin != null) {
plugin.setProperties(properties);
}
} |
