use of org.openforis.collect.metamodel.ui.UIOptionsMigrator.UIOptionsMigrationException in project collect by openforis.
the class CollectSurveyIdmlBinder method onUnmarshallingComplete.
@Override
protected void onUnmarshallingComplete(Survey survey) {
super.onUnmarshallingComplete(survey);
CollectSurvey collectSurvey = (CollectSurvey) survey;
CollectAnnotations annotations = collectSurvey.getAnnotations();
collectSurvey.setTarget(annotations.getSurveyTarget());
collectSurvey.setCollectVersion(annotations.getCollectVersion());
if (collectSurvey.getUIOptions() != null) {
try {
UIConfiguration uiConfiguration = new UIOptionsMigrator().migrateToUIConfiguration(collectSurvey.getUIOptions());
collectSurvey.setUIConfiguration(uiConfiguration);
} catch (UIOptionsMigrationException e) {
log.error("Error generating UI model for survey " + collectSurvey.getUri() + ": " + e.getMessage());
} catch (Exception e) {
log.error("Error generating UI model for survey " + collectSurvey.getUri() + ": " + e.getMessage(), e);
}
}
}
Aggregations