From 171d4f61126744642c6e108cc158d4278d8fa0a1 Mon Sep 17 00:00:00 2001 From: knowcenter Date: Wed, 16 May 2007 20:00:55 +0000 Subject: minor changes git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@84 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/web/LocalRequestHelper.java | 1 + .../egov/egiz/web/PdfASServletContextListener.java | 24 ++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java index cac8eb3..2008fdc 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java @@ -65,6 +65,7 @@ public abstract class LocalRequestHelper HttpServletRequest request, HttpServletResponse response) throws IOException, PresentableException { LocalConnector local_conn = (LocalConnector) ConnectorFactory.createConnector(si.connector); + // FIXME refactor WEB String document_text = "fixme"; //si.iui.document_text; 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 fab3e04..4412c21 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 @@ -47,19 +47,31 @@ public class PdfASServletContextListener implements ServletContextListener /** * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) */ - public void contextInitialized(ServletContextEvent arg0) + public void contextInitialized(ServletContextEvent sce) { - logger.info("PDF-AS Context init"); - String base_dir = arg0.getServletContext().getRealPath("/"); + 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 base_dir = sce.getServletContext().getRealPath("/"); //$NON-NLS-1$ + logger.info("PDF-AS real path = " + base_dir); //$NON-NLS-1$ + try { - logger.info("PDF-AS base directory = " + new File(base_dir).getCanonicalPath()); + logger.info("PDF-AS work directory = " + new File(work_dir).getCanonicalPath()); //$NON-NLS-1$ + logger.info("PDF-AS base directory = " + new File(base_dir).getCanonicalPath()); //$NON-NLS-1$ } catch (IOException e) { e.printStackTrace(); } + if (work_dir != null) + { + base_dir = work_dir; + } + SettingsReader.initializeForWeb(base_dir); SettingsReader.clearTemporaryDirectory(); @@ -68,9 +80,9 @@ public class PdfASServletContextListener implements ServletContextListener /** * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ - public void contextDestroyed(ServletContextEvent arg0) + public void contextDestroyed(ServletContextEvent sce) { SettingsReader.clearTemporaryDirectory(); - logger.info("PDF-AS Context exit"); + logger.info("PDF-AS Context exit"); //$NON-NLS-1$ } } -- cgit v1.2.3