Class OrchestratorAssetAttachmentByAssetService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.orchestrator.assets.rs1.asset.attachment.OrchestratorAssetAttachmentByAssetService
@RestController
@RequestMapping("assets/r1/assets/{assetId:[0-9]+}/attachments")
@Resource(logging=true)
public class OrchestratorAssetAttachmentByAssetService
extends PrivateService
Service to manage the attachments of a single asset.
- Since:
- 20.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DTOAssetAttachment> get(Long assetId, Long attachmentId, Collection<String> fields) Retrieves the requiredDTOAssetAttachmentby calling theAttachmentLoadEvent, considering only attachments related to an asset.org.springframework.http.ResponseEntity<PageResponse<DTOAssetAttachment>> getCollection(Long assetId, @Valid Page page, Collection<String> fields, String order, @Valid @NotNull DTOAssetAttachmentFilter filter) Retrieves the requiredDTOAssetAttachmentby calling theAttachmentSearchEventwith the right clause.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(Long assetId, @Valid DTOAssetAttachmentInsert dto) Attach an existing file to an asset by calling theAssetAttachmentInsertEvent.
-
Constructor Details
-
OrchestratorAssetAttachmentByAssetService
public OrchestratorAssetAttachmentByAssetService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAssetAttachment>> getCollection(@PathVariable("assetId") Long assetId, @RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @Valid @NotNull @Valid @NotNull DTOAssetAttachmentFilter filter) throws DAValidateException, DAException Retrieves the requiredDTOAssetAttachmentby calling theAttachmentSearchEventwith the right clause.- Parameters:
page- the required result pagefields- the collection of fields the response will containorder- the ordering fieldfilter- theDTOAssetAttachmentFilter- Returns:
- the response containing the current result page
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{attachmentId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOAssetAttachment> get(@PathVariable("assetId") Long assetId, @PathVariable("attachmentId") Long attachmentId, @RequestParam(required=false,value="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOAssetAttachmentby calling theAttachmentLoadEvent, considering only attachments related to an asset.- Parameters:
attachmentId- the attachment idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded attachment
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@PathVariable("assetId") Long assetId, @Valid @RequestBody @Valid DTOAssetAttachmentInsert dto) throws DAValidateException, DAException Attach an existing file to an asset by calling theAssetAttachmentInsertEvent.- Parameters:
dto- theDTOAssetAttachmentInsert- Returns:
- the standard response containing the new attachment id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-