設定檔案匯入代理程式

檔案匯入代理程式是一個命令行應用程式,可以在任何電腦上執行,並作為從受監督的檔案系統位置 (例如資料夾或網路磁碟) 匯入內容的來源。它可以監督並擷取該位置中的內容,將其饋送至匯入處理器以進一步處理,然後根據程序中定義的規則遞送內容。

只有在來源是受監督的資料夾 (不是受監督的電子郵件帳戶) 時,才需要在本機電腦上安裝並執行檔案匯入代理程式。Capture 命令行公用程式可協助您註冊伺服器、設定並列出匯入工作。

下載並安裝檔案匯入代理程式

您必須先在本機電腦上安裝「檔案匯入代理程式」,才能從受監督的資料夾中匯入檔案。

系統需求

「檔案匯入代理程式」是一個 Java 應用程式,必須搭配 Oracle JDK 版本 8u251 或最新版本才能進行安裝。「檔案匯入代理程式」與 Windows、Linux 及 Mac 相容 (請參閱 Oracle JDK 8 and JRE 8 Certified System Configurations)。

下載並安裝檔案匯入代理程式:
  1. 登入 Oracle Content Management Web 介面,然後按一下左側導覽面板中的擷取 (位於管理底下)。您必須具備必要存取權限才能看到此選項。
  2. 在「Content Capture 程序」頁面的下載底下,按一下 Oracle Content Capture 檔案匯入代理程式,將 capture-agent.zip 檔案下載至本機電腦。
  3. 將 ZIP 檔解壓縮。
  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 Web 服務。API 受到 OAuth 的保護,因此「檔案匯入代理程式」需要 OAuth 權杖。IDCS 應用程式會允許「檔案匯入代理程式」產生該權杖。

如何建立 IDCS 應用程式:
  1. 登入我的服務儀表板。
  2. 按一下 Identity Cloud
  3. 複製「服務執行處理 URL」。此 URL 可讓您存取自己的 Oracle Content Management 執行處理。也就是說,當您安裝伺服器之後,您將利用這個 URL 來註冊伺服器。
  4. 在 Identity Cloud Service 主控台中,展開側邊功能表,然後按一下應用程式
  5. 按一下新增
  6. 新增應用程式頁面中,按一下機密應用程式
  7. 新增機密應用程式視窗的應用程式詳細資訊窗格中,輸入應用程式的名稱,然後按一下下一步
  8. 選擇立即將此應用程式設定為從屬端
  9. 授權下方,選取資源擁有者JWT 宣告
  10. 權杖發行原則下方,為授權的資源選擇全部,然後按一下下一步
  11. 資源頁籤上,接受預設值並按一下下一步
  12. Web 層原則頁籤上,接受預設值並按一下下一步
  13. 授權頁籤上,按一下預設值,然後按一下下一步
  14. 按一下完成
    複製從屬端 ID從屬端密碼。當您向 Capture 命令行公用程式註冊您的伺服器時,會需要這些資訊。
  15. 組態頁籤上,展開從屬端組態
  16. 向下捲動到權杖發行原則區段,然後按一下新增範圍
  17. 選取範圍對話方塊中,尋找您的 Oracle Content Management 執行處理,然後按一下 >
  18. 選取其中有 /urn:opc:... URL 的範圍,然後按一下新增
  19. 複製範圍 URL。當您向 Capture 命令行公用程式註冊您的伺服器時,會需要這資訊。
  20. 按一下儲存,然後按一下啟用

您的 IDCS 應用程式已經建立。現在您可以去向 Capture 命令行公用程式註冊您的伺服器了。

在檔案匯入代理程式註冊 Oracle Content Management

您必須在 Capture 命令行公用程式註冊 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
    
    • Oracle Content Management 執行處理 URL:<oracle content management instance name>.oraclecloud.com

    • Oracle Content Management 執行處理 URL 的使用者名稱和密碼。

      註:

      若要降低潛在安全威脅,請考慮建立「檔案匯入代理程式」特定使用者,該使用者只被指定必要程序的 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 命令行公用程式

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