details:   https://code.openbravo.com/erp/devel/pi/rev/a71a3822d5e5
changeset: 31376:a71a3822d5e5
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Jan 31 09:16:34 2017 +0100
summary:   fixes issue 35087: ReportingUtils should have a public 
getBaseDesign() method

This new method allows to have an utility method to retrieve the default design 
sub-folder relative path. This can be useful, for example, for those classes 
extending BaseReportActionHandler that want to implement their own logic 
(overriding the getReportTemplatePath method) to retrieve the path of the jrxml 
template instead of using the default logic which takes the template path from 
the Application Dictionary.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java
 |  17 ++++++++-
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 2e2a9ff7c644 -r a71a3822d5e5 
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
  Tue Jan 31 08:59:00 2017 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java
  Tue Jan 31 09:16:34 2017 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014-2015 Openbravo SLU
+ * All portions are Copyright (C) 2014-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -1473,7 +1473,13 @@
     return tmpFolder;
   }
 
-  private static String getBaseDesignPath() {
+  /**
+   * Returns the relative path to the default design sub-folder within the 
context's base design
+   * folder.
+   * 
+   * @return a String with the relative path to the default design sub-folder.
+   */
+  public static String getBaseDesign() {
     ServletContext servletContext = DalContextListener.getServletContext();
     ConfigParameters configParameters = 
ConfigParameters.retrieveFrom(servletContext);
 
@@ -1483,6 +1489,11 @@
     if (!base.startsWith("/")) {
       base = "/" + base;
     }
-    return servletContext.getRealPath(base + "/" + design);
+    return base + "/" + design;
+  }
+
+  private static String getBaseDesignPath() {
+    ServletContext servletContext = DalContextListener.getServletContext();
+    return servletContext.getRealPath(getBaseDesign());
   }
 }
\ No newline at end of file

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to