Search in sources :

Example 1 with Input

use of org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob.Input in project collect by openforis.

the class SaikuController method generateRepository.

@RequestMapping(value = "datasources/{surveyName}/generate", method = POST)
@ResponseBody
public JobProxy generateRepository(@PathVariable String surveyName, @RequestParam String language) throws CollectRdbException, SQLException {
    CollectSurvey survey = surveyManager.get(surveyName);
    ReportingRepositoriesGeneratorJob job = jobManager.createJob(ReportingRepositoriesGeneratorJob.class);
    job.setInput(new Input(language));
    job.setSurvey(survey);
    jobManager.startSurveyJob(job);
    return new JobProxy(job);
}
Also used : Input(org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob.Input) JobProxy(org.openforis.concurrency.proxy.JobProxy) ReportingRepositoriesGeneratorJob(org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob) CollectSurvey(org.openforis.collect.model.CollectSurvey) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with Input

use of org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob.Input in project collect by openforis.

the class SaikuService method generateRdb.

@Secured(USER)
public JobProxy generateRdb(final String surveyName, final String preferredLanguage) {
    CollectSurvey survey = surveyManager.get(surveyName);
    ReportingRepositoriesGeneratorJob job = jobManager.createJob(ReportingRepositoriesGeneratorJob.class);
    job.setInput(new Input(preferredLanguage));
    job.setSurvey(survey);
    jobManager.startSurveyJob(job);
    return new JobProxy(job);
}
Also used : Input(org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob.Input) JobProxy(org.openforis.concurrency.proxy.JobProxy) ReportingRepositoriesGeneratorJob(org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob) CollectSurvey(org.openforis.collect.model.CollectSurvey) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

CollectSurvey (org.openforis.collect.model.CollectSurvey)2 ReportingRepositoriesGeneratorJob (org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob)2 Input (org.openforis.collect.reporting.ReportingRepositoriesGeneratorJob.Input)2 JobProxy (org.openforis.concurrency.proxy.JobProxy)2 Secured (org.springframework.security.access.annotation.Secured)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1