Class DrawingController

java.lang.Object
org.tailormap.api.controller.DrawingController

@Validated public class DrawingController extends Object
Controller for drawing operations. Note that the following endpoints are secured/require authentication:
  • PUT /{viewerKind}/{viewerName}/drawing (@see DrawingController#createOrUpdateDrawing)
  • DELETE /drawing/{drawingId} (@see DrawingController#deleteDrawing)
The following endpoints do not require authentication (but may return different results based on the user's role/authorization):
  • GET /drawing/list (@see DrawingController#listDrawings)
  • GET /{viewerKind}/{viewerName}/drawing/{drawingId} (@see DrawingController#getDrawing)
  • Constructor Details

    • DrawingController

      public DrawingController(DrawingService drawingService)
  • Method Details

    • createOrUpdateDrawing

      @PutMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/drawing", consumes="application/json", produces="application/json") @Valid public @Valid org.springframework.http.ResponseEntity<Serializable> createOrUpdateDrawing(@NonNull @RequestBody Drawing drawing, @ModelAttribute Application application) throws com.fasterxml.jackson.core.JsonProcessingException
      Create or update a drawing. Requires authentication.
      Parameters:
      drawing - the drawing to create or update
      application - the application that this drawing is created or updated in (used to determine the SRID)
      Returns:
      the created or updated drawing
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getDrawing

      @GetMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/drawing/{drawingId}", produces="application/json") @Valid public @Valid org.springframework.http.ResponseEntity<Serializable> getDrawing(@NonNull @PathVariable UUID drawingId, @ModelAttribute Application application) throws org.springframework.web.server.ResponseStatusException
      Get a drawing by id. Does not require authentication per-se, but authorizations are checked at the drawing level.
      Parameters:
      drawingId - the id of the drawing to retrieve
      application - the application that this drawing is created or updated in (used to determine the SRID)
      Returns:
      the drawing, if found and accessible
      Throws:
      org.springframework.web.server.ResponseStatusException - if the drawing is not found or not accessible
      See Also:
    • listDrawings

      @GetMapping(path="${tailormap-api.base-path}/drawing/list", produces="application/json") public Set<Drawing> listDrawings()
      List drawings. Does not require authentication per-se, but authorizations are checked at the drawing level.
      Returns:
      a, possibly empty, set of drawings
      See Also:
    • deleteDrawing

      @DeleteMapping(path="${tailormap-api.base-path}/drawing/{drawingId}") public org.springframework.http.ResponseEntity<Serializable> deleteDrawing(@NonNull @PathVariable UUID drawingId)
      Delete a drawing. Requires authentication.
      Parameters:
      drawingId - the id of the drawing to delete
      Returns:
      a response entity with status NO_CONTENT
      See Also: