ตั้งค่าเอเจนต์การอิมปอร์ตไฟล์

เอเจนต์การอิมปอร์ตไฟล์เป็นแอปพลิเคชันบรรทัดคำสั่งที่รันในคอมพิวเตอร์ใดๆ และทำหน้าที่เป็นที่มาสำหรับการอิมปอร์ตเนื้อหาจากตำแหน่งของระบบไฟล์ที่มีการตรวจสอบ เช่น โฟลเดอร์หรือเน็ตเวิร์กไดรฟ์ เอเจนต์นี้จะตรวจสอบและบันทึกเนื้อหาในตำแหน่งดังกล่าว และฟีดไปยังตัวประมวลผลการอิมปอร์ตสำหรับการประมวลผลและการกำหนดเส้นทางเพิ่มเติม ตามกฎที่กำหนดไว้ในโปรซีเจอร์

คุณต้องติดตั้งและรันเอเจนต์การอิมปอร์ตไฟล์ในคอมพิวเตอร์ของคุณ เมื่อที่มาของคุณคือ โฟลเดอร์ที่มีการตรวจสอบเท่านั้น (ไม่ใช่แอคเคาท์อีเมล์ที่มีการตรวจสอบ) คุณสามารถใช้ยูทิลิตีบรรทัดคำสั่งของการบันทึกเพื่อช่วยในการรีจิสเตอร์เซิร์ฟเวอร์ คอนฟิเกอร์งานการอิมปอร์ต และแสดงรายการเหล่านี้

ดาวน์โหลดและติดตั้งเอเจนต์การอิมปอร์ตไฟล์

ก่อนอิมปอร์ตไฟล์จากโฟลเดอร์ที่ตรวจสอบ คุณจะต้องติดตั้งเอเจนต์การอิมปอร์ตไฟล์ในคอมพิวเตอร์ของคุณ

ความต้องการของระบบ

เอเจนต์การอิมปอร์ตไฟล์เป็นแอปพลิเคชันจาวาที่ต้องใช้ Oracle JDK เวอร์ชัน 8u251 หรือเวอร์ชันล่าสุดที่มีในขณะที่คุณกำลังจะติดตั้งแอปพลิเคชันนี้ เอเจนต์การอิมปอร์ตไฟล์ใช้ได้กับ Windows, Linux และ Mac (โปรดดู คอนฟิเกอเรชันของระบบที่ผ่านการรับรอง Oracle JDK 8 และ JRE 8)

หากต้องการดาวน์โหลดและติดตั้งเอเจนต์การอิมปอร์ตไฟล์ ให้ทำดังนี้
  1. ล็อกอินเข้าสู่เว็บอินเตอร์เฟซของ Oracle Content Management แล้วคลิก การบันทึก ในช่องการนาวิเกตด้านซ้าย (ในส่วน การดูแลระบบ) หากไม่เห็นตัวเลือกนี้ แสดงว่าคุณไม่มีสิทธิ์เข้าใช้ที่จำเป็น
  2. ในเพจโปรซีเจอร์การบันทึกเนื้อหาในส่วน การดาวน์โหลด ให้คลิก เอเจนต์การอิมปอร์ตไฟล์ Oracle Content Capture เพื่อดาวน์โหลดไฟล์ capture-agent.zip ลงในคอมพิวเตอร์ของคุณ
  3. ดึงข้อมูลไฟล์ซิป
  4. คุณต้องเพิ่ม <agent directory>\bin ลงใน PATH ไดเรคทอรีเอเจนต์เป็นโฟลเดอร์ที่ใช้ดึงข้อมูลไฟล์ capture-agent.zip นอกจากนี้ คุณยังสามารถตั้งค่าตัวแปรสภาพแวดล้อม CAPTURE_HOME ให้กับไดเรคทอรีที่ดึงข้อมูล และเพิ่ม $CAPTURE_HOME\bin ลงใน PATH ได้ด้วย
    บน Mac ให้ทำดังนี้
    sudo ln -s <agent directory>/bin/capture /usr/local/bin/capture

    บน Windows ให้ทำดังนี้

    รันไฟล์ SystemPropertiesAdvanced.exe แล้วแก้ไข ตัวแปรสภาพแวดล้อม แล้วเพิ่ม <agent directory>\bin ลงในตัวแปร PATH

  5. ตั้งค่าตัวแปร CAPTURE_JAVA_HOME เป็นตำแหน่ง JDK ที่ถูกต้อง ซึ่งอาจเป็นตัวแปรสภาพแวดล้อม หรือในไฟล์ <agent directory>/conf/agent.properties

สร้างแอปพลิเคชัน Oracle Identity Cloud Service (IDCS) สำหรับเอเจนต์การอิมปอร์ตไฟล์

เอเจนต์การอิมปอร์ตไฟล์จะโต้ตอบกับ Oracle Content Management เพื่อเรียกคอนฟิเกอเรชันของงานการอิมปอร์ต และอัปโหลดไฟล์ ซึ่งดำเนินการโดยเรียกใช้เว็บเซอร์วิส RESTful API มีการป้องกันโดย OAuth เอเจนต์การอิมปอร์ตไฟล์จึงต้องมีโทเค็น OAuth แอปพลิเคชัน IDCS อนุญาตให้เอเจนต์การอิมปอร์ตไฟล์สร้างโทเค็นเหล่านี้

ในการสร้างแอปพลิเคชัน IDCS ให้ทำดังนี้
  1. ล็อกอินเข้าสู่แผงข้อมูล บริการของฉัน
  2. คลิก Identity Cloud
  3. คัดลอก URL ของอินสแตนซ์บริการ คุณสามารถใช้ URL นี้เพื่อเข้าใช้อินสแตนซ์ Oracle Content Management ของคุณ กล่าวคือ คุณจะใช้เพื่อรีจิสเตอร์เซิร์ฟเวอร์หลังจากที่ติดตั้ง
  4. ในคอนโซล Identity Cloud Service ให้ขยาย ตัวเลื่อนสำหรับการนาวิเกต จากนั้นคลิก แอปพลิเคชัน
  5. คลิก เพิ่ม
  6. ในเพจ เพิ่มแอปพลิเคชัน ให้คลิก แอปพลิเคชันลับ
  7. ในช่อง รายละเอียดแอป ของวินโดว์ เพิ่มแอปพลิเคชันลับ ให้ป้อนชื่อแอปพลิเคชันของคุณและคลิก ถัดไป
  8. เลือก คอนฟิเกอร์แอปพลิเคชันนี้เป็นไคลเอนต์ทันที
  9. ในส่วน การให้สิทธิ์ ให้เลือก เจ้าของทรัพยากร และ การรักษาสิทธิ์ JWT
  10. ในส่วน ข้อกำหนดการออกโทเค็น ให้เลือก ทั้งหมด สำหรับ ทรัพยากรที่ได้รับสิทธิ์ และคลิก ถัดไป
  11. ในแท็บ ทรัพยากร ให้ยอมรับค่าดีฟอลต์และคลิก ถัดไป
  12. ในแท็บ ข้อกำหนดของเว็บเทียร์ ให้ยอมรับค่าดีฟอลต์และคลิก ถัดไป
  13. ในแท็บ การให้สิทธิ์ ให้คลิกค่าดีฟอลต์และคลิก ถัดไป
  14. คลิก เสร็จสิ้น
    คัดลอก ID ไคลเอนต์ และ ข้อมูลลับของไคลเอนต์ คุณต้องใช้ข้อมูลเหล่านี้เมื่อ รีจิสเตอร์เซิร์ฟเวอร์ของคุณกับยูทิลิตีบรรทัดคำสั่งการบันทึก
  15. ในแท็บ คอนฟิเกอเรชัน ให้ขยาย คอนฟิเกอเรชันของไคลเอนต์
  16. เลื่อนลงไปที่ส่วน ข้อกำหนดการออกโทเค็น และคลิก เพิ่มขอบเขต
  17. ในไดอะล็อก เลือกขอบเขต ให้ค้นหาอินสแตนซ์ Oracle Content Management ของคุณและคลิก >
  18. เลือกขอบเขตที่มี URL ซึ่งมี /urn:opc:... จากนั้นคลิก เพิ่ม
  19. คัดลอก URL ของขอบเขต คุณต้องใช้ข้อมูลนี้เมื่อ รีจิสเตอร์เซิร์ฟเวอร์ของคุณกับยูทิลิตีบรรทัดคำสั่งการบันทึก
  20. คลิก บันทึก จากนั้นคลิก เปิดใช้งาน

ระบบจะสร้างแอปพลิเคชัน IDCS ของคุณ คุณสามารถดำเนินการต่อและ รีจิสเตอร์เซิร์ฟเวอร์ของคุณกับยูทิลิตีบรรทัดคำสั่งการบันทึก

รีจีสเตอร์ Oracle Content Management กับเอเจนต์การอิมปอร์ตไฟล์

อินสแตนซ์ Oracle Content Management ของคุณจะต้องมีการรีจิสเตอร์กับยูทิลิตีบรรทัดคำสั่งของการบันทึก เพื่อให้ยูทิลิตีทราบว่าคุณคอนฟิเกอร์งานการอิมปอร์ตใดกับอินสแตนซ์ Oracle Content Management และสามารถอัปโหลดไฟล์ไปยังอินสแตนซ์นี้

ในการรีจีสเตอร์ Oracle Content Management ให้ดำเนินการดังนี้
  1. ดาวน์โหลดและติดตั้งเอเจนต์การอิมปอร์ตไฟล์ ถ้าคุณยังไม่ได้ติดตั้งไว้ในคอมพิวเตอร์ของคุณ
  2. รันคำสั่งต่อไปนี้ในระบบปฏิบัติการ Windows, Linux หรือ Mac:
    $ capture register-server <NAME> --endpoint https://<oracle content management instance name>.oraclecloud.com -u username -p 'password' --idcsurl https://<server name>.identity.oraclecloud.com/oauth2/v1/token --clientid sampleid --clientsecret sample-secret --scope https://<server name>:<port number>/urn:opc:cec:all
    
    • URL ของอินสแตนซ์ Oracle Content Management : <oracle content management instance name>.oraclecloud.com

    • ชื่อและรหัสผ่านสำหรับ URL ของอินสแตนซ์ Oracle Content Management ของคุณ

      หมายเหตุ:

      เพื่อลดความเสี่ยงด้านความปลอดภัยที่อาจเกิดขึ้น ให้ลองสร้างผู้ใช้เฉพาะสำหรับเอเจนต์การอิมปอร์ตไฟล์ ซึ่งระบุบทบาทหรือสิทธิ์ของ Content Capture ไว้โดยเฉพาะในโปรซีเจอร์ที่ต้องการ
    • URL ของอินสแตนซ์บริการข้อมูลผู้ใช้: https://<server name>.identity.oraclecloud.com/oauth2/v1/token (คุณได้คัดลอกค่าไว้เมื่อ สร้างแอปพลิเคชัน IDCS)

    • ID ไคลเอนต์: sampleid (คุณได้คัดลอกค่าไว้เมื่อ สร้างแอปพลิเคชัน IDCS)

    • ข้อมูลลับของไคลเอนต์: sample-secret (คุณได้คัดลอกค่าไว้เมื่อ สร้างแอปพลิเคชัน IDCS)

    • URL ของขอบเขต: https://<server name>:<port number>/urn:opc:cec:all (คุณได้คัดลอกค่านี้ไว้เมื่อ สร้างแอปพลิเคชัน IDCS)

  3. ทดสอบการเชื่อมต่อของคุณโดยรันคำสั่งนี้เพื่อแสดงงานการอิมปอร์ต:
    $ capture list-import-jobs
    

    ระบบจะแสดงลิสต์ของงานการอิมปอร์ตโฟลเดอร์และลิสต์ไฟล์ที่คอนฟิเกอร์ในโปรซีเจอร์การบันทึกเนื้อหาในอินสแตนซ์ Oracle Content Management ที่ระบุ

หลังจากที่คุณได้รีจิสเตอร์ Oracle Content Management และคอนฟิเกอร์งานการอิมปอร์ต คอนฟิเกอร์การอิมปอร์ตไฟล์จากโฟลเดอร์ หรือ คอนฟิเกอร์การอิมปอร์ตไฟล์ลิสต์

การใช้ยูทิลิตีบรรทัดคำสั่งการบันทึก

ยูทิลิตีบรรทัดคำสั่ง capture ช่วยให้คุณสามารถคอนฟิเกอร์เอเจนต์การอิมปอร์ตไฟล์ เพื่อให้เอเจนต์สามารถอิมปอร์ตเอกสารเข้าสู่พื้นที่เก็บข้อมูลของ Oracle Content Management โดยมีคำสั่งสำหรับใช้และจัดการเอเจนต์การอิมปอร์ตไฟล์

------------------------
capture
------------------------
usage : capture <command> [options]
Run capture <command> -h' to get the detailed help for the command.
Commands:  
capture create-encryption-key <file>     Create an encryption key to encrypt/decrypt password for servers.                       [alias:   cek]  
capture register-server <name>           Registers a CEC server                                                                  [alias:   rs]  
capture list-servers                     Lists registered servers                                                                [alias:   ls]  
capture list-import-jobs                 Lists all Import Jobs from server                                                       [alias:  lij]  
capture configure-import-job             Configures import job. Set Import Folder path. Enable or disable.                       [alias:  cij] 
capture trigger-import-job               Forces import job processing.                                                           [alias:  tij]
capture refresh-config                   Refresh configuration from server.                                                      [alias:   rc]
capture list-procedures                  Displays capture procedures.                                                            [alias:   lp]  
capture register-database <name>         Registers external database.                                                            [alias:   rd]  
capture deregister-database              Deregister previously registered database.                                              [alias:   dd]  
capture list-databases                   Displays registered databases and tables.                                               [alias:   ld]  
capture register-table                   Registers tables in a database.                                                         [alias:   rt]  
capture deregister-table                 Deregister previously registered table.                                                 [alias:   dt]
capture list-table-sync-jobs             Lists all Asset Sync Jobs from server.                                                  [alias: ltsj]
capture trigger-table-sync               Force table / asset synchronization.                                                    [alias:  tts]
capture start                            Starts import agent                                                                     [alias:    s]  
capture stop                             Stops import agent                                                                      [alias:    x]  
capture status                           Shows import agent status                                                               [alias:   st]  
capture help                             Shows this message                                                                      [alias:    h]

-----------------------------
capture create-encryption-key
-----------------------------
usage: create-encryption-key <file> [-h]
Create an encryption key to encrypt/decrypt password for servers and save to <file>.
Options: 
-h,--help   Show help
Example:  
capture create-encryption-key ~/.ceckey                      Create encryption key and save to file ~/.ceckey
------------------------
capture register-server
------------------------
usage: capture register-server <name> -e <endpoint> -u <user> -p <password> [-k <key>] [-i <idcsurl>] [-c <clientid>] [-s <clientsecret>] [-o <scope>] [-m <timeout>] [-h]
Registers a CEC server. Specify -e <endpoint> for the server URL. Specify -u <user> and -p <password> for connecting to the server. Optionally specify -k <key> to encrypt the password.
Optionally specify <idcsurl>, <clientid>, <clientsecret> and <scope> for integration with IDCS app.
Options: 
-e,--endpoint <endpoint>           Server endpoint 
-u,--user <user>                   User name 
-p,--password <password>           Password 
-k,--key <key>                     The key file used to encrypt the password 
-i,--idcsurl <idcsurl>             Oracle Identity Cloud Service Instance URL 
-c,--clientid <clientid>           Client ID 
-s,--clientsecret <clientsecret>   Client secret 
-o,--scope <scope>                 Scope -m,--timeout <timeout>             Timeout in millisecond when try to login to the server. Defaults to 30000ms 
-h,--help                          Show help
Examples:  
capture register-server server1 -e http://server1.com -u user1 -p password1 -i                         The server is a tenant on Oracle Public cloud  
http://idcs1.com -c clientid -s clientsecret -o https://primary-audience-and-scope  
capture register-server server1 -e http://server1.com -u user1 -p password1                            The server is a tenant on Oracle Public cloud  
capture register-server server1 -e http://server1.com -u user1 -p password1 -m 60000                   The timeout is set to 60 seconds  
capture register-server server1 -e http://server1.com -u user1 -p password1 -k ~/.mykey                The password will be encrypted
------------------------
capture list-servers
------------------------
usage: capture list-servers [-u <user>] [-f <pattern>] [-h]
Lists registered CEC servers. Optionally specify -u <user> and -f <pattern> to filter results based on user or server name.
Options: -u,--user <user>         User name 
-f,--pattern <pattern>   String to search in server name 
-h,--help                Show help
Examples:  
capture list-servers                                         Lists all registered servers  
capture list-servers -u user1                                Lists all registered servers linked to user 'user1'  
capture list-servers -f demo                                 Lists all registered servers whose name contains 'demo'
------------------------
capture list-import-jobs
------------------------
usage: capture list-import-jobs [-f] [-l] [-h]
Lists all Import Jobs from server. Optionally specify -f and -l to show only folder or list file import jobs.
Options: 
-f,--folder     Display only folder import jobs 
-l,--listfile   Display only list file import jobs 
-h,--help       Show help
Examples:  
capture list-import-jobs                                         Lists all import jobs  
capture list-import-jobs -f                                      Lists all folder import jobs  
capture list-import-jobs -l                                      Lists all list file import jobs
-----------------------------
capture configure-import-job
-----------------------------
usage: capture configure-import-job -s <server> [-i <import>] [-p <path>] [-e] [-E] [-d] [-D] [-h]
Configures the import job.  Specify -s <server> -i <importjobid> to select the server and import job. Optionally specify -p <path> to set the import folder path. 
Optionally specify -d to disable import job and -e to enable import job
Options: 
-s,--server <server>   Set server name associated with import job 
-i,--import <import>   Set Import Job Id 
-p,--path <path>       Set Local Import Folder Path 
-e,--enable            Enables specific import job 
-E,--enable-all        Enables all import jobs 
-d,--disable           Disables specific import job 
-D,--disable-all       Disables all import job 
-h,--help              Show help
Examples:  
capture configure-import-job -s prod -i import_id -p /Users/user1/data/      Sets the import directory  
capture configure-import-job -s prod -i import_id -e                         Enables a specific import job  
capture configure-import-job -s prod -D                                      Disables all import jobs  
capture configure-import-job -s prod -i import_id -d                         Disables a specific import job
------------------------
capture trigger-import-job
------------------------
usage: capture trigger-import-job -s <server> -i <import> [-h] 
Forces import job processing.  
Options: 
-s,--server <server>   Set server name associated with import job 
-i,--import <import>   Set Import Job Id 
-h,--help              Show help 
Examples:  capture trigger-import-job --server production --import xx-job-id-xx           Forces processing of specified import job
------------------------
capture refresh-config
------------------------
usage: capture refresh-config [-s <server>] [-h] Refresh configuration from server. 
Optionally specify -s to only refresh config for selected server. 
Options: 
-s,--server <server>   Specify the server 
-h,--help              Show help 
Examples:  
capture refresh-config                       Force refresh configuration for all servers  
capture refresh-config -s production         Force refresh configuration from specified server                        
------------------------
capture list-procedures
------------------------
usage: capture list-procedures -s <server> [-h] 
Lists capture procedures. Must specify -s <server> to select a server. 
Options: 
-s,--server <server>   Specify the server 
-h,--help              Show help 
Examples:  capture list-procedures -s ocetest                           Lists all capture procedures available for current user
------------------------
capture register-database
------------------------
usage: capture register-database <name> -s <server> -w <procedure> -c <connection> -u <user> -p <password> [-a] [-h] 
Registers on-prem database with Capture. Specify -c <connection> for the connection URL, -u <user> and -p <password> for connecting to the server. 
Options: 
-s,--server <server>           Specify the server 
-w,--procedure <procedure>     Set procedure to be associated with database 
-c,--connection <connection>   Database connection url 
-u,--user <user>               Database User name 
-p,--password <password>       Database Password 
-a,--attach                    Attach existing database 
-h,--help                      Show help 
Examples:  
capture register-database ebsdb -s server1 -w 1 -c jdbc:oracle:thin:@//host:port/service -u user1 -p pass         Register ebsdb with server1
------------------------
capture deregister-database
------------------------
usage: capture deregister-database  -s <server> -w <procedure> -d <database> [-e] [-h] 
Deregister previously registered database. Specify -s <server>, -w <procedure> and -d <database> to select the database. 
Options: 
-s,--server <server>         Specify the server 
-w,--procedure <procedure>   Procedure associated with database 
-d,--database <database>     Database to deregister 
-e,--detach                  Only detach 
-h,--help                    Show help 
Examples:  
capture deregister-database -s server1 -w 1 -d ebsdb                   Deregister VENDORS table from ebsdb database  
capture deregister-database -s server1 -w 1 -d ebsdb --detach          Detaches ebsdb database without deregistering it
------------------------
capture list-databases
------------------------
usage: capture list-databases -s <server> [-h] Lists registered databases and tables. Must specify -s <server> to select a server. 
Options: 
-s,--server <server>   Specify the server 
-h,--help              Show help 
Examples:  
capture list-databases -s ocetest     Lists all registered databased linked to server 'ocetest'  
------------------------
capture register-table
------------------------
usage: capture register-table -s <server> -w <procedure> -d <database> -t <table> [-m <schema>] [-h]
Registers table with Capture. Specify -s <server>, -w <procedure> and -d <database> to select the database. 
Options: 
-s,--server <server>         Specify the server 
-w,--procedure <procedure>   Specify the procedure 
-d,--database <database>     Specify the database 
-t,--table <table>           Table to sync 
-m,--schema <schema>         Override schema qualifier 
-h,--help                    Show help 
Examples:  
capture register-table -s server1 -w 1 -d ebsdb -t VENDORS                  Register VENDORS table from ebsdb database  
capture register-table -s server1 -w 1 -d ebsdb -t VENDORS -m SVR           Register VENDORS table from ebsdb database in SVR schema
------------------------
capture deregister-table
------------------------
usage: capture deregister-table -s <server> -w <procedure> -d <database> -t <table> [-m <schema>] [-h] 
Deregister table. Specify table details. 
Options: 
-s,--server <server>         Specify the server 
-w,--procedure <procedure>   Procedure associated with database 
-d,--database <database>     Specify the database 
-t,--table <table>           Table to sync 
-m,--schema <schema>         Override schema qualifier 
-h,--help                    Show help 
Examples:  capture deregister-table -s server1 -w 1 -d ebsdb -t VENDORS                      Deregister VENDORS table from ebsdb database      
------------------------
capture list-table-sync-jobs
------------------------
usage: capture list-table-sync-jobs [-r] [-h] Lists all Asset Sync Jobs from server. 
Options: 
-r,--refresh   Force refresh asset sync jobs from server 
-h,--help      Show help 
Examples:  
capture list-table-sync-jobs                                         Lists all asset sync jobs  
capture list-table-sync-jobs -r                                      Refresh asset sync jobs from server and list them
------------------------
capture trigger-table-sync
------------------------
usage: capture trigger-table-sync -s <server> -a <asset> [-h] 
Force table / asset synchronization.  
Options: 
-s,--server <server>   Set server name associated with table sync job 
-a,--asset <asset>     Set Asset Sync Job Id 
-h,--help              Show help 
Examples:  
capture trigger-table-sync -s production -i xx-123-sync-id-xx      Forces processing of asset synchronization job
------------------------
capture start
------------------------
usage: capture start [-h]
Starts capture agent. 
Options: 
-h,--help   Show help
Examples:  
capture start                                                Starts capture agent if not running
------------------------
capture stop
------------------------
usage: capture stop [-h]
Stops capture agent. 
Options: 
-h,--help   Show help
Examples:  
capture stop                                                 Stops capture agent if currently running
------------------------
capture status
------------------------
usage: capture status [-s <server>] [-i <import>] [-u <user>] [-m <machine>] [-l <limit>] [-d <duration>] [-c | -p]  [-h] 
Display capture agent status and activity.  
Options: 
-s,--server <server>       Set Server name 
-i,--import <import>       Set Import Job name 
-u,--user <user>           Set user name. Defaults to current user 
-m,--machine <machine>     Set host name. Defaults to current hostname 
-l,--limit <limit>         Set number of results to return. Defaults to 200 
-d,--duration <duration>   Set duration period in hours 
-c,--completed             Display only completed uploads 
-p,--pending               Display only pending uploads 
-h,--help                  Show help 
Examples:  
capture status                             Display capture agent status  
capture status -u user@example.com         Show upload activity for user : user@example.com  
capture status -i Invoices                 Show upload activity for Invoices import job  
capture status -m myhost.example.com       Show upload activity for a specific host / machine  
capture status -p                          Show uploads pending completion  
capture status -c                          Show completed uploads
------------------------
capture version
------------------------
usage: capture version [-h] 
Displays capture version details. 
Options: 
-h,--help    Show help 
Example:  
capture  version                  Display Capture Agent version