Class ContentController


  • @RestController
    public class ContentController
    extends java.lang.Object
    A controller to handle manipulation of a ResearchObject's content. Allows:
    • GET/PUT of the entire JSON structure.
    • GET/PUT/POST/DELETE on individual, top-level fields in the JSON.
    • PATCH using JSON-Patch to alter any part of the JSON.
    Appropriate validation is performed for each request.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<java.lang.Object> appendToResearchObjectField​(long id, java.lang.String field, com.fasterxml.jackson.databind.JsonNode value)  
      org.springframework.http.ResponseEntity<java.lang.Object> clearResearchObjectField​(long id, java.lang.String field)  
      org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectContent​(long id)  
      org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectContent​(long id, com.fasterxml.jackson.databind.JsonNode content)  
      org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectField​(long id, java.lang.String field)  
      org.springframework.http.ResponseEntity<java.lang.Object> patchResearchObjectContent​(long id, com.fasterxml.jackson.databind.JsonNode jsonPatch)  
      org.springframework.http.ResponseEntity<java.lang.Object> updateResearchObjectField​(long id, java.lang.String field, com.fasterxml.jackson.databind.JsonNode value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContentController

        public ContentController()
    • Method Detail

      • getResearchObjectField

        @GetMapping("/research_objects/{id}/content/{field}")
        public org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectField​(@PathVariable
                                                                                                long id,
                                                                                                @PathVariable
                                                                                                java.lang.String field)
      • updateResearchObjectField

        @PutMapping(value="/research_objects/{id}/content/{field}",
                    produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> updateResearchObjectField​(@PathVariable
                                                                                                   long id,
                                                                                                   @PathVariable
                                                                                                   java.lang.String field,
                                                                                                   @RequestBody
                                                                                                   com.fasterxml.jackson.databind.JsonNode value)
      • appendToResearchObjectField

        @PostMapping(value="/research_objects/{id}/content/{field}",
                     produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> appendToResearchObjectField​(@PathVariable
                                                                                                     long id,
                                                                                                     @PathVariable
                                                                                                     java.lang.String field,
                                                                                                     @RequestBody
                                                                                                     com.fasterxml.jackson.databind.JsonNode value)
      • clearResearchObjectField

        @DeleteMapping(value="/research_objects/{id}/content/{field}",
                       produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> clearResearchObjectField​(@PathVariable
                                                                                                  long id,
                                                                                                  @PathVariable
                                                                                                  java.lang.String field)
      • patchResearchObjectContent

        @PatchMapping(value="/research_objects/{id}/content",
                      produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> patchResearchObjectContent​(@PathVariable
                                                                                                    long id,
                                                                                                    @RequestBody
                                                                                                    com.fasterxml.jackson.databind.JsonNode jsonPatch)
      • getResearchObjectContent

        @GetMapping(value="/research_objects/{id}/content",
                    produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectContent​(@PathVariable
                                                                                                  long id)
      • getResearchObjectContent

        @PutMapping(value="/research_objects/{id}/content",
                    produces="application/json")
        public org.springframework.http.ResponseEntity<java.lang.Object> getResearchObjectContent​(@PathVariable
                                                                                                  long id,
                                                                                                  @RequestBody
                                                                                                  com.fasterxml.jackson.databind.JsonNode content)