r2049 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service wao-web/src/main/resources/i18n wao-web/src/main/webapp/WEB-INF/content/obsmer
Author: bleny Date: 2014-06-17 15:01:12 +0200 (Tue, 17 Jun 2014) New Revision: 2049 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2049 Log: fixes #5248 deal with empty synthesis Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSynthesis.java trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/synthesis.jsp Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSynthesis.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSynthesis.java 2014-06-17 12:45:06 UTC (rev 2048) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSynthesis.java 2014-06-17 13:01:12 UTC (rev 2049) @@ -127,4 +127,7 @@ return new LinkedHashSet<>(companySynthesesOrderedByName.values()); } + public boolean isEmpty() { + return companySyntheses.isEmpty(); + } } Modified: trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-06-17 12:45:06 UTC (rev 2048) +++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-06-17 13:01:12 UTC (rev 2049) @@ -520,6 +520,7 @@ wao.ui.synthesis.distinctBoatsCounts.categoryName=Month of the year wao.ui.synthesis.distinctBoatsCounts.description=For each month, the number of distinct boats observed during this month wao.ui.synthesis.distinctBoatsCounts.title=Numbers of boats observed depending on the year +wao.ui.synthesis.empty=No synthesis data wao.ui.synthesis.globalSynthesis.globalResult=Result of the global synthesis wao.ui.synthesis.globalSynthesis.title=Global synthesis wao.ui.synthesis.globalSynthesis.title.estimated=Global synthesis (according to estimations) Modified: trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-06-17 12:45:06 UTC (rev 2048) +++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-06-17 13:01:12 UTC (rev 2049) @@ -520,6 +520,7 @@ wao.ui.synthesis.distinctBoatsCounts.categoryName=Mois de l'année wao.ui.synthesis.distinctBoatsCounts.description=Nombre de navires distincts observés selon le mois de l'année wao.ui.synthesis.distinctBoatsCounts.title=Nombre de navires observés +wao.ui.synthesis.empty=Aucune données à afficher wao.ui.synthesis.globalSynthesis.globalResult=Bilan de la synthèse global wao.ui.synthesis.globalSynthesis.title=Synthèse globale wao.ui.synthesis.globalSynthesis.title.estimated=Synthèse globale (selon estimations) Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/synthesis.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/synthesis.jsp 2014-06-17 12:45:06 UTC (rev 2048) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/synthesis.jsp 2014-06-17 13:01:12 UTC (rev 2049) @@ -164,189 +164,196 @@ </s:form> - <article> - <h2> - <s:text name="SynthesisId.GRAPH_SAMPLING"/> - </h2> + <s:if test="synthesis.empty"> + <s:text name="wao.ui.synthesis.empty"/> + </s:if> + <s:else> - <s:property value="synthesis.expectedVsActualObservationsByMonthsChart" escapeHtml="false"/> - </article> + <article> + <h2> + <s:text name="SynthesisId.GRAPH_SAMPLING"/> + </h2> - <article> - <h2> - <s:text name="SynthesisId.GRAPH_BOARDING"/> - </h2> + <s:property value="synthesis.expectedVsActualObservationsByMonthsChart" escapeHtml="false"/> + </article> - <s:property value="synthesis.boardingBoatsChart" escapeHtml="false"/> + <article> + <h2> + <s:text name="SynthesisId.GRAPH_BOARDING"/> + </h2> - <p> - <s:text name="wao.ui.synthesis.boarding.description"/> - </p> + <s:property value="synthesis.boardingBoatsChart" escapeHtml="false"/> - <p> - <s:text name="wao.ui.synthesis.boarding.mostUsedBoat"> - <s:param value="%{synthesis.maxBoardingValue}"/> - <s:param value="%{synthesis.maxBoardingBoat.name}"/> - <s:param value="%{synthesis.maxBoardingBoat.immatriculation}"/> - </s:text> - </p> + <p> + <s:text name="wao.ui.synthesis.boarding.description"/> + </p> - <p> - <s:text name="wao.ui.synthesis.boarding.boardingCount"> - <s:param value="%{synthesis.invalidBoardingsCount}"/> - <s:param value="%{synthesis.boardingsCount}"/> - <%-- - <s:param value="%{synthesis.validBoardingsCount}"/> - --%> - </s:text> - </p> + <p> + <s:text name="wao.ui.synthesis.boarding.mostUsedBoat"> + <s:param value="%{synthesis.maxBoardingValue}"/> + <s:param value="%{synthesis.maxBoardingBoat.name}"/> + <s:param value="%{synthesis.maxBoardingBoat.immatriculation}"/> + </s:text> + </p> - </article> + <p> + <s:text name="wao.ui.synthesis.boarding.boardingCount"> + <s:param value="%{synthesis.invalidBoardingsCount}"/> + <s:param value="%{synthesis.boardingsCount}"/> + <%-- + <s:param value="%{synthesis.validBoardingsCount}"/> + --%> + </s:text> + </p> - <article> - <h2> - <s:text name="SynthesisId.IND_COMPLIANCE_BOARDING"/> - </h2> + </article> - <table class="table"> - <thead> - <tr> - <th> - <s:text name="wao.ui.entity.Company"/> - </th> - <th> - <s:text name="wao.ui.synthesis.complianceBoarding.description"/> - </th> - </tr> - </thead> - <tbody> - <s:iterator value="synthesis.companySynthesesOrderedByName"> + <article> + <h2> + <s:text name="SynthesisId.IND_COMPLIANCE_BOARDING"/> + </h2> + + <table class="table"> + <thead> <tr> - <td> - <s:property value="companyName"/> - </td> - <td> - <s:property value="complianceBoardingIndicator * 100"/> % - </td> + <th> + <s:text name="wao.ui.entity.Company"/> + </th> + <th> + <s:text name="wao.ui.synthesis.complianceBoarding.description"/> + </th> </tr> - </s:iterator> - </tbody> - </table> + </thead> + <tbody> + <s:iterator value="synthesis.companySynthesesOrderedByName"> + <tr> + <td> + <s:property value="companyName"/> + </td> + <td> + <s:property value="complianceBoardingIndicator * 100"/> % + </td> + </tr> + </s:iterator> + </tbody> + </table> - </article> + </article> - <article> - <h2> - <s:text name="SynthesisId.IND_CONTACT_STATE"/> - </h2> + <article> + <h2> + <s:text name="SynthesisId.IND_CONTACT_STATE"/> + </h2> - <table class="table"> - <thead> - <tr> - <th> - <s:text name="wao.ui.entity.Company"/> - </th> - <s:iterator value="synthesis.companySynthesesOrderedByName.iterator.next().contactsStatesStatistics.keySet()" var="contactState"> + <table class="table"> + <thead> + <tr> <th> - <s:text name="%{#contactState.i18nKey}"/> + <s:text name="wao.ui.entity.Company"/> </th> - </s:iterator> - <th> - <s:text name="wao.ui.misc.total"/> - </th> - </tr> - </thead> - <tbody> - <s:iterator value="synthesis.companySynthesesOrderedByName"> - <tr> - <td> - <s:property value="companyName"/> - </td> - <s:iterator value="contactsStatesStatistics"> + <s:iterator value="synthesis.companySynthesesOrderedByName.iterator.next().contactsStatesStatistics.keySet()" var="contactState"> + <th> + <s:text name="%{#contactState.i18nKey}"/> + </th> + </s:iterator> + <th> + <s:text name="wao.ui.misc.total"/> + </th> + </tr> + </thead> + <tbody> + <s:iterator value="synthesis.companySynthesesOrderedByName"> + <tr> <td> - <s:property value="value"/> - <s:set name="percentage" value="%{value.doubleValue() / contactsCount * 100}" /> - (<s:property value="#percentage"/> %) + <s:property value="companyName"/> </td> - </s:iterator> - <td> - <s:property value="contactsCount"/> - </td> - </tr> - </s:iterator> - </tbody> - </table> + <s:iterator value="contactsStatesStatistics"> + <td> + <s:property value="value"/> + <s:set name="percentage" value="%{value.doubleValue() / contactsCount * 100}" /> + (<s:property value="#percentage"/> %) + </td> + </s:iterator> + <td> + <s:property value="contactsCount"/> + </td> + </tr> + </s:iterator> + </tbody> + </table> - </article> + </article> - <article> - <h2> - <s:text name="SynthesisId.IND_ALLEGRO_REACTIVITY"/> - </h2> + <article> + <h2> + <s:text name="SynthesisId.IND_ALLEGRO_REACTIVITY"/> + </h2> - <table class="table"> - <thead> - <tr> - <th> - <s:text name="wao.ui.entity.Company"/> - </th> - <th> - <s:text name="wao.ui.synthesis.allegroReactivity.title"/> - </th> - </tr> - </thead> - <tbody> - <s:iterator value="synthesis.companySynthesesOrderedByName"> + <table class="table"> + <thead> <tr> - <td> - <s:property value="companyName"/> - </td> - <td<s:if test="dataInputDateReactivityHigh"> class="lower-than-expected"</s:if>> - <s:property value="dataInputDateReactivity"/> - </td> + <th> + <s:text name="wao.ui.entity.Company"/> + </th> + <th> + <s:text name="wao.ui.synthesis.allegroReactivity.title"/> + </th> </tr> - </s:iterator> - </tbody> - </table> + </thead> + <tbody> + <s:iterator value="synthesis.companySynthesesOrderedByName"> + <tr> + <td> + <s:property value="companyName"/> + </td> + <td<s:if test="dataInputDateReactivityHigh"> class="lower-than-expected"</s:if>> + <s:property value="dataInputDateReactivity"/> + </td> + </tr> + </s:iterator> + </tbody> + </table> - <p> - <s:text name="wao.ui.synthesis.allegroReactivity.description"/> - </p> + <p> + <s:text name="wao.ui.synthesis.allegroReactivity.description"/> + </p> - </article> + </article> - <article> + <article> - <h2> - <s:text name="SynthesisId.IND_DATA_RELIABILITY"/> - </h2> + <h2> + <s:text name="SynthesisId.IND_DATA_RELIABILITY"/> + </h2> - <table class="table"> - <thead> - <tr> - <th> - <s:text name="wao.ui.entity.Company"/> - </th> - <th> - <s:text name="wao.ui.synthesis.dataReliability.description"/> - </th> - </tr> - </thead> - <tbody> - <s:iterator value="synthesis.companySynthesesOrderedByName"> + <table class="table"> + <thead> <tr> - <td> - <s:property value="companyName"/> - </td> - <td> - <s:property value="dataReliabilityRatio * 100"/> % - </td> + <th> + <s:text name="wao.ui.entity.Company"/> + </th> + <th> + <s:text name="wao.ui.synthesis.dataReliability.description"/> + </th> </tr> - </s:iterator> - </tbody> - </table> + </thead> + <tbody> + <s:iterator value="synthesis.companySynthesesOrderedByName"> + <tr> + <td> + <s:property value="companyName"/> + </td> + <td> + <s:property value="dataReliabilityRatio * 100"/> % + </td> + </tr> + </s:iterator> + </tbody> + </table> - </article> + </article> + </s:else> + </html>
participants (1)
-
bleny@users.forge.codelutin.com