Package org.tailormap.api.controller
Class DrawingController
java.lang.Object
org.tailormap.api.controller.DrawingController
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)
- GET /drawing/list (@see DrawingController#listDrawings)
- GET /{viewerKind}/{viewerName}/drawing/{drawingId} (@see DrawingController#getDrawing)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Valid org.springframework.http.ResponseEntity<Serializable>
createOrUpdateDrawing
(Drawing drawing, Application application) Create or update a drawing.org.springframework.http.ResponseEntity<Serializable>
deleteDrawing
(UUID drawingId) Delete a drawing.@Valid org.springframework.http.ResponseEntity<Serializable>
getDrawing
(UUID drawingId, Application application) Get a drawing by id.List drawings.
-
Constructor Details
-
DrawingController
-
-
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 updateapplication
- 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 retrieveapplication
- 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:
-