AssignmentManager

Chromium has a more strict CORS policy. Therefore the Javascript execution from another domain to attempt to set the session cookie to the Joget domain has been blocked.


completeAssignment(baseUrl, activityId, redirect)

Description

描述

ลักษณะ


Completes an assignment with a specific process instance id & activity instance id

用特定流程实例ID和活动实例ID完成分配

ดำเนินการมอบหมายให้เสร็จสมบูรณ์ด้วยรหัสอินสแตนซ์กระบวนการเฉพาะและรหัสกิจกรรมอินสแตนซ์


Parameters

参数

พารามิเตอร์

Sample code  

示例代码

โค้ดตัวอย่าง

 AssignmentManager.completeAssignment('http://localhost/jw', '1_1_activity', 'http://localhost/completed.jsp');

completeAssignmentWithVariable(baseUrl, activityId, variableData, redirect)

Description

描述

ลักษณะ


Completes an assignment with a specific process instance id & activity instance id with option to set workflow variables

使用特定流程实例标识和活动实例标识完成分配,并带有用于设置工作流程变量的选项

ดำเนินการมอบหมายให้เสร็จสิ้นด้วย id อินสแตนซ์กระบวนการเฉพาะและ ID อินสแตนซ์กิจกรรมพร้อมตัวเลือกในการตั้งค่าตัวแปรเวิร์กโฟลว์


Parameters

参数

พารามิเตอร์


Sample code  

示例代码  

โค้ดตัวอย่าง

AssignmentManager.completeAssignmentWithVariable('http://localhost/jw', '1_1_activity', 'var_status=new&var_id=123', 'http://localhost/completed.jsp');

getCurrentUsername(baseUrl, callback)

Description

描述

ลักษณะ


Gets the current logged in username in Joget Workflow

获取Joget Workflow中当前登录的用户名

รับชื่อผู้ใช้ที่ล็อกอินปัจจุบันใน Joget Workflow


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //response.username
        if(response.username != "roleAnonymous"){
            console.log("Username is " + response.username);
        }else{
            console.log("User is anonymous");
        }
    }
};
AssignmentManager.getCurrentUsername('http://localhost/jw', callback);

login(baseUrl, username, password, callback)

Description

描述

ลักษณะ


Login the user in Joget Workflow

获取Joget Workflow中当前登录的用户名(正常登录)

เข้าสู่ระบบผู้ใช้ใน Joget Workflow


Parameters

参数

พารามิเตอร์

Sample code  

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //response.username && response.isAdmin
        if(response.username != "roleAnonymous"){
            console.log("username (" + response.username + ") is " + ((response.isAdmin !== undefined && response.isAdmin === "true")?"admin":"not an admin"));
        }else{
            console.log("Fail to login user!");
        }
    }
};
AssignmentManager.login('http://localhost/jw', 'admin', 'admin', callback);

loginWithHash(baseUrl, username, hash, callback)

Description

描述

ลักษณะ


Login the user with hash in Joget Workflow

获取Joget Workflow中当前登录的用户名 (使用Hash 密码)

ล็อกอินผู้ใช้ด้วยแฮชใน Joget Workflow


Parameters

参数

พารามิเตอร์

Sample code  

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //response.username && response.isAdmin
        if(response.username != "roleAnonymous"){
            console.log("username (" + response.username + ") is " + ((response.isAdmin !== undefined && response.isAdmin === "true")?"admin":"not an admin"));
        }else{
            console.log("Fail to login user!");
        }
    }
};
AssignmentManager.loginWithHash('http://localhost/jw', 'admin', '14ACD782DCFEB2BCDE2B271CCD559477', callback);

logout(baseUrl)

Description

描述

ลักษณะ


Logs out the current logged in username in Joget Workflow

登出

ล็อกเอาท์ชื่อผู้ใช้ที่ล็อกอินปัจจุบันใน Joget Workflow


Parameters

参数

พารามิเตอร์

Sample code  

示例代码  

โค้ดตัวอย่าง

AssignmentManager.logout('http://localhost/jw');

withdrawAssignment(baseUrl, activityId)

Description

描述

ลักษณะ


Withdraws an assignment with a specific activity instance id

撤销具有特定活动实例ID的分配

ถอนการมอบหมายด้วย id อินสแตนซ์กิจกรรมเฉพาะ

Deprecated since v3, the concept of accept & withdraw assignment is removed. 

已弃用  自v3接受和撤销分配的概念被删除。 

เลิกใช้ตั้งแต่ v3 แนวคิดการยอมรับและถอนการมอบหมายจะถูกลบออก


Parameters

参数

พารามิเตอร์

Sample code  

示例代码  

โค้ดตัวอย่าง

AssignmentManager.withdrawAssignment('http://localhost/jw', '1_1_activity');

ConnectionManager

ajaxJsonp(url, callback, params)

Description

描述

ลักษณะ


Initiates Ajax call with JSONP

用JSONP启动Ajax调用

เริ่มต้นการโทร Ajax ด้วย JSONP


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //do something
    }
};
ConnectionManager.ajaxJsonp('http://localhost/test', callback, 'id=4&name=test');

get(url, callback, params, xss)

Description

描述

ลักษณะ


Initiates Ajax GET to a specific URL

启动Ajax GET 到特定的URL

เริ่ม Ajax GET เป็น URL เฉพาะ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //do something
    }
};
ConnectionManager.get('http://localhost/test', callback, 'id=6&name=test', false);

post(url, callback, params)

Description

描述

ลักษณะ


Initiates Ajax POST to a specific URL

启动Ajax POST到特定的URL

เริ่ม Ajax POST เป็น URL เฉพาะ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var callback = {
    success : function(response){
        //do something
    }
};
ConnectionManager.post('http://localhost/test', callback, 'id=6&name=test');

FormUtil

getField(fieldId)

Description

描述

ลักษณะ


Used to gets the field object of a form field

用于获取表单字段的字段对象

วัตถุเขตข้อมูลที่ใช้ในการรับเขตข้อมูลแบบฟอร์ม


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var field = FormUtil.getField("field1");
$(field).val("test"); //set value

getFieldsAsUrlQueryString(fields)

Description

描述

ลักษณะ


Used to generates the fields value as url query parameter string

用于生成字段值作为url查询参数字符串

ใช้เพื่อสร้างค่าฟิลด์เป็นสตริงพารามิเตอร์เคียวรี url


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var fields = [
    {"field":"field1", "param":"p_field1"},
    {"field":"field2", "param":"p_field2"},
    {"field":"field3", "param":"p_field3", "defaultValue":"default value"},
];
 
var queryString = FormUtil.getFieldsAsUrlQueryString(fields);
console.log(queryString); //p_field1=Field1%20value&p_field2=Field2%20value;Field2%20second%20value&p_field3=default%20value

getGridCells(cellFieldId)

Description

描述

ลักษณะ


Used to gets the cell objects of every rows of a grid field

用于获取grid字段每一行的单元格对象

วัตถุเซลล์ที่ใช้เพื่อรับฟิลด์กริดแต่ละแถว


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var cells = FormUtil.getGridCells("gridId.field1");
$(cells).each(function(){
    //do something
});

getGridCellValues(cellFieldId)

Description

描述

ลักษณะ


Used to gets the cell values of every rows of a grid field and return it in an array.

用于获取Grid字段每一行的单元格值并将其返回到数组中。

ใช้เพื่อรับค่าเซลล์ของแต่ละแถวของเขตข้อมูลกริดและส่งกลับไปยังอาร์เรย์


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var values = FormUtil.getGridCellValues("gridId.field1");
for (var i = 0; i < values.length; i++) {
    console.log(values[i]); //i equals to row number start from 0
}

getValue(fieldId)

Description

描述

ลักษณะ


Used to gets the value of a form field. 

用于获取表单字段的值。 

ใช้เพื่อรับค่าของเขตข้อมูลฟอร์ม


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var value = FormUtil.getValue("field1");

getValues(fieldId)

Description

描述

ลักษณะ


Used to gets the values of a form field. Values will return in an array. 

用于获取表单域的值。值将返回一个数组。

ใช้เพื่อรับค่าของเขตข้อมูลฟอร์ม ค่าจะส่งคืนอาร์เรย์


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var values = FormUtil.getValues("field1");
for (var i = 0; i < values.length; i++) {
    console.log(values[i]); 
}

JPopup

create(id, title, width, height)

Description

描述

ลักษณะ


Used to creates a popup dialog element.

用于创建一个弹出对话框元素。

ใช้เพื่อสร้างองค์ประกอบการโต้ตอบป๊อปอัพ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

JPopup.create("testPopup", "Test Popup Dialog");

hide(id)

Used to hides a created and shown popup dialog element.

用于隐藏创建并显示的弹出对话框元素。

ใช้เพื่อซ่อนองค์ประกอบไดอะล็อกป๊อปอัพที่สร้างและแสดง


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

JPopup.hide("testPopup");

show(id, url, params, title, width, height, action)

Description

描述

ลักษณะ


Used to creates a popup dialog element.

用于创建一个弹出对话框元素。

ใช้เพื่อสร้างองค์ประกอบการโต้ตอบป๊อปอัพ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var params = {
    id : "1",
    name : "test"
};
 
JPopup.show("testPopup", "http://www.joget.org", params);

UI

adjustPopUpDialog(dialogbox)

Description

描述

ลักษณะ


Used by system to align the popup dialog to the center of the screen.

系统用来将弹出对话框对准屏幕中心。

ระบบจะใช้เพื่อจัดตำแหน่งกล่องโต้ตอบป็อปอัพให้ตรงกลางของหน้าจอ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

UI.adjustPopUpDialog(JPopup.dialogboxes["testPopup"]);

escapeHTML(content)

Description

描述

ลักษณะ


Used to escapes HTML syntax in a value

用于在值中转义HTML语法

ใช้เพื่อหลบหนีไวยากรณ์ HTML ในค่า


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var content = "<p>test content</p>";
var escapedContent = UI.escapeHTML(content);
console.log(escapedContent); // &lt;p&gt;test content&lt;/p&gt;

getPopUpHeight(height)

Description

描述

ลักษณะ


Used by the system to calculate the height of a popup dialog for current screen size to support mobile device.

系统用于计算当前屏幕大小的弹出对话框的高度以支持移动设备

ระบบใช้ในการคำนวณความสูงของกล่องโต้ตอบป็อปอัพของขนาดหน้าจอปัจจุบันเพื่อรองรับอุปกรณ์มือถือ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var height = UI.getPopUpHeight("500px");

getPopUpWidth(width)

Description

描述

ลักษณะ


Used by the system to calculate the width of a popup dialog for current screen size to support mobile device.

系统用于计算当前屏幕大小的弹出对话框的宽度以支持移动设备。

ระบบใช้ในการคำนวณความกว้างของกล่องโต้ตอบป็อปอัพของขนาดหน้าจอปัจจุบันเพื่อรองรับอุปกรณ์มือถือ


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var width = UI.getPopUpWidth("800px");

userviewThemeParams()

Description

描述

ลักษณะ


Used by system to gets the query parameters string that contains the meta of current userview theme in used.

系统使用它来获取包含当前userview主题的meta元素的查询参数字符串。

ระบบใช้เพื่อรับสตริงพารามิเตอร์เคียวรีที่มีองค์ประกอบเมตาของธีม userview ปัจจุบัน

Sample code 

示例代码  

โค้ดตัวอย่าง

var url = "http://localhost/jw/form/embed?" + UI.userviewThemeParams();

UrlUtil

constructUrlQueryString(params)

Description

描述

ลักษณะ


Used to generate a query string based on a parameters object

用于基于参数对象生成查询字符串

ใช้เพื่อสร้างสตริงแบบสอบถามตามวัตถุพารามิเตอร์


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var params = {
    "name" : ["joget"],
    "email" : ["info@joget.org", "test@joget.org"]
};
var queryString = UrlUtil.constructUrlQueryString(params);
console.log(queryString); // name=joget&email=info%40joget%2Eorg&email=test%40joget%2Eorg

encodeUrlParam(url)

Description

描述

ลักษณะ


Used to encodes the URL parameters in a URL.

用于在URL中 编码URL参数

ใช้เพื่อเข้ารหัสพารามิเตอร์ URL ใน URL


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var url = "http://localhost/jw/test?name=joget&email=info@jogte.org&email=test@joget.org";
 
var encodedUrl = UrlUtil.encodeUrlParam(url);
console.log(encodedUrl); // http://localhost/jw/test?name=joget&email=info%40joget%2Eorg&email=test%40joget%2Eorg

getUrlParams(url)

Description

描述

ลักษณะ


Used to gets an object contains all parameter as attribute name and its value in an URL. 

用于获取包含所有参数的对象作为属性名称及其在URL中的值 

ใช้เพื่อรับวัตถุที่มีพารามิเตอร์ทั้งหมดเป็นชื่อของแอตทริบิวต์และค่าใน URL


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var url = "http://localhost/jw/test?name=joget&email=info@jogte.org&email=test@joget.org";
 
var params = UrlUtil.getUrlParams(url);
console.log(params); // {"name" : ["joget"], "email" : ["info@joget.org", "test@joget.org"]}

mergeRequestQueryString(queryString1, queryString2)

Description

描述

ลักษณะ


Used to merge 2 URL query parameters strings into one query string.

用于将2个URL查询参数字符串合并到一个查询字符串中。

ใช้เพื่อรวมสตริงพารามิเตอร์การสืบค้น URL 2 รายการเป็นหนึ่งสตริงการสืบค้น


Parameters

参数

พารามิเตอร์

Sample code 

示例代码  

โค้ดตัวอย่าง

var q1 = "name=joget&email=info@jogte.org&email=test@joget.org";
var q2 = "name=joget team&phone=012345678";
 
var queryString = UrlUtil.mergeRequestQueryString(q1, q2);
console.log(queryString); // name=joget%20team&email=info%40joget%2Eorg&email=test%40joget%2Eorg&phone=012345678