aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-01-23 11:13:50 +0000
committerrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-01-23 11:13:50 +0000
commit60f82132f019531586d4129f6eb374af08c04858 (patch)
tree52b96b1c832de3ff545ab2a7da06fe3e2130f734
parent155e16ee3b6d4726434f15bb69443bc028a364e1 (diff)
downloadpdf-as-3-60f82132f019531586d4129f6eb374af08c04858.tar.gz
pdf-as-3-60f82132f019531586d4129f6eb374af08c04858.tar.bz2
pdf-as-3-60f82132f019531586d4129f6eb374af08c04858.zip
Added passing form field checkbox for choosing mobile test app on test-pdf-as (test app)
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@902 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
index a051396..1c594dd 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java
@@ -338,13 +338,13 @@ public class SignServlet extends HttpServlet
try
{
HttpSession session = request.getSession(true);
-// not needed, that is done in sign()
-// ud.pdfDataSource = PdfAS.applyStrictMode(ud.pdfDataSource);
+ // not needed, that is done in sign()
+ // ud.pdfDataSource = PdfAS.applyStrictMode(ud.pdfDataSource);
SignSessionInformation si = new SignSessionInformation(); // SessionTable.generateSessionInformationObject();
si.connector = ud.sig_app;
- if ((request.getContextPath().startsWith("/test-")) && (si.connector.equals("mobile"))) {
+ if ((ud.mobileTestEnabled) && (si.connector.equals("mobile"))) {
si.connector = Constants.SIGNATURE_DEVICE_MOBILETEST;
session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY, si.connector);
}
@@ -451,7 +451,7 @@ public class SignServlet extends HttpServlet
String mode="";
String doc_file_name;
DataSource pdfDataSource;
-
+ boolean mobileTestEnabled=false;
Iterator it = items.iterator();
session = request.getSession(true);
@@ -531,7 +531,7 @@ public class SignServlet extends HttpServlet
if (item.isFormField())
{
String item_string = item.getString("UTF-8"); //$NON-NLS-1$
- log.debug(" form field string = " + item_string); //$NON-NLS-1$
+ log.debug(" form field string = " + item_string); //$NON-NLS-1$
}
else
{
@@ -645,6 +645,15 @@ public class SignServlet extends HttpServlet
}
//end added
+ if (FormFields.FIELD_MOBILETEST_ENABLED.equals(item.getFieldName())) {
+ if (item.getString("UTF-8")!=null) {
+ if (item.getString("UTF-8").equals("on")) {
+ mobileTestEnabled=true;
+ }
+ }
+ continue;
+ }
+
throw new ServletException("Unrecognized POST data."); //$NON-NLS-1$
}
@@ -738,6 +747,11 @@ public class SignServlet extends HttpServlet
ud.sig_type += "_NOTE";
session.setAttribute(SUBMITFORM_SIGNATURE_TYPE_KEY, ud.sig_type);
}
+
+ if (mobileTestEnabled) {
+ ud.mobileTestEnabled=true;
+ }
+
//end added
return ud;
@@ -868,6 +882,8 @@ public class SignServlet extends HttpServlet
protected DataSource pdfDataSource = null;
+ protected boolean mobileTestEnabled = false;
+
//added by rpiazzi
protected boolean note = false;
// protected byte[] pdf = null;