From f3c42b0079b7fe9a671d84bdb363b9f0fddcb804 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 15 Apr 2021 17:45:47 +0200 Subject: untested JSON interface --- .../at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'pdf-as-web/src/main/java/at') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java index 4925ec65..6a56c9dc 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java @@ -15,6 +15,7 @@ import at.gv.egiz.pdfas.web.stats.StatisticEvent; import at.gv.egiz.pdfas.web.stats.StatisticFrontend; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; +import org.json.JSONArray; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,6 +25,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -43,7 +45,7 @@ public class JSONAPIServlet extends HttpServlet { private static final String JSON_DATAURL = "dataUrl"; private static final String JSON_BKUURL = "bkuUrl"; private static final String JSON_SLREQUEST = "slRequest"; - + private static final String JSON_SBP = "sbp"; private static final Logger logger = LoggerFactory.getLogger(JSONAPIServlet.class); @Override @@ -133,15 +135,23 @@ public class JSONAPIServlet extends HttpServlet { parameters.setPosition(position); parameters.setProfile(profile); - //TODO alex fill here - Map dynamicSignatureBlockArguments = null; + Map signatureBlockParametersMap = new HashMap<>(); + JSONArray jsonArray = jsonObject.getJSONArray(JSON_SBP); + for(int i=0; i