Skip to content

Commit

Permalink
RESMER-261: When printing s2s forms and validation errors exist those…
Browse files Browse the repository at this point in the history
… validation errors are never displayed to the end user. Instead s2s pdf generation will be unable to create a pdf due to incomplete xml being input into the print process.
  • Loading branch information
leoherbie committed Dec 8, 2015
1 parent 850b521 commit 82b9eab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ protected FormGenerationResult generateAndValidateForms(Forms forms,
if(info==null) continue;
String namespace = info.getNameSpace();
S2SFormGenerator s2sFormGenerator = s2SFormGeneratorService.getS2SGenerator(developmentProposal.getProposalNumber(),namespace);
auditErrors.addAll(s2sFormGenerator.getAuditErrors());
try {
XmlObject formObject = s2sFormGenerator.getFormObject(pdDoc);
auditErrors.addAll(s2sFormGenerator.getAuditErrors());
if (s2SValidatorService.validate(formObject, auditErrors, info.getFormName())) {
if (forms != null && attList != null) {
setFormObject(forms, formObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,8 @@ protected PrintableResult getPDFStream(ProposalDevelopmentDocumentContract pdDoc
FormMappingInfo info = formMappingService.getFormInfo(namespace,proposalNumber);
if(info==null) continue;
S2SFormGenerator s2sFormGenerator = s2SFormGeneratorService.getS2SGenerator(proposalNumber,info.getNameSpace());
errors.addAll(s2sFormGenerator.getAuditErrors());
XmlObject formObject = s2sFormGenerator.getFormObject(pdDoc);

errors.addAll(s2sFormGenerator.getAuditErrors());
if (s2SValidatorService.validate(formObject, errors, info.getFormName()) && errors.isEmpty() && StringUtils.isNotBlank(info.getStyleSheet())) {
String applicationXml = formObject.xmlText(s2SFormGeneratorService.getXmlOptionsPrefixes());
String filteredApplicationXml = s2SDateTimeService.removeTimezoneFactor(applicationXml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected boolean isPdfGoodToMerge(byte[] pdfBytes) {
return true;
}
catch (IOException e) {
return false;
throw new S2SException(e);
}
}

Expand Down

0 comments on commit 82b9eab

Please sign in to comment.