From: john Date: Mon, 13 Jan 2003 16:08:32 +0000 (+0000) Subject: fixed a couple of problems with do=getpdf X-Git-Tag: BEFORE_MERGE_1_1~326 X-Git-Url: http://erislabs.net/gitweb/?p=mir.git;a=commitdiff_plain;h=82e90ffa67d9c71cf4f0b3d0f69161ba90d999c5 fixed a couple of problems with do=getpdf --- diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index 56a4fdfd..08628f97 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -87,7 +87,7 @@ import mircoders.search.*; * open-postings to the newswire * * @author mir-coders group - * @version $Id: ServletModuleOpenIndy.java,v 1.53 2003/01/12 22:25:18 john Exp $ + * @version $Id: ServletModuleOpenIndy.java,v 1.54 2003/01/13 16:08:32 john Exp $ * */ @@ -839,7 +839,8 @@ public class ServletModuleOpenIndy extends ServletModule public void getpdf(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException, ServletModuleUserException { String ID_REQUEST_PARAM = "id"; - + String language = req.getParameter("language"); + String generateFO=MirConfig.getProp("GenerateFO"); String generatePDF=MirConfig.getProp("GeneratePDF"); @@ -854,17 +855,25 @@ public class ServletModuleOpenIndy extends ServletModule String producerStorageRoot=MirConfig.getProp("Producer.StorageRoot"); String producerDocRoot=MirConfig.getProp("Producer.DocRoot"); - String templateDir=MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir"); - String xslSheet=templateDir + "/" - + MirConfig.getProp("Producer.PrintableContent.html2foStyleSheetName"); + // String templateDir=MirConfig.getPropWithHome("HTMLTemplateProcessor.Dir"); + String xslSheet=MirConfig.getProp("Producer.HTML2FOStyleSheet"); try { String idParam = req.getParameter(ID_REQUEST_PARAM); if (idParam != null) { EntityContent contentEnt = (EntityContent)contentModule.getById(idParam); String publishPath = contentEnt.getValue("publish_path"); - String foFile = producerStorageRoot + producerDocRoot + "/" - + publishPath + "/" + idParam + ".fo"; + String foFile; + + if (language == null){ + foFile = producerStorageRoot + producerDocRoot + "/" + + publishPath + idParam + ".fo"; + } + else{ + foFile = producerStorageRoot + producerDocRoot + "/" + + language + publishPath + idParam + ".fo"; + } + logger.debug("USING FILES" + foFile + " and " + xslSheet); XSLTInputHandler input = new XSLTInputHandler(new File(foFile), new File(xslSheet)); @@ -885,6 +894,7 @@ public class ServletModuleOpenIndy extends ServletModule throw new ServletModuleUserException("Missing id parameter."); } } catch (Exception ex) { + logger.error(ex.toString()); throw new ServletModuleException(ex.toString()); } } else {