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;
}
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;
}
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;
}
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;
}
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());
}
}
Aggregations