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;
}
}
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;
}
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;
}
Aggregations