Search in sources :

Example 1 with SurveyView

use of org.openforis.collect.metamodel.view.SurveyView in project collect by openforis.

the class SessionController method getActiveSurvey.

@RequestMapping(value = "survey", method = GET)
@ResponseBody
public SurveyView getActiveSurvey(HttpServletResponse response) {
    CollectSurvey survey = getUpdatedActiveSurvey();
    if (survey == null) {
        HttpResponses.setNoContentStatus(response);
        return null;
    } else {
        Locale locale = sessionManager.getSessionState().getLocale();
        if (locale == null) {
            locale = Locale.ENGLISH;
        }
        SurveyViewGenerator viewGenerator = new SurveyViewGenerator(locale.getLanguage());
        SurveyView view = viewGenerator.generateView(survey);
        return view;
    }
}
Also used : Locale(java.util.Locale) SurveyViewGenerator(org.openforis.collect.metamodel.view.SurveyViewGenerator) SurveyView(org.openforis.collect.metamodel.view.SurveyView) CollectSurvey(org.openforis.collect.model.CollectSurvey) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with SurveyView

use of org.openforis.collect.metamodel.view.SurveyView in project collect by openforis.

the class SimpleSurveyCreationController method generateView.

private SurveyView generateView(CollectSurvey survey, boolean includeCodeListValues) {
    if (survey == null) {
        return null;
    }
    SurveyViewGenerator viewGenerator = new SurveyViewGenerator(Locale.ENGLISH.getLanguage());
    viewGenerator.setIncludeCodeListValues(includeCodeListValues);
    SurveyView view = viewGenerator.generateView(survey);
    return view;
}
Also used : SurveyViewGenerator(org.openforis.collect.metamodel.view.SurveyViewGenerator) SurveyView(org.openforis.collect.metamodel.view.SurveyView)

Example 3 with SurveyView

use of org.openforis.collect.metamodel.view.SurveyView in project collect by openforis.

the class SurveyController method generateView.

private SurveyView generateView(CollectSurvey survey, boolean includeCodeListValues) {
    if (survey == null) {
        return null;
    }
    SurveyViewGenerator viewGenerator = new SurveyViewGenerator(Locale.ENGLISH.getLanguage());
    viewGenerator.setIncludeCodeListValues(includeCodeListValues);
    SurveyView view = viewGenerator.generateView(survey);
    return view;
}
Also used : SurveyViewGenerator(org.openforis.collect.metamodel.view.SurveyViewGenerator) SurveyView(org.openforis.collect.metamodel.view.SurveyView)

Aggregations

SurveyView (org.openforis.collect.metamodel.view.SurveyView)3 SurveyViewGenerator (org.openforis.collect.metamodel.view.SurveyViewGenerator)3 Locale (java.util.Locale)1 CollectSurvey (org.openforis.collect.model.CollectSurvey)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1