Class RecordController
- java.lang.Object
-
- org.openforis.collect.web.controller.BasicController
-
- org.openforis.collect.web.controller.RecordController
-
- All Implemented Interfaces:
Serializable
@Controller @Scope("session") @RequestMapping("api") public class RecordController extends BasicController implements Serializable- Author:
- S. Ricci
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecordController.BackupDataExportParametersstatic classRecordController.CSVExportParametersFormstatic classRecordController.RecordDeleteParametersstatic classRecordController.RecordSummarySearchParametersstatic classRecordController.SearchParameters
-
Constructor Summary
Constructors Constructor Description RecordController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordProxycreateRandomRecord(int surveyId, RecordGenerator.NewRecordParameters params)org.openforis.commons.web.ResponsedeleteRecord(int surveyId, @Valid RecordController.RecordDeleteParameters params)org.openforis.commons.web.ResponsedemoteRecord(int surveyId, int recordId)voiddownloadBackupExportResult(javax.servlet.http.HttpServletResponse response)voiddownloadCsvExportResult(javax.servlet.http.HttpServletResponse response)DataImportSummaryProxydownloadRecordImportSummary(int surveyId)voiddownloadValidationReportResult(javax.servlet.http.HttpServletResponse response)voidexportRecord(int surveyId, int recordId, int stepNumber, CSVDataExportParametersBase.OutputFormat outputFormat, javax.servlet.http.HttpServletResponse response)voidexportRecordToCollectFormat(int surveyId, int recordId, javax.servlet.http.HttpServletResponse response)voidexportRecordToCsv(int surveyId, int recordId, int stepNumber, javax.servlet.http.HttpServletResponse response)voidexportRecordToExcel(int surveyId, int recordId, int stepNumber, javax.servlet.http.HttpServletResponse response)RecordStatsGenerator.RecordsStatsgenerateStats(int surveyId)intgetCount(int surveyId, Integer rootEntityDefinitionId, Integer stepNumber)CollectJobController.JobViewgetCsvDataExportJob(javax.servlet.http.HttpServletResponse response)DataImportStatusProxygetCsvDataImportStatus(int surveyId)CollectJobController.JobViewgetFullBackupJobView()Map<String,Object>loadData(int surveyId, int recordId, Integer stepNumber)RecordProxyloadRecord(int surveyId, int recordId, Integer stepNumber, boolean lock)Map<String,Object>loadRecordSummaries(int surveyId, @Valid RecordController.RecordSummarySearchParameters params)intloadSurveyId(int recordId)JobProxymoveRecords(int surveyId, String fromStep, boolean promote)RecordProxynewRecord(int surveyId, RecordGenerator.NewRecordParameters params)org.openforis.commons.web.ResponsepromoteRecord(int surveyId, int recordId)org.openforis.commons.web.ResponsereleaseRecordLock(int recordId)CollectJobController.JobViewstartBackupDataExportJob(int surveyId, RecordController.BackupDataExportParameters parameters)CollectJobController.JobViewstartCsvDataExportJob(int surveyId, RecordController.CSVExportParametersForm parameters)CollectJobController.JobViewstartCsvDataImportJob(int surveyId, org.springframework.web.multipart.MultipartFile multipartFile, String rootEntityName, String importType, String steps, Integer entityDefinitionId, boolean validateRecords, boolean deleteEntitiesBeforeImport, String newRecordVersionName)JobProxystartRandomRecordsGenerationJob(int surveyId, String oldMeasurement, String newMeasurement, Double percentage, String sourceGridSurveyFileName, Boolean countOnly)CollectJobController.JobViewstartRecordImport(int surveyId, List<Integer> entryIdsToImport, boolean validateRecords)CollectJobController.JobViewstartRecordImportSummaryJob(int surveyId, org.springframework.web.multipart.MultipartFile multipartFile, String rootEntityName)JobProxystartValidationResportJob(int surveyId)org.openforis.commons.web.ResponseupdateOwner(int surveyId, int recordId, Map<String,String> body)-
Methods inherited from class org.openforis.collect.web.controller.BasicController
generateFormValidationResponse, getSessionState
-
-
-
-
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
-
loadRecordSummaries
@RequestMapping(value="survey/{surveyId}/data/records/summary", method=GET) @ResponseBody public Map<String,Object> loadRecordSummaries(@PathVariable("surveyId") int surveyId, @Valid @Valid RecordController.RecordSummarySearchParameters params)
-
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
-
updateOwner
@RequestMapping(value="survey/{surveyId}/data/update/records/{recordId}", method=POST, produces="application/json") @ResponseBody public org.openforis.commons.web.Response updateOwner(@PathVariable("surveyId") int surveyId, @PathVariable("recordId") int recordId, @RequestBody Map<String,String> body) throws RecordLockedException, MultipleEditException
-
promoteRecord
@RequestMapping(value="survey/{surveyId}/data/records/promote/{recordId}", method=POST, produces="application/json") @ResponseBody public org.openforis.commons.web.Response promoteRecord(@PathVariable("surveyId") int surveyId, @PathVariable("recordId") int recordId) throws MissingRecordKeyException, RecordPromoteException
-
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)
-
newRecord
@Transactional @RequestMapping(value="survey/{surveyId}/data/records", method=POST, consumes="application/json") @ResponseBody public RecordProxy newRecord(@PathVariable("surveyId") int surveyId, @RequestBody RecordGenerator.NewRecordParameters params) throws RecordPersistenceException- Throws:
RecordPersistenceException
-
createRandomRecord
@Transactional @RequestMapping(value="survey/{surveyId}/data/records/random", method=POST, consumes="application/json") @ResponseBody public RecordProxy createRandomRecord(@PathVariable("surveyId") int surveyId, @RequestBody RecordGenerator.NewRecordParameters params) throws RecordPersistenceException- Throws:
RecordPersistenceException
-
deleteRecord
@RequestMapping(value="survey/{surveyId}/data/records", method=DELETE, produces="application/json") @ResponseBody public org.openforis.commons.web.Response deleteRecord(@PathVariable("surveyId") int surveyId, @Valid @Valid RecordController.RecordDeleteParameters params) throws RecordPersistenceException- Throws:
RecordPersistenceException
-
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
-
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
-
exportRecord
public void exportRecord(int surveyId, int recordId, int stepNumber, CSVDataExportParametersBase.OutputFormat outputFormat, javax.servlet.http.HttpServletResponse response) throws RecordPersistenceException, IOException
-
loadSurveyId
@RequestMapping(value="data/records/{recordId}/surveyId", method=GET) @ResponseBody public int loadSurveyId(@PathVariable("recordId") int recordId)
-
startCsvDataExportJob
@RequestMapping(value="survey/{surveyId}/data/records/startcsvexport", method=POST) @ResponseBody public CollectJobController.JobView startCsvDataExportJob(@PathVariable("surveyId") int surveyId, @RequestBody RecordController.CSVExportParametersForm parameters) throws IOException- Throws:
IOException
-
getCsvDataExportJob
@RequestMapping(value="survey/{surveyId}/data/records/currentcsvexport", method=GET) @ResponseBody public CollectJobController.JobView getCsvDataExportJob(javax.servlet.http.HttpServletResponse response)
-
downloadCsvExportResult
@RequestMapping(value="survey/{surveyId}/data/records/csvexportresult.zip", method=GET) public void downloadCsvExportResult(javax.servlet.http.HttpServletResponse response) throws FileNotFoundException, IOException- Throws:
FileNotFoundExceptionIOException
-
startBackupDataExportJob
@RequestMapping(value="survey/{surveyId}/data/records/startbackupexport", method=POST) @ResponseBody public CollectJobController.JobView startBackupDataExportJob(@PathVariable("surveyId") int surveyId, @RequestBody RecordController.BackupDataExportParameters parameters) throws IOException- Throws:
IOException
-
downloadBackupExportResult
@RequestMapping(value="survey/{surveyId}/data/records/exportresult.collect-data", method=GET) public void downloadBackupExportResult(javax.servlet.http.HttpServletResponse response) throws FileNotFoundException, IOException- Throws:
FileNotFoundExceptionIOException
-
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
-
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)
-
downloadValidationReportResult
@RequestMapping(value="survey/{surveyId}/data/records/validationreport.csv", method=GET) public void downloadValidationReportResult(javax.servlet.http.HttpServletResponse response) throws FileNotFoundException, IOException- Throws:
FileNotFoundExceptionIOException
-
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)
-
-