1.13 Add content

If active, users can contribute their own content. The Goobi viewer provides an upload form that can be used to create a process within Goobi workflow. The status of the process is checked regularly and visualised for the user in the interface.
The configuration is documented here from start to finish.

Goobi workflow

Within Goobi workflow, access to various REST endpoints must be enabled. To do this, the IP address of the Goobi viewer and a token for it must be stored:
<?xml version='1.0' encoding='UTF-8'?>
<endpoint path="/process/details.*">
<method name="get">
<allow netmask="" token="SECRETTOKEN"/>
<endpoint path="/processes.*">
<method name="post">
<allow netmask="" token="SECRETTOKEN"/>
In the following example, we assume that there is a project: viewer_UserUploads. This contains a production template: viewer_UserUpload. Within the production template there is a step: Check content in metadata editor.
In this step we show the email address of the submitting user, as well as the possibility to reject the submitted content and enter a reason for rejection. This is done via process properties:
<?xml version="1.0" encoding="UTF-8"?>
<property name="email" container="0">
<showStep name="Check content in metadata editor" access="read"/>
<showProcessGroup access="read"/>
<property name="Rejected" container="0">
<showStep name="Check content in metadata editor" access="write"/>
<showProcessGroup access="read"/>
<property name="Rejection reason" container="0">
<showStep name="Check content in metadata editor" access="write"/>
<showProcessGroup access="read"/>

Goobi viewer

Within the Goobi viewer, a URL to the Goobi workflow installation used must be configured:
Furthermore, the functionality must be activated and configured with the corresponding values defined in Goobi workflow:
<upload enabled="true">
<rejectionReasonPropertyName>Rejection reason</rejectionReasonPropertyName>
In order to regularly check the editing status, a cron job must be created. This checks all contributed content that has the status "WAITING" once an hour to see if there are any changes.
42 * * * * root curl -s -H "Content-Type: application/json" -H "token:GOOBIVIEWERAPITOKEN" -d '{"type":"UPDATE_UPLOAD_JOBS"}' -X POST http://localhost:8080/api/v1/tasks/ 1>/dev/null