diff options
author | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-03-12 09:58:22 +0100 |
---|---|---|
committer | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-03-12 10:03:55 +0100 |
commit | eb993b9da5938138373a3ad4a619bf2e290c6cfc (patch) | |
tree | 8b06796e715f4d61d81148ff31b13d01e1564416 /id | |
parent | 3075521544ff79c5fa0d740c6b388bfeab58b8c5 (diff) | |
download | moa-id-spss-eb993b9da5938138373a3ad4a619bf2e290c6cfc.tar.gz moa-id-spss-eb993b9da5938138373a3ad4a619bf2e290c6cfc.tar.bz2 moa-id-spss-eb993b9da5938138373a3ad4a619bf2e290c6cfc.zip |
render consent html page
Diffstat (limited to 'id')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java index 8b7bcf0c6..5b5c00b2a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java @@ -90,6 +90,29 @@ public class ConsentEvaluator implements IAction { } // ask for consent + try { + VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); + Template template = velocityEngine.getTemplate("/resources/templates/stork2_consent.html"); + VelocityContext context = new VelocityContext(); + + context.put("action", AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/CompleteAuthentication?" + ARTIFACT_ID + "=" + newArtifactId); + + // assemble table + String table = ""; + for (PersonalAttribute current : container.getResponse().getPersonalAttributeList()) + if ("Available".equals(current.getStatus())) + table += "<tr><td><input type=\"checkbox\" checked=\"yes\" name=\"" + current.getName() + "\"></td><td>" + current.getName() + "</td></tr>\n"; + + context.put("tablecontent", table); + + StringWriter writer = new StringWriter(); + template.merge(context, writer); + response.getOutputStream().write(writer.getBuffer().toString().getBytes()); + + } catch (Exception e) { + Logger.error("Velocity error: " + e.getMessage()); + throw new MOAIDException("stork.17", null); + } return "12345"; // AssertionId } |