r1270 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: . content/operation content/operation/catches/benthos content/operation/catches/individualobservation content/operation/catches/individualobservation/create content/operation/catches/marinelitter content/operation/catches/species util/action
Author: tchemit Date: 2013-10-03 11:07:04 +0200 (Thu, 03 Oct 2013) New Revision: 1270 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1270 Log: improve logs fixes #3420: [DONNEES INDIVIDUELLES] Mauvaise liste de choix d'esp?\195?\168ces Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -176,27 +176,6 @@ */ protected final TuttiErrorHelper errorHelper; -// /** -// * Id of last selected program (can be null if none ever selected). -// * -// * @since 0.1 -// */ -// protected String programId; -// -// /** -// * Id of last selected cruise (can be null if none ever selected). -// * -// * @since 0.1 -// */ -// protected String cruiseId; -// -// /** -// * Id of last selected protocol (can be null if none ever selected). -// * -// * @since 0.1 -// */ -// protected String protocolId; - /** * Shared data context. * @@ -307,6 +286,12 @@ @Override public void showInformationMessage(String message) { if (StringUtils.isNotBlank(message)) { + message = message.replaceAll("\\<strong\\>",""); + message = message.replaceAll("\\<.strong\\>",""); + message = message.replaceAll("\\<li\\>",""); + message = message.replaceAll("\\<.li\\>",""); + message = message.replaceAll("\\<ul\\>",""); + message = message.replaceAll("\\<.ul\\>",""); if (log.isInfoEnabled()) { log.info(message); } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -27,6 +27,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import fr.ifremer.tutti.persistence.InvalidBatchModelException; +import fr.ifremer.tutti.persistence.ProgressionModel; import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.TuttiEntities; import fr.ifremer.tutti.persistence.entities.data.Attachment; @@ -340,17 +341,13 @@ errorMessages.clear(); - if (log.isInfoEnabled()) { - log.info("Try to edit fishingOperation: " + fishingOperation); - } - FishingOperationsUI ui = getUI(); FishingOperationsUIModel model = ui.getModel(); // edit new fishing operation if (log.isInfoEnabled()) { - log.info("Edit in ui fishingOperation: " + fishingOperation); + log.info("Edit fishingOperation: " + fishingOperation); } // now fishing operation is edited @@ -593,11 +590,21 @@ boolean catchNotFound; boolean catchEnabled; + String operationId = bean == null ? null : bean.getId(); + + ProgressionModel progressionModel = getProgressionModel(); + if (progressionModel == null) { + progressionModel = new ProgressionModel(); + setProgressionModel(progressionModel); + } + progressionModel.adaptTotal(empty ? 1 : 6); + if (empty) { // create a new CatchBatch - if (log.isInfoEnabled()) { - log.info("Create a new CatchBatch (fishing operation is null)"); + progressionModel.increments("Create new catch batch"); + if (log.isDebugEnabled()) { + log.debug("Create a new CatchBatch (fishing operation is null)"); } batch = CatchBatchs.newCatchBatch(); batch.setFishingOperation(bean); @@ -609,16 +616,17 @@ } else { - String operationId = bean.getId(); - - if (log.isInfoEnabled()) { - log.info("Load existing CatchBatch from operation id: " + - operationId); + if (log.isDebugEnabled()) { + log.debug("Load existing CatchBatch from operation id: " + + operationId); } PersistenceService persistenceService = getContext().getPersistenceService(); + progressionModel.increments("Loading catch batch for fishingOperation: " + + operationId); + boolean withCatchBath = persistenceService.isFishingOperationWithCatchBatch( operationId); @@ -629,7 +637,7 @@ try { batch = persistenceService.getCatchBatchFromFishingOperation(operationId); batch.setFishingOperation(bean); - Integer objectId = Integer.valueOf(batch.getId()); + Integer objectId = batch.getIdAsInt(); attachments = persistenceService.getAllAttachments(catchesUIModel.getObjectType(), objectId); catchNotFound = false; catchEnabled = true; @@ -657,8 +665,7 @@ } } - setCatch(//bean, - attachments, + setCatch(attachments, catchesUIModel, catchBatchMonitor, batch, @@ -674,6 +681,9 @@ boolean catchValid = true; try { + progressionModel.increments("Loading species batch for fishingOperation: " + + operationId); + ui.getSpeciesTabContent().getHandler().selectFishingOperation(operationToLoad); } catch (InvalidBatchModelException e) { @@ -686,6 +696,8 @@ } try { + progressionModel.increments("Loading benthos batch for fishingOperation: " + + operationId); ui.getBenthosTabContent().getHandler().selectFishingOperation(operationToLoad); } catch (InvalidBatchModelException e) { @@ -701,15 +713,22 @@ // load other tabs + progressionModel.increments("Loading marine lietterbatch for fishingOperation: " + + operationId); ui.getMarineLitterTabContent().getHandler().selectFishingOperation(operationToLoad); + + progressionModel.increments("Loading accidental batch for fishingOperation: " + + operationId); ui.getAccidentalTabContent().getHandler().selectFishingOperation(operationToLoad); + + progressionModel.increments("Loading individual observation batch for fishingOperation: " + + operationId); ui.getIndividualObservationTabContent().getHandler().selectFishingOperation(operationToLoad); } else { // remove catch - setCatch(//bean, - Collections.<Attachment>emptyList(), + setCatch(Collections.<Attachment>emptyList(), catchesUIModel, catchBatchMonitor, null, @@ -727,8 +746,7 @@ } - protected void setCatch(//FishingOperation bean, - List<Attachment> attachments, + protected void setCatch(List<Attachment> attachments, EditCatchesUIModel catchesUIModel, TuttiBeanMonitor<EditCatchesUIModel> catchBatchMonitor, CatchBatch batch, @@ -740,8 +758,6 @@ getModel().setCatchNotFound(catchNotFound); getModel().setSampleCatchModelValid(sampleModelValid); -// catchesUIModel.setCatchBatch(batch); -// catchesUIModel.setFishingOperation(bean); catchesUIModel.fromEntity(batch); catchesUIModel.addAllAttachment(attachments); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -221,8 +221,8 @@ rows = null; } else { - if (log.isInfoEnabled()) { - log.info("Get species batch for fishingOperation: " + + if (log.isDebugEnabled()) { + log.debug("Get species batch for fishingOperation: " + bean.getId()); } rows = Lists.newArrayList(); @@ -307,11 +307,6 @@ recomputeRowValidState(row); - if (log.isInfoEnabled()) { - log.info("Property modified [" + propertyName + "] <" + - oldValue + ":" + newValue + ">"); - } - if (SpeciesBatchRowModel.PROPERTY_SAMPLE_CATEGORY_WEIGHT.equals(propertyName)) { // sampling category weight has changed, must then save the top @@ -330,8 +325,8 @@ // ancestor is not this row // then only save ancestor - if (log.isInfoEnabled()) { - log.info("Sample category " + sampleCategoryId + + if (log.isDebugEnabled()) { + log.debug("Sample category " + sampleCategoryId + " weight was modified, First ancestor row: " + firstAncestorIndex + " will save it"); } @@ -699,8 +694,8 @@ List<Integer> samplingOrder = sampleCategoryModel.getSamplingOrder(); - if (log.isInfoEnabled()) { - log.info("Will use sampling order: " + samplingOrder); + if (log.isDebugEnabled()) { + log.debug("Will use sampling order: " + samplingOrder); } JXTable table = getTable(); @@ -1087,8 +1082,8 @@ } } - if (log.isInfoEnabled()) { - log.info("New selected category: " + selectedItem); + if (log.isDebugEnabled()) { + log.debug("New selected category: " + selectedItem); } if (selectedItem != null) { @@ -1146,9 +1141,6 @@ // add new batches to his parent parentBatch.setChildBatch(newBatches); - //TODO Should only save parentBatch (will persist all his childs) - //saveRow(parentBatch); - // save new batches saveRows(newBatches); @@ -1346,8 +1338,8 @@ SampleCategory<?> firstSampleCategory = row.getFirstSampleCategory(); CaracteristicQualitativeValue categoryValue = (CaracteristicQualitativeValue) firstSampleCategory.getCategoryValue(); Preconditions.checkNotNull(firstSampleCategory); - if (log.isInfoEnabled()) { - log.info("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies())); + if (log.isDebugEnabled()) { + log.debug("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies())); } BenthosBatchUIModel model = getModel(); model.getSpeciesUsed().remove(categoryValue, row.getSpecies()); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -130,8 +130,8 @@ rows = null; } else { - if (log.isInfoEnabled()) { - log.info("Get individualObservation batch for fishingOperation: " + + if (log.isDebugEnabled()) { + log.debug("Get individualObservation batch for fishingOperation: " + bean.getId()); } rows = Lists.newArrayList(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-03 09:07:04 UTC (rev 1270) @@ -46,6 +46,7 @@ #individualObservationSpeciesComboBox { property: species; selectedItem: {model.getSpecies()}; + data: {model.getAvailableSpecies()}; } #individualObservationWeightLabel { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -114,8 +114,8 @@ rows = null; } else { - if (log.isInfoEnabled()) { - log.info("Get marineLitter batch for fishingOperation: " + + if (log.isDebugEnabled()) { + log.debug("Get marineLitter batch for fishingOperation: " + bean.getId()); } rows = Lists.newArrayList(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -227,8 +227,8 @@ rows = null; } else { - if (log.isInfoEnabled()) { - log.info("Get species batch for fishingOperation: " + + if (log.isDebugEnabled()) { + log.debug("Get species batch for fishingOperation: " + bean.getId()); } rows = Lists.newArrayList(); @@ -333,8 +333,8 @@ // ancestor is not this row // then only save ancestor - if (log.isInfoEnabled()) { - log.info("Sample category " + sampleCategoryId + + if (log.isDebugEnabled()) { + log.debug("Sample category " + sampleCategoryId + " weight was modified, First ancestor row: " + firstAncestorIndex + " will save it"); } @@ -703,8 +703,8 @@ List<Integer> samplingOrder = sampleCategoryModel.getSamplingOrder(); - if (log.isInfoEnabled()) { - log.info("Will use sampling order: " + samplingOrder); + if (log.isDebugEnabled()) { + log.debug("Will use sampling order: " + samplingOrder); } JXTable table = getTable(); @@ -935,8 +935,8 @@ } if (split) { - if (log.isInfoEnabled()) { - log.info("Open split batch ui for row [" + rowIndex + ']'); + if (log.isDebugEnabled()) { + log.debug("Open split batch ui for row [" + rowIndex + ']'); } EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class); @@ -1090,8 +1090,8 @@ } } - if (log.isInfoEnabled()) { - log.info("New selected category: " + selectedItem); + if (log.isDebugEnabled()) { + log.debug("New selected category: " + selectedItem); } if (selectedItem != null) { @@ -1149,9 +1149,6 @@ // add new batches to his parent parentBatch.setChildBatch(newBatches); - //TODO Should only save parentBatch (will persist all his childs) - //saveRow(parentBatch); - // save new batches saveRows(newBatches); @@ -1350,8 +1347,8 @@ SampleCategory<?> firstSampleCategory = row.getFirstSampleCategory(); CaracteristicQualitativeValue categoryValue = (CaracteristicQualitativeValue) firstSampleCategory.getCategoryValue(); Preconditions.checkNotNull(firstSampleCategory); - if (log.isInfoEnabled()) { - log.info("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies())); + if (log.isDebugEnabled()) { + log.debug("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies())); } SpeciesBatchUIModel model = getModel(); model.getSpeciesUsed().remove(categoryValue, row.getSpecies()); @@ -1548,10 +1545,6 @@ protected Set<Serializable> getSampleUsedValues(SpeciesBatchRowModel row, int sampleCategoryId) { -// // get the first ancestor for the sample category -// SampleCategory<?> sampleCategory = row.getSampleCategoryById(sampleCategoryId); -// SpeciesBatchRowModel firstAncestor = row.getFirstAncestor(sampleCategory); - Set<Serializable> usedValues = Sets.newHashSet(); List<SpeciesBatchRowModel> childs; if (row.isBatchRoot()) { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-10-03 08:27:10 UTC (rev 1269) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-10-03 09:07:04 UTC (rev 1270) @@ -84,7 +84,7 @@ public final void actionPerformed(final ActionEvent event) { if (log.isInfoEnabled()) { - log.info("Task [" + getLogicAction() + "] starting"); + log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting"); } // prepare action
participants (1)
-
tchemit@users.forge.codelutin.com