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 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 results
      language - the language code for localized strings (defaults to user's language)
      filter - the search filter criteria for data collection templates
      Returns:
      a ResponseEntity containing a PageResponse with the collection of DTODataCollectionTemplate
      Throws:
      DAValidateException - if validation fails
      DAException - 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 retrieve
      language - 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 ResponseEntity containing the DTODataCollectionTemplate
      Throws:
      DAValidateException - if validation fails or the data collection template is not found
      DAException - 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 - the DTODataCollectionTemplateInsert containing the data for the new data collection template
      Returns:
      a ResponseEntity containing a DTOIdentifier with 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 fails
      DAException - 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 update
      dto - the DTODataCollectionTemplateUpdate containing the fields to update
      Returns:
      a ResponseEntity with no content (HTTP 204) on successful update
      Throws:
      DAValidateException - if validation fails or the data collection template is not found
      DAException - 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 ResponseEntity containing the DTODataCollectionTemplateWorkingCopy
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      dto - the DTODataCollectionTemplateWorkingCopyUpdate containing the fields to update
      Returns:
      a ResponseEntity with no content (HTTP 204) on successful update
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      language - the language code for localized strings (defaults to user's language)
      Returns:
      a ResponseEntity containing the TreeModel of DTODataCollectionNode
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      input - the TreeModel of DTODataCollectionNode containing the updated tree structure
      Returns:
      a ResponseEntity with no content (HTTP 204) on successful update
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      language - the language code for localized strings (defaults to user's language)
      Returns:
      a ResponseEntity containing a list of DTODataCollectionGlobalExpression
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      input - the list of DTODataCollectionGlobalExpression containing the updated global expressions
      Returns:
      a ResponseEntity with no content (HTTP 204) on successful update
      Throws:
      DAValidateException - if validation fails or the template is not found
      DAException - 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 template
      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 results
      language - the language code for localized strings (defaults to user's language)
      filter - the search filter criteria for releases
      Returns:
      a ResponseEntity containing a PageResponse with the collection of DTODataCollectionTemplateRelease
      Throws:
      DAValidateException - if validation fails
      DAException - 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 template
      releaseId - the unique identifier of the release
      language - 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 ResponseEntity containing the DTODataCollectionTemplateRelease
      Throws:
      DAValidateException - if validation fails or the release is not found
      DAException - 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 template
      releaseId - the unique identifier of the release to update
      dto - the DTODataCollectionTemplateReleaseUpdate containing the fields to update
      Returns:
      a ResponseEntity with no content (HTTP 204) on successful update
      Throws:
      DAValidateException - if validation fails or the release is not found
      DAException - 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 template
      releaseId - the unique identifier of the release
      language - the language code for localized strings (defaults to user's language)
      Returns:
      a ResponseEntity containing the TreeModel of DTODataCollectionNode
      Throws:
      DAValidateException - if validation fails or the release is not found
      DAException - 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 template
      releaseId - the unique identifier of the release
      language - the language code for localized strings (defaults to user's language)
      Returns:
      a ResponseEntity containing a list of DTODataCollectionGlobalExpression
      Throws:
      DAValidateException - if validation fails or the release is not found
      DAException - 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 template
      language - 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 ResponseEntity containing the DTODataCollectionTemplateRelease
      Throws:
      DAValidateException - if validation fails or the current release is not found
      DAException - 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 template
      language - the language code for localized strings (defaults to user's language)
      Returns:
      a ResponseEntity containing the TreeModel of DTODataCollectionNode
      Throws:
      DAValidateException - if validation fails or the current release is not found
      DAException - 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 template
      dto - the DTODataCollectionTemplateReleaseInsert containing the data for the new release
      Returns:
      a ResponseEntity containing a DTOIdentifier with the ID of the newly created release. The response includes a Location header with the URI of the created resource.
      Throws:
      DAValidateException - if validation fails
      DAException - 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 template
      dto - the DTODataCollectionTemplateSheetInsert containing the data for the new sheet
      Returns:
      a ResponseEntity containing a DTOIdentifier with the ID of the newly created sheet. The response includes a Location header with the URI of the created resource.
      Throws:
      DAValidateException - if validation fails
      DAException - if a data access error occurs