Class DrawingController

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

@Validated public class DrawingController extends Object
Controller for drawing operations. A drawing can only be read by its owner or by users with the drawings-admin or drawings-read-all property, and only be saved or deleted by its owner or by users with the drawings-admin property.

The following endpoints require authentication:

  • PUT /{viewerKind}/{viewerName}/drawing (@see DrawingController#createOrUpdateDrawing)
  • GET /{viewerKind}/{viewerName}/drawing/{drawingId} (@see DrawingController#getDrawing)
  • DELETE /drawing/{drawingId} (@see DrawingController#deleteDrawing)
The following endpoint does not require authentication, but returns an empty list for anonymous users:
  • GET /drawing/list (@see DrawingController#listDrawings)
  • 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(@RequestBody @NonNull Drawing drawing, @ModelAttribute Application application) throws tools.jackson.core.JacksonException
      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:
      tools.jackson.core.JacksonException
    • getDrawing

      @GetMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/drawing/{drawingId}", produces="application/json") @Valid public @Valid org.springframework.http.ResponseEntity<Serializable> getDrawing(@PathVariable @NonNull UUID drawingId, @ModelAttribute Application application) throws org.springframework.web.server.ResponseStatusException
      Get a drawing by id. Requires authentication, 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 readable by the current user. Does not require authentication, but returns an empty set for anonymous users.
      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(@PathVariable @NonNull 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: