Class DataCollectionTemplateService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.datacollection.rs1.template.DataCollectionTemplateService
@RestController
@RequestMapping("documents/dynamic-forms/r1/templates")
@Resource(logging=true)
public class DataCollectionTemplateService
extends PrivateService
Service for managing data collection templates.
- Since:
- 22.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DTOIdentifier<Long>> createRelease(Long templateId, @Valid DTODataCollectionTemplateReleaseInsert dto) Creates a new release for the data collection template.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> createSheet(Long templateId, @Valid DTODataCollectionTemplateSheetInsert dto) Creates a new sheet from the data collection template.org.springframework.http.ResponseEntity<DTODataCollectionTemplate> get(Long templateId, String language, Collection<String> fields) Retrieves a specific data collection template by its identifier.org.springframework.http.ResponseEntity<PageResponse<DTODataCollectionTemplate>> getCollection(@Valid Page page, Collection<String> fields, String order, String language, @Valid @NotNull DTODataCollectionTemplateFilter filter) Retrieves a paginated collection of data collection templates based on the provided search criteria.org.springframework.http.ResponseEntity<DTODataCollectionTemplateRelease> getCurrentRelease(Long templateId, String language, Collection<String> fields) Retrieves the current release associated with the data collection template.org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getCurrentReleaseModel(Long templateId, String language) Retrieves the model (tree structure) of the current release associated with the data collection template.org.springframework.http.ResponseEntity<DTODataCollectionTemplateRelease> getRelease(Long templateId, Long releaseId, String language, Collection<String> fields) Retrieves a specific release associated with the data collection template.org.springframework.http.ResponseEntity<PageResponse<DTODataCollectionTemplateRelease>> getReleaseCollection(Long templateId, @Valid Page page, Collection<String> fields, String order, String language, @Valid @NotNull DTODataCollectionTemplateReleaseFilter filter) Retrieves a paginated collection of releases associated with the data collection template.org.springframework.http.ResponseEntity<List<DTODataCollectionGlobalExpression>> getReleaseGlobalExpressions(Long templateId, Long releaseId, String language) Retrieves the global expressions associated with a specific release of the data collection template.org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getReleaseModel(Long templateId, Long releaseId, String language) Retrieves the model (tree structure) of a specific release associated with the data collection template.org.springframework.http.ResponseEntity<DTODataCollectionTemplateWorkingCopy> getWorkingCopy(Long templateId) Retrieves the working copy associated with the data collection template.org.springframework.http.ResponseEntity<List<DTODataCollectionGlobalExpression>> getWorkingCopyGlobalExpressions(Long templateId, String language) Retrieves the global expressions associated with the working copy of the data collection template.org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getWorkingCopyModel(Long templateId, String language) Retrieves the working copy model (tree structure) associated with the data collection template.org.springframework.http.ResponseEntity<Void> patch(Long templateId, @Valid DTODataCollectionTemplateUpdate dto) Partially updates an existing data collection template.org.springframework.http.ResponseEntity<Void> patchRelease(Long templateId, Long releaseId, @Valid DTODataCollectionTemplateReleaseUpdate dto) Partially updates a specific release associated with the data collection template.org.springframework.http.ResponseEntity<Void> patchWorkingCopy(Long templateId, @Valid DTODataCollectionTemplateWorkingCopyUpdate dto) Partially updates the working copy associated with the data collection template.org.springframework.http.ResponseEntity<Void> patchWorkingCopyGlobalExpressions(Long templateId, @Valid List<DTODataCollectionGlobalExpression> input) Updates the global expressions associated with the working copy of the data collection template.org.springframework.http.ResponseEntity<Void> patchWorkingCopyModel(Long templateId, @Valid TreeModel<DTODataCollectionNode> input) Updates the working copy model (tree structure) associated with the data collection template.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> Creates a new data collection template.
-
Constructor Details
-
DataCollectionTemplateService
public DataCollectionTemplateService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTODataCollectionTemplate>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @RequestParam(required=false,name="_language",defaultValue="user") String language, @Valid @NotNull @Valid @NotNull DTODataCollectionTemplateFilter filter) throws DAValidateException, DAException Retrieves a paginated collection of data collection templates based on the provided search criteria.- Parameters:
page- the pagination parameters (page number, page size)fields- optional collection of field names to include in the response (for partial representation)order- optional ordering specification for sorting the resultslanguage- the language code for localized strings (defaults to user's language)filter- the search filter criteria for data collection templates- Returns:
- a
ResponseEntitycontaining aPageResponsewith the collection ofDTODataCollectionTemplate - Throws:
DAValidateException- if validation failsDAException- if a data access error occurs
-
get
@GetMapping(value="{templateId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTODataCollectionTemplate> get(@PathVariable("templateId") Long templateId, @RequestParam(required=false,name="_language",defaultValue="user") String language, @RequestParam(required=false,value="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves a specific data collection template by its identifier.- Parameters:
templateId- the unique identifier of the data collection template to retrievelanguage- the language code for localized strings (defaults to user's language)fields- optional collection of field names to include in the response (for partial representation)- Returns:
- a
ResponseEntitycontaining theDTODataCollectionTemplate - Throws:
DAValidateException- if validation fails or the data collection template is not foundDAException- if a data access error occurs
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid @RequestBody @Valid DTODataCollectionTemplateInsert dto) throws DAValidateException, DAException Creates a new data collection template.- Parameters:
dto- theDTODataCollectionTemplateInsertcontaining the data for the new data collection template- Returns:
- a
ResponseEntitycontaining aDTOIdentifierwith the ID of the newly created data collection template. The response includes a Location header with the URI of the created resource. - Throws:
DAValidateException- if validation failsDAException- if a data access error occurs
-
patch
@PatchMapping(value="{templateId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid DTODataCollectionTemplateUpdate dto) throws DAValidateException, DAException Partially updates an existing data collection template. Only the fields provided in the DTO will be updated; other fields remain unchanged.- Parameters:
templateId- the unique identifier of the data collection template to updatedto- theDTODataCollectionTemplateUpdatecontaining the fields to update- Returns:
- a
ResponseEntitywith no content (HTTP 204) on successful update - Throws:
DAValidateException- if validation fails or the data collection template is not foundDAException- if a data access error occurs
-
getWorkingCopy
@GetMapping(value="{templateId:[0-9]+}/working-copies", produces="application/json") public org.springframework.http.ResponseEntity<DTODataCollectionTemplateWorkingCopy> getWorkingCopy(@PathVariable("templateId") Long templateId) throws DAException, DAValidateException Retrieves the working copy associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection template- Returns:
- a
ResponseEntitycontaining theDTODataCollectionTemplateWorkingCopy - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
patchWorkingCopy
@PatchMapping(value="{templateId:[0-9]+}/working-copies", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patchWorkingCopy(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid DTODataCollectionTemplateWorkingCopyUpdate dto) throws DAValidateException, DAException Partially updates the working copy associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatedto- theDTODataCollectionTemplateWorkingCopyUpdatecontaining the fields to update- Returns:
- a
ResponseEntitywith no content (HTTP 204) on successful update - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
getWorkingCopyModel
@GetMapping(value="{templateId:[0-9]+}/working-copies/models", produces="application/json") public org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getWorkingCopyModel(@PathVariable("templateId") Long templateId, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAException, DAValidateException Retrieves the working copy model (tree structure) associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatelanguage- the language code for localized strings (defaults to user's language)- Returns:
- a
ResponseEntitycontaining theTreeModelofDTODataCollectionNode - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
patchWorkingCopyModel
@PatchMapping(value="{templateId:[0-9]+}/working-copies/models", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patchWorkingCopyModel(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid TreeModel<DTODataCollectionNode> input) throws DAValidateException, DAException Updates the working copy model (tree structure) associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templateinput- theTreeModelofDTODataCollectionNodecontaining the updated tree structure- Returns:
- a
ResponseEntitywith no content (HTTP 204) on successful update - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
getWorkingCopyGlobalExpressions
@GetMapping(value="{templateId:[0-9]+}/working-copies/global-expressions", produces="application/json") public org.springframework.http.ResponseEntity<List<DTODataCollectionGlobalExpression>> getWorkingCopyGlobalExpressions(@PathVariable("templateId") Long templateId, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAException, DAValidateException Retrieves the global expressions associated with the working copy of the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatelanguage- the language code for localized strings (defaults to user's language)- Returns:
- a
ResponseEntitycontaining a list ofDTODataCollectionGlobalExpression - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
patchWorkingCopyGlobalExpressions
@PatchMapping(value="{templateId:[0-9]+}/working-copies/global-expressions", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patchWorkingCopyGlobalExpressions(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid List<DTODataCollectionGlobalExpression> input) throws DAValidateException, DAException Updates the global expressions associated with the working copy of the data collection template.- Parameters:
templateId- the unique identifier of the data collection templateinput- the list ofDTODataCollectionGlobalExpressioncontaining the updated global expressions- Returns:
- a
ResponseEntitywith no content (HTTP 204) on successful update - Throws:
DAValidateException- if validation fails or the template is not foundDAException- if a data access error occurs
-
getReleaseCollection
@GetMapping(value="{templateId:[0-9]+}/releases", produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTODataCollectionTemplateRelease>> getReleaseCollection(@PathVariable("templateId") Long templateId, @RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @RequestParam(required=false,name="_language",defaultValue="user") String language, @Valid @NotNull @Valid @NotNull DTODataCollectionTemplateReleaseFilter filter) throws DAException, DAValidateException Retrieves a paginated collection of releases associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatepage- the pagination parameters (page number, page size)fields- optional collection of field names to include in the response (for partial representation)order- optional ordering specification for sorting the resultslanguage- the language code for localized strings (defaults to user's language)filter- the search filter criteria for releases- Returns:
- a
ResponseEntitycontaining aPageResponsewith the collection ofDTODataCollectionTemplateRelease - Throws:
DAValidateException- if validation failsDAException- if a data access error occurs
-
getRelease
@GetMapping(value="{templateId:[0-9]+}/releases/{releaseId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTODataCollectionTemplateRelease> getRelease(@PathVariable("templateId") Long templateId, @PathVariable("releaseId") Long releaseId, @RequestParam(required=false,name="_language",defaultValue="user") String language, @RequestParam(required=false,value="_fields") Collection<String> fields) throws DAException, DAValidateException Retrieves a specific release associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatereleaseId- the unique identifier of the releaselanguage- the language code for localized strings (defaults to user's language)fields- optional collection of field names to include in the response (for partial representation)- Returns:
- a
ResponseEntitycontaining theDTODataCollectionTemplateRelease - Throws:
DAValidateException- if validation fails or the release is not foundDAException- if a data access error occurs
-
patchRelease
@PatchMapping(value="{templateId:[0-9]+}/releases/{releaseId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patchRelease(@PathVariable("templateId") Long templateId, @PathVariable("releaseId") Long releaseId, @Valid @RequestBody @Valid DTODataCollectionTemplateReleaseUpdate dto) throws DAValidateException, DAException Partially updates a specific release associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatereleaseId- the unique identifier of the release to updatedto- theDTODataCollectionTemplateReleaseUpdatecontaining the fields to update- Returns:
- a
ResponseEntitywith no content (HTTP 204) on successful update - Throws:
DAValidateException- if validation fails or the release is not foundDAException- if a data access error occurs
-
getReleaseModel
@GetMapping(value="{templateId:[0-9]+}/releases/{releaseId:[0-9]+}/models", produces="application/json") public org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getReleaseModel(@PathVariable("templateId") Long templateId, @PathVariable("releaseId") Long releaseId, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAException, DAValidateException Retrieves the model (tree structure) of a specific release associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatereleaseId- the unique identifier of the releaselanguage- the language code for localized strings (defaults to user's language)- Returns:
- a
ResponseEntitycontaining theTreeModelofDTODataCollectionNode - Throws:
DAValidateException- if validation fails or the release is not foundDAException- if a data access error occurs
-
getReleaseGlobalExpressions
@GetMapping(value="{templateId:[0-9]+}/releases/{releaseId:[0-9]+}/global-expressions", produces="application/json") public org.springframework.http.ResponseEntity<List<DTODataCollectionGlobalExpression>> getReleaseGlobalExpressions(@PathVariable("templateId") Long templateId, @PathVariable("releaseId") Long releaseId, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAException, DAValidateException Retrieves the global expressions associated with a specific release of the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatereleaseId- the unique identifier of the releaselanguage- the language code for localized strings (defaults to user's language)- Returns:
- a
ResponseEntitycontaining a list ofDTODataCollectionGlobalExpression - Throws:
DAValidateException- if validation fails or the release is not foundDAException- if a data access error occurs
-
getCurrentRelease
@GetMapping(value="{templateId:[0-9]+}/releases/current", produces="application/json") public org.springframework.http.ResponseEntity<DTODataCollectionTemplateRelease> getCurrentRelease(@PathVariable("templateId") Long templateId, @RequestParam(required=false,name="_language",defaultValue="user") String language, @RequestParam(required=false,value="_fields") Collection<String> fields) throws DAException, DAValidateException Retrieves the current release associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatelanguage- the language code for localized strings (defaults to user's language)fields- optional collection of field names to include in the response (for partial representation)- Returns:
- a
ResponseEntitycontaining theDTODataCollectionTemplateRelease - Throws:
DAValidateException- if validation fails or the current release is not foundDAException- if a data access error occurs
-
getCurrentReleaseModel
@GetMapping(value="{templateId:[0-9]+}/releases/current/models", produces="application/json") public org.springframework.http.ResponseEntity<TreeModel<DTODataCollectionNode>> getCurrentReleaseModel(@PathVariable("templateId") Long templateId, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAException, DAValidateException Retrieves the model (tree structure) of the current release associated with the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatelanguage- the language code for localized strings (defaults to user's language)- Returns:
- a
ResponseEntitycontaining theTreeModelofDTODataCollectionNode - Throws:
DAValidateException- if validation fails or the current release is not foundDAException- if a data access error occurs
-
createRelease
@PostMapping(value="{templateId:[0-9]+}/releases", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> createRelease(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid DTODataCollectionTemplateReleaseInsert dto) throws DAException, DAValidateException Creates a new release for the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatedto- theDTODataCollectionTemplateReleaseInsertcontaining the data for the new release- Returns:
- a
ResponseEntitycontaining aDTOIdentifierwith the ID of the newly created release. The response includes a Location header with the URI of the created resource. - Throws:
DAValidateException- if validation failsDAException- if a data access error occurs
-
createSheet
@PostMapping(value="{templateId:[0-9]+}/sheets", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> createSheet(@PathVariable("templateId") Long templateId, @Valid @RequestBody @Valid DTODataCollectionTemplateSheetInsert dto) throws DAException, DAValidateException Creates a new sheet from the data collection template.- Parameters:
templateId- the unique identifier of the data collection templatedto- theDTODataCollectionTemplateSheetInsertcontaining the data for the new sheet- Returns:
- a
ResponseEntitycontaining aDTOIdentifierwith the ID of the newly created sheet. The response includes a Location header with the URI of the created resource. - Throws:
DAValidateException- if validation failsDAException- if a data access error occurs
-