Search in sources :

Example 1 with ExpressionFactory

use of org.openforis.idm.model.expression.ExpressionFactory in project collect by openforis.

the class UIOptionsTest method initSurvey.

protected void initSurvey() {
    SurveyContext ctx = new CollectSurveyContext(new ExpressionFactory(), new CollectValidator());
    survey = (CollectSurvey) ctx.createSurvey();
    schema = survey.getSchema();
    populateSchema();
    initUIOptions();
}
Also used : ExpressionFactory(org.openforis.idm.model.expression.ExpressionFactory) CollectSurveyContext(org.openforis.collect.model.CollectSurveyContext) CollectValidator(org.openforis.collect.model.validation.CollectValidator) CollectSurveyContext(org.openforis.collect.model.CollectSurveyContext) SurveyContext(org.openforis.idm.metamodel.SurveyContext)

Example 2 with ExpressionFactory

use of org.openforis.idm.model.expression.ExpressionFactory in project collect by openforis.

the class CollectRelationalTest method loadSurvey.

@BeforeClass
public static void loadSurvey() throws IdmlParseException, FileNotFoundException {
    InputStream is = ClassLoader.getSystemResourceAsStream("test.idm.xml");
    // InputStream is = new FileInputStream("/home/gino/workspace/of/idm/idm-test/src/main/resources/test.idm.xml");
    // InputStream is = new FileInputStream("D:/data/workspace/idm/idm-test/src/main/resources/test.idm.xml");
    // InputStream is = new FileInputStream("/home/gino/workspace/faofin/tz/naforma-idm/tanzania-naforma.idm.xml");
    CollectSurveyContext ctx = new CollectSurveyContext(new ExpressionFactory(), null);
    // DefaultSurveyContext ctx = new DefaultSurveyContext();
    CollectSurveyIdmlBinder binder = new CollectSurveyIdmlBinder(ctx);
    survey = (CollectSurvey) binder.unmarshal(is);
}
Also used : ExpressionFactory(org.openforis.idm.model.expression.ExpressionFactory) InputStream(java.io.InputStream) CollectSurveyContext(org.openforis.collect.model.CollectSurveyContext) CollectSurveyIdmlBinder(org.openforis.collect.persistence.xml.CollectSurveyIdmlBinder) BeforeClass(org.junit.BeforeClass)

Aggregations

CollectSurveyContext (org.openforis.collect.model.CollectSurveyContext)2 ExpressionFactory (org.openforis.idm.model.expression.ExpressionFactory)2 InputStream (java.io.InputStream)1 BeforeClass (org.junit.BeforeClass)1 CollectValidator (org.openforis.collect.model.validation.CollectValidator)1 CollectSurveyIdmlBinder (org.openforis.collect.persistence.xml.CollectSurveyIdmlBinder)1 SurveyContext (org.openforis.idm.metamodel.SurveyContext)1