Commit 960a56901c5305c92ab6f9c048c01bf02d436b39

Authored by Fernando Ribeiro
1 parent 32949e5664
Exists in master

Corrected latest commit of Validation template

config/Messages_en.properties
... ... @@ -550,6 +550,7 @@ webui.validator.error.message.report_not_found = The requested report was not fo
550 550  
551 551 webui.validator.validation_report.heading = Validation report
552 552 webui.validator.validation_report.translation.dc.type = Document type
  553 +webui.validator.validation_report.translation.dc.format = Format
553 554 webui.validator.validation_report.translation.dc.language = Language
554 555 webui.validator.validation_report.translation.dc.rights = Access type
555 556 webui.validator.validation_report.validation_request.heading = Validation request information
... ...
config/Messages_pt.properties
... ... @@ -550,7 +550,8 @@ webui.validator.error.message.report_not_found = O relat
550 550  
551 551 webui.validator.validation_report.heading = Relatório de validação
552 552 webui.validator.validation_report.translation.dc.type = Tipo de documento
553   -webui.validator.validation_report.translation.dc.language = Linguagem
  553 +webui.validator.validation_report.translation.dc.format = Formato
  554 +webui.validator.validation_report.translation.dc.language = Idioma
554 555 webui.validator.validation_report.translation.dc.rights = Tipo de acesso
555 556 webui.validator.validation_report.validation_request.heading = Informação do pedido de validação
556 557 webui.validator.validation_report.validation_statistics.heading = Estatísticas de validação
... ...
config/templates/validation-report-template.html
... ... @@ -115,6 +115,18 @@
115 115 <script
116 116 src="%1$s/validator2resources/bootstrap/dist/js/bootstrap.min.js"></script>
117 117 <script>
  118 + function AnchorToBadge(badge) {
  119 + $('#'+badge).click();
  120 + $('#'+badge).ScrollTo();
  121 + return false;
  122 + }
  123 +
  124 + $('[id$=_BADGE_ANCHOR]').click(function() {
  125 + var badge = this.id.replace('_ANCHOR','');
  126 + AnchorToBadge(badge);
  127 + return false;
  128 + });
  129 +
118 130 var badges = $('a[id$=_BADGE]');
119 131 $.each(badges, function(index, value) {
120 132 var badge = $('a#'+value.id);
... ...
src/pt/keep/metarepository/core/validator2/application/ValidationResults.java
... ... @@ -27,17 +27,17 @@ import pt.keep.metarepository.core.validator2.registration.ValidationRequestInfo
27 27  
28 28 /**
29 29 * Class which holds information about all validated records. This includes:
30   - *
  30 + *
31 31 * <pre>
32 32 * a list of all documents validated (by handle);
33   - * a list of {@link ValidationResult}: one per document;
34   - * documents validation related statistics (# of records with warnings, problems, etc);
  33 + * a list of {@link ValidationResult}: one per document;
  34 + * documents validation related statistics (# of records with warnings, problems, etc);
35 35 * documents metadata related statistics.
36 36 * etc...
37 37 * </pre>
38   - *
  38 + *
39 39 * @author Hélder Silva <hsilva@keep.pt>
40   - *
  40 + *
41 41 * */
42 42 public class ValidationResults {
43 43 private Logger logger = Logger.getLogger(getClass());
... ... @@ -158,7 +158,7 @@ public class ValidationResults {
158 158 /**
159 159 * Method that adds a single {@link ValidationResult} and collects all
160 160 * statistics about it(problems, metadata, etc)
161   - *
  161 + *
162 162 * @param record
163 163 * record validated (if it wasn't already)
164 164 * @param handle
... ... @@ -322,7 +322,7 @@ public class ValidationResults {
322 322 /**
323 323 * Method that produces a validation report in HTML for a specific
324 324 * {@link ValidationRequestInfo} in the specified file location
325   - *
  325 + *
326 326 * @param validationRequest
327 327 * validation request information
328 328 * @param validationReportFile
... ... @@ -487,22 +487,24 @@ public class ValidationResults {
487 487 formatPercentage(getPercentage(numberOfRecordsWithProblems,
488 488 numberOfRecords)) + "%","");
489 489 // number of records with warnings
  490 + String anchorTag = numberOfRecordsWithWarnings > 0 ? "_WARNING_BADGE":"";
490 491 appendTableRowHtml(
491 492 sb,
492 493 "validation_statistics.number_of_records_with_warnings",
493 494 lang,
494 495 numberOfRecordsWithWarnings + "",
495 496 formatPercentage(getPercentage(numberOfRecordsWithWarnings,
496   - numberOfRecords)) + "%","#results");
  497 + numberOfRecords)) + "%",anchorTag);
497 498  
498 499 // number of records with errors
  500 + anchorTag = numberOfRecordsWithErrors >0 ? "_ERROR_BADGE":"";
499 501 appendTableRowHtml(
500 502 sb,
501 503 "validation_statistics.number_of_records_with_errors",
502 504 lang,
503 505 numberOfRecordsWithErrors + "",
504 506 formatPercentage(getPercentage(numberOfRecordsWithErrors,
505   - numberOfRecords)) + "%","#results");
  507 + numberOfRecords)) + "%",anchorTag);
506 508  
507 509 sb.append("</table></div><div class=\"clearfix\">&nbsp;</div>");
508 510 }
... ... @@ -513,7 +515,7 @@ public class ValidationResults {
513 515 sb.append("<tr>");
514 516 sb.append("<td class=\"text-label\">");
515 517 if(isAnchored)
516   - sb.append("<a href=\"#results\">");
  518 + sb.append("<a href=\"#"+anchorTag+"\" id=\""+anchorTag+"_ANCHOR\">");
517 519 sb.append("<strong>"+ LocalizationManager.getMessage(
518 520 "webui.validator.validation_report." + i18n, lang)
519 521 + "</strong>");
... ...