...
In this tutorial, we'll create a Spring Boot Service using Java, meaning the requirements for the project are derived from Spring Boot. Thus, a JDK version 1.8 or later and Maven 3.2 or later are required.
...
Setting up the Consumer Service
To implement processing of incoming update metadata using our webhook service, we need to configure an endpoint within a controller class of our Example Webhook Service, in this instance ExampleRestController. The URL we define between the RequestMapping annotation of the controller class and the PostMapping annotation of the endpoint method will need to find its way into the System Hook system hook configuration of our yuuvis® Momentum Systemsystem. We 'll will also define a stub method for working with the incoming metadata, which we 'll will call from within our endpoint method, the Object Map object map provided by the System Hooksystem hook.
Code Block | ||
---|---|---|
| ||
@RestController @RequestMapping("/api/dms/request") public class ExampleRestController { @PostMapping(value = "/update/metadata", produces = {"application/json"}) public Map<String, Object> updateDmsObjectMetadata(@RequestBody Map<String, Object> dmsApiObjectList, @RequestHeader(value = "Authorization", required = true) String authorization) { doSomething(dmsApiObjectList, authorization); return dmsApiObjectList; } private void doSomething(Map<String, Object> dmsApiObjectList, String authorization) { // do something with the metadata } } |
...