Package org.tailormap.api.controller
Class AttachmentsController
java.lang.Object
org.tailormap.api.controller.AttachmentsController
-
Constructor Summary
ConstructorsConstructorDescriptionAttachmentsController(EditUtil editUtil, FeatureSourceFactoryHelper featureSourceFactoryHelper) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Serializable> addAttachment(AppTreeLayerNode appTreeLayerNode, GeoService service, GeoServiceLayer layer, Application application, String featureId, AttachmentMetadata attachment, byte[] fileData) Add an attachment to a featureorg.springframework.http.ResponseEntity<Serializable> deleteAttachment(AppTreeLayerNode appTreeLayerNode, GeoService service, GeoServiceLayer layer, Application application, UUID attachmentId) org.springframework.http.ResponseEntity<byte[]> getAttachment(AppTreeLayerNode appTreeLayerNode, GeoService service, GeoServiceLayer layer, Application application, UUID attachmentId) org.springframework.http.ResponseEntity<List<AttachmentMetadata>> listAttachments(AppTreeLayerNode appTreeLayerNode, GeoService service, GeoServiceLayer layer, Application application, String featureId) List attachments for a feature.
-
Constructor Details
-
AttachmentsController
public AttachmentsController(EditUtil editUtil, FeatureSourceFactoryHelper featureSourceFactoryHelper)
-
-
Method Details
-
addAttachment
@PutMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/layer/{appLayerId}/feature/{featureId}/attachments", consumes="multipart/form-data", produces="application/json") @Transactional public org.springframework.http.ResponseEntity<Serializable> addAttachment(@ModelAttribute AppTreeLayerNode appTreeLayerNode, @ModelAttribute GeoService service, @ModelAttribute GeoServiceLayer layer, @ModelAttribute Application application, @PathVariable String featureId, @RequestPart("attachmentMetadata") AttachmentMetadata attachment, @RequestPart("attachment") byte[] fileData) Add an attachment to a feature- Parameters:
appTreeLayerNode- the application tree layer nodeservice- the geo servicelayer- the geo service layerapplication- the applicationfeatureId- the feature idattachment- the attachment metadatafileData- the attachment file data- Returns:
- the response entity
-
listAttachments
@GetMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/layer/{appLayerId}/feature/{featureId}/attachments", produces="application/json") @Transactional public org.springframework.http.ResponseEntity<List<AttachmentMetadata>> listAttachments(@ModelAttribute AppTreeLayerNode appTreeLayerNode, @ModelAttribute GeoService service, @ModelAttribute GeoServiceLayer layer, @ModelAttribute Application application, @PathVariable String featureId) List attachments for a feature.- Parameters:
appTreeLayerNode- the application tree layer nodeservice- the geo servicelayer- the geo service layerapplication- the applicationfeatureId- the feature id- Returns:
- the response entity containing a list of attachment metadata
-
deleteAttachment
@DeleteMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/layer/{appLayerId}/attachment/{attachmentId}") @Transactional public org.springframework.http.ResponseEntity<Serializable> deleteAttachment(@ModelAttribute AppTreeLayerNode appTreeLayerNode, @ModelAttribute GeoService service, @ModelAttribute GeoServiceLayer layer, @ModelAttribute Application application, @PathVariable UUID attachmentId) -
getAttachment
@Transactional @GetMapping(path="${tailormap-api.base-path}/{viewerKind}/{viewerName}/layer/{appLayerId}/attachment/{attachmentId}", produces="application/octet-stream") public org.springframework.http.ResponseEntity<byte[]> getAttachment(@ModelAttribute AppTreeLayerNode appTreeLayerNode, @ModelAttribute GeoService service, @ModelAttribute GeoServiceLayer layer, @ModelAttribute Application application, @PathVariable UUID attachmentId)
-