aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-07-15 18:51:28 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-07-15 18:51:28 +0200
commit2911310d53628b69c6dadbedc1d0abf33efb4cc2 (patch)
treef7760452e425a2cac65360dac631b9136434dbb5
parent8b69a68f80ce64da4bc68f9d03a17113d48a0599 (diff)
downloadpdf-as-4-2911310d53628b69c6dadbedc1d0abf33efb4cc2.tar.gz
pdf-as-4-2911310d53628b69c6dadbedc1d0abf33efb4cc2.tar.bz2
pdf-as-4-2911310d53628b69c6dadbedc1d0abf33efb4cc2.zip
Web Helper and Config
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java27
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java12
-rw-r--r--pdf-as-web/src/main/webapp/WEB-INF/sun-jaxws.xml4
-rw-r--r--pdf-as-web/src/main/webapp/verifystart.jsp5
4 files changed, 44 insertions, 4 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
index 288b62c4..3a64c422 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
@@ -44,6 +44,9 @@ public class WebConfiguration {
public static final String MOA_SS_ENABLED = "moa.enabled";
public static final String SOAP_SIGN_ENABLED = "soap.sign.enabled";
+ public static final String SOAP_VERIFY_ENABLED = "soap.verify.enabled";
+ public static final String RELOAD_PASSWORD = "reload.pwd";
+ public static final String RELOAD_ENABLED = "reload.enabled";
public static final String KEYSTORE_ENABLED = "ks.enabled";
public static final String KEYSTORE_FILE = "ks.file";
@@ -212,6 +215,16 @@ public class WebConfiguration {
}
return false;
}
+
+ public static boolean getSoapVerifyEnabled() {
+ String value = properties.getProperty(SOAP_VERIFY_ENABLED);
+ if (value != null) {
+ if (value.equals("true")) {
+ return true;
+ }
+ }
+ return false;
+ }
public static boolean isShowErrorDetails() {
String value = properties.getProperty(ERROR_DETAILS);
@@ -279,4 +292,18 @@ public class WebConfiguration {
return REQUEST_STORE_INMEM;
}
+
+ public static String getReloadPassword() {
+ return properties.getProperty(RELOAD_PASSWORD);
+ }
+
+ public static boolean getReloadEnabled() {
+ String value = properties.getProperty(RELOAD_ENABLED);
+ if (value != null) {
+ if (value.equals("true")) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
index ce51515e..a5232acf 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
@@ -120,16 +120,20 @@ public class PdfAsHelper {
private static ObjectFactory of = new ObjectFactory();
static {
- logger.info("Creating PDF-AS");
- pdfAs = PdfAsFactory.createPdfAs(new File(WebConfiguration
- .getPdfASDir()));
- logger.info("Creating PDF-AS done");
+ reloadConfig();
}
public static void init() {
logger.info("PDF-AS Helper initialized");
}
+ public static synchronized void reloadConfig() {
+ logger.info("Creating PDF-AS");
+ pdfAs = PdfAsFactory.createPdfAs(new File(WebConfiguration
+ .getPdfASDir()));
+ logger.info("Creating PDF-AS done");
+ }
+
private static void validatePdfSize(HttpServletRequest request,
HttpServletResponse response, byte[] pdfData)
throws PdfAsWebException {
diff --git a/pdf-as-web/src/main/webapp/WEB-INF/sun-jaxws.xml b/pdf-as-web/src/main/webapp/WEB-INF/sun-jaxws.xml
index 67648647..f62b8484 100644
--- a/pdf-as-web/src/main/webapp/WEB-INF/sun-jaxws.xml
+++ b/pdf-as-web/src/main/webapp/WEB-INF/sun-jaxws.xml
@@ -4,4 +4,8 @@
<endpoint name="SOAP Sign"
implementation="at.gv.egiz.pdfas.web.ws.PDFASSigningImpl"
url-pattern="/wssign"/>
+
+ <endpoint name="SOAP Verify"
+ implementation="at.gv.egiz.pdfas.web.ws.PDFASVerificationImpl"
+ url-pattern="/wsverify"/>
</endpoints> \ No newline at end of file
diff --git a/pdf-as-web/src/main/webapp/verifystart.jsp b/pdf-as-web/src/main/webapp/verifystart.jsp
index 86795d23..339cb464 100644
--- a/pdf-as-web/src/main/webapp/verifystart.jsp
+++ b/pdf-as-web/src/main/webapp/verifystart.jsp
@@ -5,6 +5,11 @@
<h1>Verify PDF-Dokument</h1>
<form action="Verify" method="POST" enctype="multipart/form-data">
+ <select name="format">
+ <option selected="selected">html</option>
+ <option>json</option>
+ </select>
+
<input type="file" name="pdf-file" />
<input type="submit" value="Verfiy">