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 Output Engine, 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.

  2. Export the complete configuration of SEAL Operator from Consul to a YAML file. This ensures that you edit the current configuration.

    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 in the operator-treeresolver section 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 the file to Consul.

    operator config import <filename>.yml --insecure
    
  8. Check the imported value of a key you have set, for example ITEM_TYPE:

    operator config get ITEM_TYPE --service operator-treeresolver --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 the 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 an HTTP POST request to the task creation REST endpoint, for example https://localhost:3008/v1/services/operator-treeresolver/tasks. The response contains the task ID.

    Example - 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 an HTTP POST request to the task action REST endpoint, for example https://localhost:3008/v1/services/operator-treeresolver/tasks/<tid>/action.

    Example - 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"
    

Literature - 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