Search in sources :

Example 6 with DataCleansingStep

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

the class DataCleansingChainController method copyFormIntoItem.

@Override
protected void copyFormIntoItem(DataCleansingChainForm form, DataCleansingChain item) {
    super.copyFormIntoItem(form, item);
    item.removeAllSteps();
    for (Integer stepId : form.getStepIds()) {
        DataCleansingStep step = new DataCleansingStep((CollectSurvey) item.getSurvey());
        step.setId(stepId);
        item.addStep(step);
    }
}
Also used : DataCleansingStep(org.openforis.collect.datacleansing.DataCleansingStep)

Example 7 with DataCleansingStep

use of org.openforis.collect.datacleansing.DataCleansingStep 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

DataCleansingStep (org.openforis.collect.datacleansing.DataCleansingStep)7 ArrayList (java.util.ArrayList)3 DataCleansingChain (org.openforis.collect.datacleansing.DataCleansingChain)3 CollectSurvey (org.openforis.collect.model.CollectSurvey)3 DataCleansingChainExecutorJob (org.openforis.collect.datacleansing.DataCleansingChainExecutorJob)1 DataCleansingMetadata (org.openforis.collect.datacleansing.DataCleansingMetadata)1 DataQuery (org.openforis.collect.datacleansing.DataQuery)1 DataQueryGroup (org.openforis.collect.datacleansing.DataQueryGroup)1 DataQueryType (org.openforis.collect.datacleansing.DataQueryType)1 Transactional (org.springframework.transaction.annotation.Transactional)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1