use of org.openforis.collect.model.CollectRecord in project collect by openforis.
the class RecordDao method load.
public CollectRecord load(CollectSurvey survey, int id, Step step, boolean toBeUpdated) {
SelectQuery query = selectRecordQuery(id, false, step, null);
Record r = query.fetchOne();
return r == null ? null : fromQueryResult(survey, r, toBeUpdated);
}
use of org.openforis.collect.model.CollectRecord in project collect by openforis.
the class RecordDao method load.
public CollectRecord load(CollectSurvey survey, int id, int workflowSequenceNumber, boolean toBeUpdated) {
SelectQuery query = selectRecordQuery(id, false, null, workflowSequenceNumber);
Record r = query.fetchOne();
return r == null ? null : fromQueryResult(survey, r, toBeUpdated);
}
use of org.openforis.collect.model.CollectRecord in project collect by openforis.
the class CollectMinCountValidator method evaluate.
@Override
public ValidationResultFlag evaluate(Entity entity) {
CollectRecord record = (CollectRecord) entity.getRecord();
ValidationResultFlag resultFlag = super.evaluate(entity);
// you can approve missing values in entry phase as well
if (resultFlag == ValidationResultFlag.ERROR) {
if (record.getStep() == Step.CLEANSING && record.isMissingApproved(entity, getNodeDefinition())) {
resultFlag = ValidationResultFlag.WARNING;
}
}
return resultFlag;
}
use of org.openforis.collect.model.CollectRecord in project collect by openforis.
the class CollectNumberValueUnitValidator method evaluate.
@Override
public ValidationResultFlag evaluate(NumberAttribute<?, ?> attribute) {
CollectRecord record = (CollectRecord) attribute.getRecord();
Step step = record.getStep();
ValidationResultFlag resultFlag = super.evaluate(attribute);
if (resultFlag == ValidationResultFlag.ERROR && step == Step.ENTRY) {
Character unitSymbolChar = attribute.getUnitField().getSymbol();
FieldSymbol unitSymbol = FieldSymbol.valueOf(unitSymbolChar);
if (unitSymbol != null && unitSymbol.isReasonBlank()) {
return ValidationResultFlag.WARNING;
}
}
return resultFlag;
}
use of org.openforis.collect.model.CollectRecord in project collect by openforis.
the class CollectValidator method validateMaxCount.
@Override
public ValidationResultFlag validateMaxCount(Entity entity, NodeDefinition childDef) {
ValidationResultFlag flag = super.validateMaxCount(entity, childDef);
CollectRecord record = (CollectRecord) entity.getRecord();
record.updateMaxCountsValidationCache(entity, childDef, flag);
return flag;
}
Aggregations