diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ValidationReportsPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ValidationReportsPageController.java index bdafe79d..c1548f77 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ValidationReportsPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ValidationReportsPageController.java @@ -29,8 +29,9 @@ import hirs.data.persist.SupplyChainValidationSummary; import hirs.persist.CriteriaModifier; import hirs.persist.CrudManager; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; +import java.util.Enumeration; import java.util.UUID; /** @@ -109,10 +110,17 @@ public class ValidationReportsPageController extends PageController(records, input); } - @RequestMapping(value = "download", method = RequestMethod.GET) + @RequestMapping(value = "download", method = RequestMethod.POST) public void download(@RequestParam final String id, + final HttpServletRequest request, final HttpServletResponse response) { + LOGGER.info("Downloading validation report for " + id); + Enumeration parameters = request.getParameterNames(); + while (parameters.hasMoreElements()) { + String parameter = (String) parameters.nextElement(); + LOGGER.info(parameter + ": " + request.getParameter(parameter)); + } UUID uuid = UUID.fromString(id); PlatformCredential pc = PlatformCredential.select(certificateManager).byDeviceId(uuid).getCertificate(); LOGGER.info("Verified manufacturer: " + pc.getManufacturer()); @@ -122,8 +130,10 @@ public class ValidationReportsPageController extends PageController 0) { for (ComponentIdentifier ci : pc.getComponentIdentifiers()) { - LOGGER.info("Manufacturer ID: " + ci.getComponentManufacturerId().toString() + - "\nModel: " + ci.getComponentModel().getString() + + if (ci.getComponentManufacturerId() != null) { + LOGGER.info("Manufacturer ID: " + ci.getComponentManufacturerId().toString()); + } + LOGGER.info("\nModel: " + ci.getComponentModel().getString() + "\nRevision: " + ci.getComponentRevision().getString()); } } diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/validation-reports.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/validation-reports.jsp index ce09ed94..85ffeda2 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/validation-reports.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/validation-reports.jsp @@ -133,10 +133,35 @@ * This method builds a url to download the device validation report. */ function createDownloadLink(full) { - return full.device.name + ' ' + - '' + - ''; + var device = full.device; + var html = '
' + + device.name + + '' + + '' + + '' + + '' + + '
'; + return html; } /** diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/tags/download-info.tag b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/tags/download-info.tag new file mode 100644 index 00000000..f14e33e0 --- /dev/null +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/tags/download-info.tag @@ -0,0 +1,14 @@ +<%@tag description="download icon that opens modal dialog with form" pageEncoding="UTF-8"%> + +<%@attribute name="id"%> +<%@attribute name="label"%> +<%@attribute name="customButtons" fragment="true" required="false"%> + +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + + + + + + + \ No newline at end of file