use of org.openforis.collect.model.CollectRecord.State in project collect by openforis.
the class DataHandler method startRecord.
public void startRecord(String localName, Attributes attributes) {
String versionName = extractVersionName(attributes);
record = new CollectRecord(currentSurvey, versionName, localName, validationEnabled);
String stateAttr = attributes.getValue(ATTRIBUTE_STATE);
State state = State.fromCode(stateAttr);
record.setState(state);
Date created = Dates.parseDateTime(attributes.getValue(ATTRIBUTE_DATE_CREATED));
Date modified = Dates.parseDateTime(attributes.getValue(ATTRIBUTE_DATE_MODIFIED));
record.setCreationDate(created);
record.setModifiedDate(modified);
String createdByUserName = attributes.getValue(ATTRIBUTE_CREATED_BY);
User createdBy = fetchUser(createdByUserName);
record.setCreatedBy(createdBy);
String modifiedByUserName = attributes.getValue(ATTRIBUTE_MODIFIED_BY);
User modifiedBy = fetchUser(modifiedByUserName);
record.setModifiedBy(modifiedBy);
node = record.getRootEntity();
}
Aggregations