Class RecordController

    • Constructor Detail

      • RecordController

        public RecordController()
    • Method Detail

      • loadData

        @RequestMapping(value="survey/{surveyId}/data/records/{recordId}/binary_data.json",
                        method=GET)
        @ResponseBody
        public Map<String,​Object> loadData​(@PathVariable("surveyId")
                                                 int surveyId,
                                                 @PathVariable("recordId")
                                                 int recordId,
                                                 @RequestParam("step")
                                                 Integer stepNumber)
                                          throws Exception
        Throws:
        Exception
      • getCount

        @RequestMapping(value="survey/{surveyId}/data/records/count.json",
                        method=GET)
        @ResponseBody
        public int getCount​(@PathVariable("surveyId")
                            int surveyId,
                            @RequestParam(value="rootEntityDefinitionId",required=false)
                            Integer rootEntityDefinitionId,
                            @RequestParam(value="step",required=false)
                            Integer stepNumber)
                     throws Exception
        Throws:
        Exception
      • loadRecord

        @RequestMapping(value="survey/{surveyId}/data/records/{recordId}",
                        method=GET,
                        produces="application/json")
        @ResponseBody
        public RecordProxy loadRecord​(@PathVariable("surveyId")
                                      int surveyId,
                                      @PathVariable("recordId")
                                      int recordId,
                                      @RequestParam(value="step",required=false)
                                      Integer stepNumber,
                                      @RequestParam(value="lock",required=false,defaultValue="false")
                                      boolean lock)
                               throws RecordPersistenceException
        Throws:
        RecordPersistenceException
      • demoteRecord

        @RequestMapping(value="survey/{surveyId}/data/records/demote/{recordId}",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public org.openforis.commons.web.Response demoteRecord​(@PathVariable("surveyId")
                                                               int surveyId,
                                                               @PathVariable("recordId")
                                                               int recordId)
                                                        throws RecordPersistenceException
        Throws:
        RecordPersistenceException
      • moveRecords

        @RequestMapping(value="survey/{surveyId}/data/move/records",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JobProxy moveRecords​(@PathVariable("surveyId")
                                    int surveyId,
                                    @RequestParam
                                    String fromStep,
                                    @RequestParam
                                    boolean promote)
      • startRecordImportSummaryJob

        @RequestMapping(value="survey/{surveyId}/data/import/records/summary",
                        method=POST,
                        consumes="multipart/form-data")
        @ResponseBody
        public CollectJobController.JobView startRecordImportSummaryJob​(@PathVariable("surveyId")
                                                                        int surveyId,
                                                                        @RequestParam("file")
                                                                        org.springframework.web.multipart.MultipartFile multipartFile,
                                                                        @RequestParam
                                                                        String rootEntityName)
                                                                 throws IOException
        Throws:
        IOException
      • downloadRecordImportSummary

        @RequestMapping(value="survey/{surveyId}/data/import/records/summary",
                        method=GET)
        @ResponseBody
        public DataImportSummaryProxy downloadRecordImportSummary​(@PathVariable("surveyId")
                                                                  int surveyId)
                                                           throws IOException
        Throws:
        IOException
      • startRecordImport

        @RequestMapping(value="survey/{surveyId}/data/import/records",
                        method=POST)
        @ResponseBody
        public CollectJobController.JobView startRecordImport​(@PathVariable("surveyId")
                                                              int surveyId,
                                                              @RequestParam
                                                              List<Integer> entryIdsToImport,
                                                              @RequestParam(defaultValue="true")
                                                              boolean validateRecords)
                                                       throws IOException
        Throws:
        IOException
      • startCsvDataImportJob

        @RequestMapping(value="survey/{surveyId}/data/csvimport/records",
                        method=POST,
                        consumes="multipart/form-data")
        @ResponseBody
        public CollectJobController.JobView startCsvDataImportJob​(@PathVariable("surveyId")
                                                                  int surveyId,
                                                                  @RequestParam("file")
                                                                  org.springframework.web.multipart.MultipartFile multipartFile,
                                                                  @RequestParam
                                                                  String rootEntityName,
                                                                  @RequestParam
                                                                  String importType,
                                                                  @RequestParam
                                                                  String steps,
                                                                  @RequestParam(required=false)
                                                                  Integer entityDefinitionId,
                                                                  @RequestParam(required=false)
                                                                  boolean validateRecords,
                                                                  @RequestParam(required=false)
                                                                  boolean deleteEntitiesBeforeImport,
                                                                  @RequestParam(required=false)
                                                                  String newRecordVersionName)
                                                           throws IOException
        Throws:
        IOException
      • getCsvDataImportStatus

        @RequestMapping(value="survey/{surveyId}/data/csvimport/records",
                        method=GET)
        @ResponseBody
        public DataImportStatusProxy getCsvDataImportStatus​(@PathVariable("surveyId")
                                                            int surveyId)
      • exportRecordToCsv

        @RequestMapping(value="survey/{survey_id}/data/records/{record_id}/steps/{step}/content/csv/data.zip",
                        method=GET,
                        produces="application/zip")
        public void exportRecordToCsv​(@PathVariable("survey_id")
                                      int surveyId,
                                      @PathVariable("record_id")
                                      int recordId,
                                      @PathVariable("step")
                                      int stepNumber,
                                      javax.servlet.http.HttpServletResponse response)
                               throws RecordPersistenceException,
                                      IOException
        Throws:
        RecordPersistenceException
        IOException
      • exportRecordToExcel

        @RequestMapping(value="survey/{survey_id}/data/records/{record_id}/steps/{step}/content/xlsx/data.zip",
                        method=GET,
                        produces="application/zip")
        public void exportRecordToExcel​(@PathVariable("survey_id")
                                        int surveyId,
                                        @PathVariable("record_id")
                                        int recordId,
                                        @PathVariable("step")
                                        int stepNumber,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws RecordPersistenceException,
                                        IOException
        Throws:
        RecordPersistenceException
        IOException
      • loadSurveyId

        @RequestMapping(value="data/records/{recordId}/surveyId",
                        method=GET)
        @ResponseBody
        public int loadSurveyId​(@PathVariable("recordId")
                                int recordId)
      • getCsvDataExportJob

        @RequestMapping(value="survey/{surveyId}/data/records/currentcsvexport",
                        method=GET)
        @ResponseBody
        public CollectJobController.JobView getCsvDataExportJob​(javax.servlet.http.HttpServletResponse response)
      • exportRecordToCollectFormat

        @RequestMapping(value="survey/{survey_id}/data/records/{record_id}/content/collect/data.collect-data",
                        method=GET,
                        produces="application/zip")
        public void exportRecordToCollectFormat​(@PathVariable("survey_id")
                                                int surveyId,
                                                @PathVariable("record_id")
                                                int recordId,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws RecordPersistenceException,
                                                IOException
        Throws:
        RecordPersistenceException
        IOException
      • generateStats

        @RequestMapping(value="survey/{surveyId}/data/records/stats",
                        method=GET)
        @ResponseBody
        public RecordStatsGenerator.RecordsStats generateStats​(@PathVariable("surveyId")
                                                               int surveyId)
      • startValidationResportJob

        @RequestMapping(value="survey/{surveyId}/data/records/validationreport",
                        method=POST)
        @ResponseBody
        public JobProxy startValidationResportJob​(@PathVariable("surveyId")
                                                  int surveyId)
      • getFullBackupJobView

        @RequestMapping(value="survey/{surveyId}/data/records/backupexportjob",
                        method=GET)
        @ResponseBody
        public CollectJobController.JobView getFullBackupJobView()
      • releaseRecordLock

        @RequestMapping(value="survey/{surveyId}/data/records/releaselock/{recordId}",
                        method=POST)
        @ResponseBody
        public org.openforis.commons.web.Response releaseRecordLock​(@PathVariable
                                                                    int recordId)
      • startRandomRecordsGenerationJob

        @RequestMapping(value="survey/{surveyId}/data/records/randomgrid",
                        method=POST,
                        produces="application/json")
        @ResponseBody
        public JobProxy startRandomRecordsGenerationJob​(@PathVariable("surveyId")
                                                        int surveyId,
                                                        @RequestParam
                                                        String oldMeasurement,
                                                        @RequestParam
                                                        String newMeasurement,
                                                        @RequestParam
                                                        Double percentage,
                                                        @RequestParam
                                                        String sourceGridSurveyFileName,
                                                        @RequestParam
                                                        Boolean countOnly)