Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Sync LDAP User Directory Manager allows one to import user objects from LDAP server on demand into Joget Workflow's built-in user directory manager to reduce its dependency on the LDAP server for improved performance. In this article,  we will learn on how to automatically synchronize LDAP based on a schedule, eliminating the need to perform such action manually.

Thai

Sync LDAP User Directory Manager อนุญาตให้หนึ่งนำเข้าวัตถุผู้ใช้จากเซิร์ฟเวอร์ LDAP ตามความต้องการไปยังตัวจัดการไดเรกทอรีผู้ใช้ในตัวของ Joget Workflow เพื่อลดการพึ่งพาบนเซิร์ฟเวอร์ LDAP เพื่อประสิทธิภาพที่ดียิ่งขึ้น ในบทความนี้เราจะเรียนรู้วิธีการซิงโครไนซ์ LDAP โดยอัตโนมัติตามกำหนดเวลาทำให้ไม่จำเป็นต้องดำเนินการดังกล่าวด้วยตนเอง


This guide requires the scheduler plugin in Joget Marketplace to perform functions based on a schedule. One of the features of the scheduler plugin is that it allows bean shell script to be executed at defined durations, in a form of CRON expressions.

Thai

คู่มือนี้ต้องการปลั๊กอินตัวกำหนดตารางเวลาใน Joget Marketplace เพื่อทำหน้าที่ตามตารางเวลา หนึ่งในคุณสมบัติของปลั๊กอินตัวกำหนดตารางเวลาก็คือมันช่วยให้สามารถดำเนินการสคริปต์เปลือกถั่วตามระยะเวลาที่กำหนดในรูปแบบของ CRON expressions

First, download and import the plugin appended below, into your Joget installation.

Thai

ก่อนอื่นให้ดาวน์โหลดและนำเข้าปลั๊กอินต่อท้ายลงในการติดตั้ง Joget ของคุณ

Scheduler v6 plugin

After importing the plugin, add the scheduler userview element into your userview. Then, define the schedule frequency using CRON expression. Then select the bean shell option in "Plugin" and click on the "Configure Plugin" button, copy and paste the following bean shell code below. The code below is intended and must be used for Sync LDAP User Directory Manager (can be used along with Security Enhanced Directory Manager).

Thai

หลังจากนำเข้าปลั๊กอินให้เพิ่มองค์ประกอบ userview ตัวกำหนดตารางเวลาลงใน userview ของคุณ จากนั้นกำหนดความถี่ของกำหนดการโดยใช้นิพจน์ CRON จากนั้นเลือกตัวเลือกเปลือกถั่วใน "ปลั๊กอิน" และคลิกที่ปุ่ม "กำหนดค่าปลั๊กอิน" คัดลอกและวางรหัสเปลือกถั่วต่อไปนี้ด้านล่าง รหัสด้านล่างมีจุดประสงค์และต้องใช้สำหรับ  Sync LDAP User Directory Manager (สามารถใช้ร่วมกับ Security Enhanced Directory Manager)

Save the record.

Thai

บันทึก record

Code Block
languagejava
linenumberstrue
import org.joget.directory.model.service.DirectoryManagerProxyImpl;
import org.joget.directory.model.service.DirectoryManager;
import org.joget.apps.app.service.AppUtil;
import org.joget.plugin.ldap.SyncLdapUserDirectoryManagerImpl;
import org.joget.plugin.directory.SecureDirectoryManagerImpl;

DirectoryManagerProxyImpl proxy = (DirectoryManagerProxyImpl) AppUtil.getApplicationContext().getBean("directoryManager");
DirectoryManager dm = proxy.getDirectoryManagerImpl();
if (dm != null) {
    if (dm instanceof SecureDirectoryManagerImpl) {
        dm = ((SecureDirectoryManagerImpl) dm).getEdm(1);
    }
    if (dm instanceof SyncLdapUserDirectoryManagerImpl) {
        int total = ((SyncLdapUserDirectoryManagerImpl) dm).syncUsers();
        System.out.println("Total users : " + total);
    }
}

 

 

...