Search in sources :

Example 66 with Field

use of com.google.firestore.admin.v1.Field in project atlasmap by atlasmap.

the class BaseDefaultAtlasContextTest method populateCollectionSourceField.

protected FieldGroup populateCollectionSourceField(Mapping mapping, String docId, String seed) {
    String basePath = "/testPath" + seed;
    FieldGroup fieldGroup = new FieldGroup();
    fieldGroup.setFieldType(FieldType.STRING);
    fieldGroup.setDocId(docId);
    fieldGroup.setPath(basePath + "<>");
    if (mapping != null) {
        mapping.setInputFieldGroup(fieldGroup);
    }
    for (int i = 0; i < 10; i++) {
        Field child = new SimpleField();
        child.setFieldType(FieldType.STRING);
        child.setDocId(docId);
        child.setPath(basePath + "<" + i + ">");
        child.setValue(seed + i);
        child.setIndex(i);
        fieldGroup.getField().add(child);
        reader.sources.put(child.getPath(), child.getValue());
    }
    reader.sources.put(fieldGroup.getPath(), fieldGroup);
    return fieldGroup;
}
Also used : Field(io.atlasmap.v2.Field) SimpleField(io.atlasmap.v2.SimpleField) FieldGroup(io.atlasmap.v2.FieldGroup) SimpleField(io.atlasmap.v2.SimpleField)

Example 67 with Field

use of com.google.firestore.admin.v1.Field in project atlasmap by atlasmap.

the class BaseDefaultAtlasContextTest method populateSourceField.

protected Field populateSourceField(Mapping mapping, FieldType type, Object value) {
    Field field = new SimpleField();
    field.setFieldType(type);
    field.setPath("/testPath" + value);
    if (mapping != null) {
        mapping.getInputField().add(field);
    }
    reader.sources.put(field.getPath(), value);
    return field;
}
Also used : Field(io.atlasmap.v2.Field) SimpleField(io.atlasmap.v2.SimpleField) SimpleField(io.atlasmap.v2.SimpleField)

Example 68 with Field

use of com.google.firestore.admin.v1.Field in project atlasmap by atlasmap.

the class BaseDefaultAtlasContextTest method populateSourceField.

protected Field populateSourceField(String docId, FieldType type, String name, Object value) {
    Field field = new SimpleField();
    field.setFieldType(type);
    field.setDocId(docId);
    field.setName(name);
    field.setPath("/" + name);
    reader.sources.put(field.getPath(), value);
    return field;
}
Also used : Field(io.atlasmap.v2.Field) SimpleField(io.atlasmap.v2.SimpleField) SimpleField(io.atlasmap.v2.SimpleField)

Example 69 with Field

use of com.google.firestore.admin.v1.Field in project atlasmap by atlasmap.

the class BaseDefaultAtlasContextTest method prepareTargetField.

protected Field prepareTargetField(Mapping mapping, String path, int index) {
    Field field = prepareTargetField(mapping, path);
    field.setIndex(index);
    return field;
}
Also used : Field(io.atlasmap.v2.Field) SimpleField(io.atlasmap.v2.SimpleField)

Example 70 with Field

use of com.google.firestore.admin.v1.Field in project atlasmap by atlasmap.

the class XmlModule method readSourceValue.

@Override
public void readSourceValue(AtlasInternalSession session) throws AtlasException {
    Field sourceField = session.head().getSourceField();
    XmlFieldReader reader = session.getFieldReader(getDocId(), XmlFieldReader.class);
    if (reader == null) {
        AtlasUtil.addAudit(session, sourceField, String.format("Source document '%s' doesn't exist", getDocId()), AuditStatus.ERROR, null);
        return;
    }
    reader.read(session);
    if (LOG.isDebugEnabled()) {
        LOG.debug("{}: processSourceFieldMapping completed: SourceField:[docId={}, path={}, type={}, value={}]", getDocId(), sourceField.getDocId(), sourceField.getPath(), sourceField.getFieldType(), sourceField.getValue());
    }
}
Also used : Field(io.atlasmap.v2.Field) XmlField(io.atlasmap.xml.v2.XmlField) XmlEnumField(io.atlasmap.xml.v2.XmlEnumField) XmlFieldReader(io.atlasmap.xml.core.XmlFieldReader)

Aggregations

Field (io.atlasmap.v2.Field)221 FieldGroup (io.atlasmap.v2.FieldGroup)86 Test (org.junit.jupiter.api.Test)67 SimpleField (io.atlasmap.v2.SimpleField)62 Field (org.apache.tapestry5.Field)46 JavaField (io.atlasmap.java.v2.JavaField)45 ArrayList (java.util.ArrayList)42 Mapping (io.atlasmap.v2.Mapping)39 Test (org.testng.annotations.Test)39 AtlasPath (io.atlasmap.core.AtlasPath)29 ConstantField (io.atlasmap.v2.ConstantField)29 JavaEnumField (io.atlasmap.java.v2.JavaEnumField)26 AtlasException (io.atlasmap.api.AtlasException)25 JsonField (io.atlasmap.json.v2.JsonField)25 MessageFormatter (org.apache.tapestry5.commons.MessageFormatter)25 PropertyField (io.atlasmap.v2.PropertyField)22 AtlasMapping (io.atlasmap.v2.AtlasMapping)21 KafkaConnectField (io.atlasmap.kafkaconnect.v2.KafkaConnectField)19 AtlasInternalSession (io.atlasmap.spi.AtlasInternalSession)19 Head (io.atlasmap.spi.AtlasInternalSession.Head)18