public TrackingConfigurationVo saveTrackinConfig( TrackingConfigurationVo trackingConfigToSave, TrackingAreaVo trackingAreaToSave) throws StaleObjectException { if (trackingConfigToSave == null && trackingAreaToSave == null) throw new CodingRuntimeException( "Cannot save TrackingConfiguration/TrackingArea if null or get TrackingConfiguration/TrackingArea on null ID . "); DomainFactory factory = getDomainFactory(); if (trackingConfigToSave != null) { if (!trackingConfigToSave.isValidated()) throw new CodingRuntimeException("TrackingConfigurationVo not Validated"); TrackingConfiguration trackingConfig = TrackingConfigurationVoAssembler.extractTrackingConfiguration( factory, trackingConfigToSave); factory.save(trackingConfig); return TrackingConfigurationVoAssembler.create(trackingConfig); } else if (trackingAreaToSave != null) { if (!trackingAreaToSave.isValidated()) throw new CodingRuntimeException("TrackingAreaVo not Validated"); TrackingArea trackingArea = TrackingAreaVoAssembler.extractTrackingArea(factory, trackingAreaToSave); factory.save(trackingArea); return null; } return null; }
private TrackingAreaVo populateDataFromScreen( TrackingAreaVo trackingArea) // latest changes 06.04.2012 { ColumnDetailVoCollection collectionToSave = new ColumnDetailVoCollection(); for (int i = 0; i < form.grdAreaWorkspace().getRows().size(); i++) { collectionToSave.add(form.grdAreaWorkspace().getRows().get(i).getValue()); } trackingArea.setColumns(collectionToSave); return trackingArea; }