Search in sources :

Example 1 with DataCleansingChainExecutorJob

use of org.openforis.collect.datacleansing.DataCleansingChainExecutorJob in project collect by openforis.

the class DataCleansingChainController method run.

@RequestMapping(value = "{chainId}/run.json", method = RequestMethod.POST)
@ResponseBody
public Response run(@PathVariable int chainId, @RequestParam Step recordStep) {
    CollectSurvey survey = sessionManager.getActiveSurvey();
    DataCleansingChain chain = itemManager.loadById(survey, chainId);
    DataCleansingChainExecutorJob job = collectJobManager.createJob(DataCleansingChainExecutorJob.class);
    job.setChain(chain);
    job.setRecordStep(recordStep);
    collectJobManager.startSurveyJob(job);
    Response response = new Response();
    return response;
}
Also used : Response(org.openforis.commons.web.Response) DataCleansingChain(org.openforis.collect.datacleansing.DataCleansingChain) DataCleansingChainExecutorJob(org.openforis.collect.datacleansing.DataCleansingChainExecutorJob) CollectSurvey(org.openforis.collect.model.CollectSurvey) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with DataCleansingChainExecutorJob

use of org.openforis.collect.datacleansing.DataCleansingChainExecutorJob in project collect by openforis.

the class DataCleansingStepController method run.

@RequestMapping(value = "run.json", method = RequestMethod.POST)
@ResponseBody
public DataCleangingChainExecutorJobView run(@RequestParam int cleansingStepId, @RequestParam Step recordStep) {
    CollectSurvey survey = sessionManager.getActiveSurvey();
    DataCleansingStep cleansingStep = dataCleansingStepManager.loadById(survey, cleansingStepId);
    DataCleansingChain chain = new DataCleansingChain(survey);
    chain.addStep(cleansingStep);
    DataCleansingChainExecutorJob job = collectJobManager.createJob(DataCleansingChainExecutorJob.class);
    job.setSurvey(survey);
    job.setChain(chain);
    job.setRecordStep(recordStep);
    collectJobManager.startSurveyJob(job);
    return new DataCleangingChainExecutorJobView(job);
}
Also used : DataCleansingChain(org.openforis.collect.datacleansing.DataCleansingChain) DataCleansingStep(org.openforis.collect.datacleansing.DataCleansingStep) DataCleansingChainExecutorJob(org.openforis.collect.datacleansing.DataCleansingChainExecutorJob) CollectSurvey(org.openforis.collect.model.CollectSurvey) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

DataCleansingChain (org.openforis.collect.datacleansing.DataCleansingChain)2 DataCleansingChainExecutorJob (org.openforis.collect.datacleansing.DataCleansingChainExecutorJob)2 CollectSurvey (org.openforis.collect.model.CollectSurvey)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 DataCleansingStep (org.openforis.collect.datacleansing.DataCleansingStep)1 Response (org.openforis.commons.web.Response)1