From 440e74f9de28d2df476e1b98f952e98a80c6d7e4 Mon Sep 17 00:00:00 2001
From: tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>
Date: Thu, 20 Mar 2008 11:41:03 +0000
Subject: System property "pdf-as.work-dir" for definition of the work
 directory introduced. Should be used instead of context/web.xml parameter.
 Additionally the profile configuration has been updated including the images.

git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@254 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
---
 .../wag/egov/egiz/web/PdfASServletContextListener.java      | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'src/main')

diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java
index 0e0c625..adb31be 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/PdfASServletContextListener.java
@@ -52,8 +52,16 @@ public class PdfASServletContextListener implements ServletContextListener
   {
     logger.info("PDF-AS Context init"); //$NON-NLS-1$
     
-    String work_dir = sce.getServletContext().getInitParameter("work-dir"); //$NON-NLS-1$
-    logger.info("PDF-AS work-dir context parameter = " + work_dir); //$NON-NLS-1$
+    String sysPropWorkdir = System.getProperty("pdf-as.work-dir");
+    String work_dir;
+    if (sysPropWorkdir != null && sysPropWorkdir.length() > 0) {
+       work_dir = sysPropWorkdir;
+       logger.info("Work-dir configuration via system property.");
+       logger.info("PDF-AS work-dir via system property = " + work_dir); //$NON-NLS-1$
+    } else {
+       work_dir = sce.getServletContext().getInitParameter("work-dir"); //$NON-NLS-1$
+       logger.info("PDF-AS work-dir context parameter = " + work_dir); //$NON-NLS-1$
+    }
     
     String base_dir = sce.getServletContext().getRealPath("/"); //$NON-NLS-1$
     logger.info("PDF-AS real path = " + base_dir); //$NON-NLS-1$
@@ -70,7 +78,6 @@ public class PdfASServletContextListener implements ServletContextListener
     
     if (work_dir != null && work_dir.length() > 0)
     {
-      logger.info("The PDF-AS work-dir context parameter is present (and not empty).");
       base_dir = work_dir;
     }
     logger.info("The PDF-AS application will be initialized for the directory: " + base_dir);
-- 
cgit v1.2.3