Search in sources :

Example 1 with State

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();
}
Also used : CollectRecord(org.openforis.collect.model.CollectRecord) User(org.openforis.collect.model.User) State(org.openforis.collect.model.CollectRecord.State) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 CollectRecord (org.openforis.collect.model.CollectRecord)1 State (org.openforis.collect.model.CollectRecord.State)1 User (org.openforis.collect.model.User)1