details: https://code.openbravo.com/erp/devel/pi/rev/4d04e9933ae6 changeset: 28268:4d04e9933ae6 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Jan 19 17:46:10 2016 +0100 summary: fixes issue 31944: Labels linked to a concrete file are not translated
The translation engine requires the base design path to retrieve the ad_textinterfaces linked to a particular report. This path was not being sent properly in ReportinUtils class. Now the path is generated correctly making use of a new method called getBaseDesignPath. diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java | 17 +++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diffs (47 lines): diff -r d4762042e1ad -r 4d04e9933ae6 modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java Mon Jan 18 16:22:34 2016 +0530 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java Tue Jan 19 17:46:10 2016 +0100 @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Map.Entry; +import javax.servlet.ServletContext; import javax.servlet.http.HttpSession; import net.sf.jasperreports.engine.JRDataSource; @@ -67,6 +68,7 @@ import net.sf.jasperreports.j2ee.servlets.ImageServlet; import net.sf.jasperreports.web.util.WebHtmlResourceHandler; +import org.openbravo.base.ConfigParameters; import org.openbravo.base.exception.OBException; import org.openbravo.base.session.OBPropertiesProvider; import org.openbravo.client.kernel.reference.UIDefinitionController; @@ -940,7 +942,7 @@ } if (jasperFilePath.endsWith("jrxml")) { - String strBaseDesign = DalContextListener.getServletContext().getRealPath(""); + String strBaseDesign = getBaseDesignPath(); JasperReport jReport = getTranslatedJasperReport(new DalConnectionProvider(false), jasperFilePath, language, strBaseDesign); if (connectionProvider != null) { @@ -1469,4 +1471,17 @@ return tmpFolder; } + + private static String getBaseDesignPath() { + ServletContext servletContext = DalContextListener.getServletContext(); + ConfigParameters configParameters = ConfigParameters.retrieveFrom(servletContext); + + String base = configParameters.strBaseDesignPath; + String design = configParameters.strDefaultDesignPath; + + if (!base.startsWith("/")) { + base = "/" + base; + } + return servletContext.getRealPath(base + "/" + design); + } } \ No newline at end of file ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits