Search in sources :

Example 1 with Transformation

use of org.openforis.idm.transform2.Transformation in project collect by openforis.

the class RelationalTransformer method initDataTableTransformations.

/**
 * Recursively init table transformations
 * @param defn
 */
private void initDataTableTransformations(EntityDefinition defn) {
    List<NodeDefinition> children = defn.getChildDefinitions();
    for (NodeDefinition child : children) {
        if (child instanceof EntityDefinition) {
            initDataTableTransformations((EntityDefinition) child);
        }
    }
    if (defn.isMultiple()) {
        Transformation xform = Transformation.createDefaultTransformation(defn);
        Path path = (Path) xform.getRowAxis();
        dataTransforms.put(path, xform);
        System.out.println(path);
    }
}
Also used : Path(org.openforis.idm.path.Path) EntityDefinition(org.openforis.idm.metamodel.EntityDefinition) Transformation(org.openforis.idm.transform2.Transformation) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition)

Example 2 with Transformation

use of org.openforis.idm.transform2.Transformation in project collect by openforis.

the class RelationalTransformer method initDataTableTransformations.

private void initDataTableTransformations() {
    this.dataTransforms = new LinkedHashMap<Path, Transformation>();
    this.schema = survey.getSchema();
    List<EntityDefinition> roots = schema.getRootEntityDefinitions();
    for (EntityDefinition root : roots) {
        initDataTableTransformations(root);
    }
}
Also used : Path(org.openforis.idm.path.Path) EntityDefinition(org.openforis.idm.metamodel.EntityDefinition) Transformation(org.openforis.idm.transform2.Transformation)

Example 3 with Transformation

use of org.openforis.idm.transform2.Transformation in project collect by openforis.

the class IdmDatabaseSnapshotBuilder method createDataTables.

private void createDataTables() throws DatabaseException {
    RelationalTransformer rt = database.getRelationalTransformer();
    List<Transformation> xforms = rt.getTransformations();
    for (Transformation xform : xforms) {
        createDataTable(xform);
    }
// List<EntityDefinition> rootDefns = schema.getRootEntityDefinitions();
// for (EntityDefinition defn : rootDefns) {
// createDataTable(defn);
// }
}
Also used : Transformation(org.openforis.idm.transform2.Transformation)

Aggregations

Transformation (org.openforis.idm.transform2.Transformation)3 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)2 Path (org.openforis.idm.path.Path)2 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)1