Skip to content

Connect the TreeResolver


Introduction

The TreeResolver, which is the seal-operator-treeresolver service, is used for traversing a directory structure and creating a document list from the found items. From the document list, a task can be created for a PLOSSYS 5, DPF or PLOSSYS 4 system for example and then also be started. Any directory structure is possible that is provided by the Fileupload (scratch), the PLOSSYS@rchive or the SharePoint connector.

As of TreeResolver version 2.0, the service detects keywords transferred via document metadata that would be invalid as keywords in MongoDB and fixes them.


Configure the Connector

Execute the following steps to activate the connector in SEAL Operator and specify the keys for the connection:

  1. Open a Command Prompt or PowerShell.

  2. Export the complete configuration of SEAL Operator from Consul to a YAML file with the following command. So you're making sure the current configuration settings are being used.

    operator config export <filename>.yml --insecure
    
  3. Edit the exported file <filename>.yml.

  4. In the section for the TreeResolver connector, set cstatus to on.

    operator:
      connectors:
      ...
        treeresolver:
          cstatus: 'on'
          serviceName: operator-treeresolver
          url: 'https://localhost:3018'
      ...
    
  5. In the env section, specify the following optional keys for the seal-operator-treeresolver service unless the defaults fit:

    Literature - keys

    For further information about available keys, refer to the Key Reference.

  6. Save the <filename>.yml file.

  7. Re-import it to Consul.

    operator config import <filename>.yml --insecure
    

Use the TreeResolver

The TreeResolver connector can be used via the REST API. The following example shows how to use the TreeResolver connector to create a task for a PLOSSYS 4 system retrieving data from sharepoint connector.

  1. Create a JSON object containing the task data.

    • datasink: target system; additional metadata besides datasink depend on the target given in datasink
    • href of the list item input: source of the top level document or directory
    {
      "name":"task1",
      "metadata": {
        "datasink": "operator-p4",
        "Printer": "hpm402"
      },
      "lists": {
        "input": {
          "uuid": "<unique id for input list>",
          "name": "input",
          "embedded": {
            "listItems": [
              {
                "index": 0,
                "href": "/v1/services/operator-sharepoint/repo/<id of basenode>"
              }
            ]
          }
        }
      }
    }
    
  2. Create the task by sending a HTTP POST request to the task creation REST endpoint (e.g. https://localhost:3008/v1/services/operator-treeresolver/tasks). The response contains the task ID.

    Bash example with curl

    TASK_RESPONSE=$(curl -k -s -X POST -H "<Authentication>" -H "Content-Type:application/json" -d "<JSON Task>" "https://localhost:3008/v1/services/operator-treeresolver/tasks")
    TID=$(echo $TASK_RESPONSE | jq -r '.tid')
    
  3. Start the task by sending a HTTP POST request to the task action REST endpoint (e.g. https://localhost:3008/v1/services/operator-treeresolver/tasks/<tid>/action).

    Bash example with curl

    curl -k -s -X POST -H "<Authentication>" -H "Content-Type:application/json" -d '{"action": "start"}' "https://localhost:3008/v1/services/operator-treeresolver/tasks/${TID}/action"
    

Description and usage of the REST API

For more detailed information regarding the REST API and its usage, refer to API Description


Back to top