public void load(Object parameter) throws Exception {
Log.log("SaveObservationModel.load()");
Object[] params = (Object[]) parameter;
Period period = (Period) params[0];
Observation observation = (Observation) params[1];
Log.log("period:"+period);
Log.log("observ:"+observation);
boolean newPeriodStarted = false;
if (period == null) {
period = new Period(observation.getDate());
newPeriodStarted = true;
} else if (observation.isBleeding()) {
// only current period is "closed" when adding new bleeding
// observations
if (isCurrentPeriod(period) && !isBleeingContinuation(period, observation)) {
period = new Period(observation.getDate());
newPeriodStarted = true;
}
}
Period[] ref = { period };
observation = LogicDAO.addObservationToPeriod(observation, ref, controler);