fixed a couple of problems with do=getpdf
authorjohn <john>
Mon, 13 Jan 2003 16:08:32 +0000 (16:08 +0000)
committerjohn <john>
Mon, 13 Jan 2003 16:08:32 +0000 (16:08 +0000)
source/mircoders/servlet/ServletModuleOpenIndy.java

index 56a4fdf..08628f9 100755 (executable)
@@ -87,7 +87,7 @@ import mircoders.search.*;
  *    open-postings to the newswire\r
  *\r
  * @author mir-coders group\r
- * @version $Id: ServletModuleOpenIndy.java,v 1.53 2003/01/12 22:25:18 john Exp $\r
+ * @version $Id: ServletModuleOpenIndy.java,v 1.54 2003/01/13 16:08:32 john Exp $\r
  *\r
  */\r
 \r
@@ -839,7 +839,8 @@ public class ServletModuleOpenIndy extends ServletModule
   public void getpdf(HttpServletRequest req, HttpServletResponse res)\r
     throws ServletModuleException, ServletModuleUserException {\r
     String ID_REQUEST_PARAM = "id";\r
-\r
+    String language = req.getParameter("language");\r
+    \r
     String generateFO=MirConfig.getProp("GenerateFO");\r
     String generatePDF=MirConfig.getProp("GeneratePDF");\r
 \r
@@ -854,17 +855,25 @@ public class ServletModuleOpenIndy extends ServletModule
 \r
       String producerStorageRoot=MirConfig.getProp("Producer.StorageRoot");\r
       String producerDocRoot=MirConfig.getProp("Producer.DocRoot");\r
-      String templateDir=MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir");\r
-      String xslSheet=templateDir + "/"\r
-        + MirConfig.getProp("Producer.PrintableContent.html2foStyleSheetName");\r
+      //      String templateDir=MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir");\r
+      String xslSheet=MirConfig.getProp("Producer.HTML2FOStyleSheet");\r
       try {\r
         String idParam = req.getParameter(ID_REQUEST_PARAM);\r
         if (idParam != null) {\r
           EntityContent contentEnt =\r
             (EntityContent)contentModule.getById(idParam);\r
           String publishPath = contentEnt.getValue("publish_path");\r
-          String foFile = producerStorageRoot + producerDocRoot + "/"\r
-            + publishPath + "/" + idParam + ".fo";\r
+          String foFile;\r
+         \r
+         if (language == null){\r
+           foFile = producerStorageRoot + producerDocRoot + "/"\r
+             + publishPath  + idParam + ".fo";\r
+         }\r
+         else{\r
+           foFile = producerStorageRoot + producerDocRoot + "/"\r
+             + language + publishPath  + idParam + ".fo";\r
+         }\r
+         logger.debug("USING FILES" + foFile + " and " + xslSheet);\r
           XSLTInputHandler input = new XSLTInputHandler(new File(foFile),\r
                                                         new File(xslSheet));\r
 \r
@@ -885,6 +894,7 @@ public class ServletModuleOpenIndy extends ServletModule
           throw new ServletModuleUserException("Missing id parameter.");\r
         }\r
       } catch (Exception ex) {\r
+       logger.error(ex.toString());\r
         throw new ServletModuleException(ex.toString());\r
       }\r
     } else {\r