[Suiviobsmer-commits] r713 - in trunk: wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/xmi wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp
Author: bleny Date: 2010-10-27 09:10:56 +0000 (Wed, 27 Oct 2010) New Revision: 713 Log: fix indicator administration ; add mandatory comment field Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java trunk/wao-business/src/main/xmi/wao.zargo trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java trunk/wao-ui/src/main/webapp/Administration.tml Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2010-10-26 17:06:43 UTC (rev 712) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2010-10-27 09:10:56 UTC (rev 713) @@ -851,8 +851,7 @@ // fist, find the indicator Indicator oldIndicator = WaoDAOHelper.getIndicatorDAO(transaction) - .findAllByIndicatorId(indicator.getIndicatorId()) - .iterator().next(); + .findByIndicatorId(indicator.getIndicatorId()); // find what have been changed boolean coefficientChanged = indicator.getCoefficient() @@ -868,15 +867,16 @@ indicator.getSynthesisId().getLabel(), oldIndicator.getCoefficient(), indicator.getCoefficient()); + + oldIndicator.setCoefficient(indicator.getCoefficient()); } // new compare old and new level bounds for (IndicatorLevel level : oldIndicator.getIndicatorLevel()) { IndicatorLevel newLevel = null; - // set oldLevel + // set newLevel for (IndicatorLevel tempLevel : indicator.getIndicatorLevel()) { - log.debug(tempLevel.getLevel() + " ?= " + level.getLevel()); if (tempLevel.getLevel() == level.getLevel()) { newLevel = tempLevel; } @@ -914,10 +914,10 @@ IndicatorLog indicatorLog = new IndicatorLogImpl(); indicatorLog.setAuthor(author); indicatorLog.setComment(comment); + indicatorLog.setLogText(logText.trim()); // add entity logText WaoDAOHelper.getIndicatorLogDAO(transaction).create(indicatorLog); - indicatorLog.setLogText(logText.trim()); // attach the new indicator log to the concerned indicator // Collection indicatorLogs = indicator.getIndicatorLog(); Modified: trunk/wao-business/src/main/xmi/wao.zargo =================================================================== (Binary files differ) Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-10-26 17:06:43 UTC (rev 712) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-10-27 09:10:56 UTC (rev 713) @@ -63,6 +63,7 @@ import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.annotations.SessionState; import org.apache.tapestry5.beaneditor.BeanModel; +import org.apache.tapestry5.beaneditor.Validate; import org.apache.tapestry5.corelib.components.BeanEditForm; import org.apache.tapestry5.corelib.components.Form; import org.apache.tapestry5.corelib.components.Zone; @@ -79,6 +80,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; +import java.util.Iterator; import java.util.List; /** @@ -639,16 +641,24 @@ @InjectComponent private Form synthesisParametersForm; - @Log + /** The comment field value of the form. */ + @Property + @Validate("required") + private String comment; + + void onValidateFromSynthesisParametersForm() { + + // TODO bleny 20101027 check that for each level, upperBound is contained + // between the upperBound of the lower level and the upperBound of + // the higher level + + } + void onSuccessFromSynthesisParametersForm() { - - // FIXME bleny 20101026 replace missing comment by something from a textarea for (Indicator indicator : getIndicators()) { serviceSynthesis.updateGlobalSynthesisParameters(indicator, - currentUser.getUser(), "missing comment"); + currentUser.getUser(), comment); } - - } Modified: trunk/wao-ui/src/main/webapp/Administration.tml =================================================================== --- trunk/wao-ui/src/main/webapp/Administration.tml 2010-10-26 17:06:43 UTC (rev 712) +++ trunk/wao-ui/src/main/webapp/Administration.tml 2010-10-27 09:10:56 UTC (rev 713) @@ -179,16 +179,28 @@ <form t:type="form" t:id="synthesisParametersForm" t:zone="synthesisParametersFormZone"> + <t:errors t:banner="message:errors-banner" /> + <!-- ALL ACTUAL VALUES FOR INDICATORS OF GLOBAL SYNTHESIS --> <t:loop t:source="indicators" t:value="indicator" volatile="true"> <t:indicatorLevels t:indicator="indicator" editable="true" /> </t:loop> - Total coefficients : ${totalCoefficient} + <table class="indicatorLevels"> + <tr> + <th>Total coefficients : </th> + <td>${totalCoefficient}</td> + </tr> + </table> + <div> + <p><label>Commentaire sur la modification* :</label></p> + <p><input t:type="textarea" t:id="comment" cols="50" rows="5" value="comment"/></p> + </div> + <div class="fright"> <input t:type="submit" t:id="saveData" class="ico save" value="Save" title="Enregistrer les modifications" /> - <input t:type="submit" t:id="cancelSave" class="ico undo" value="Undo" title="Annuler les modifications" /> + <input type="reset" class="ico undo" value="Annuler les modificationss" title="Annuler les modifications" /> </div> </form> </t:zone>
participants (1)
-
bleny@users.labs.libre-entreprise.org