Search in sources :

Example 1 with UIOptionsMigrationException

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);
        }
    }
}
Also used : UIOptionsMigrator(org.openforis.collect.metamodel.ui.UIOptionsMigrator) UIConfiguration(org.openforis.collect.metamodel.ui.UIConfiguration) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey) IOException(java.io.IOException) SurveyImportException(org.openforis.collect.persistence.SurveyImportException) UIOptionsMigrationException(org.openforis.collect.metamodel.ui.UIOptionsMigrator.UIOptionsMigrationException) UIOptionsMigrationException(org.openforis.collect.metamodel.ui.UIOptionsMigrator.UIOptionsMigrationException)

Aggregations

IOException (java.io.IOException)1 CollectAnnotations (org.openforis.collect.metamodel.CollectAnnotations)1 UIConfiguration (org.openforis.collect.metamodel.ui.UIConfiguration)1 UIOptionsMigrator (org.openforis.collect.metamodel.ui.UIOptionsMigrator)1 UIOptionsMigrationException (org.openforis.collect.metamodel.ui.UIOptionsMigrator.UIOptionsMigrationException)1 CollectSurvey (org.openforis.collect.model.CollectSurvey)1 SurveyImportException (org.openforis.collect.persistence.SurveyImportException)1