Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035087Openbravo ERPA. Platformpublic2017-01-30 17:232017-03-15 20:18
vmromanos 
caristu 
normalminoralways
closedfixed 
5
 
3.0PR17Q2 
alostale
Core
No
0035087: ReportingUtils should have a public getBaseDesign() method
In BaseReportActionHandler there is the possibility to override getReportTemplatePath() method to provide a custom JRXML template path.

However there is no easy way to recover the @basedesign@ that must be concatenated before the JRXML path.

Example:
@basedesign@: /src-loc/design
jrxml path: /org/openbravo/erpCommon/ad_reports/AgingScheduleHTML.jrxml
returned by getReportTemplatePath(): /src-loc/design/org/openbravo/erpCommon/ad_reports/AgingScheduleHTML.jrxml


A public static method called getBaseDesign() in ReportingUtils should be created to return the @basedesign@, in the example /src-loc/design
NA
In ReportingUtils:

public static String getBaseDesign() {
    ServletContext servletContext = DalContextListener.getServletContext();
    ConfigParameters configParameters = ConfigParameters.retrieveFrom(servletContext);

    String base = configParameters.strBaseDesignPath;
    String design = configParameters.strDefaultDesignPath;

    if (!base.startsWith("/")) {
      base = "/" + base;
    }

    return base + "/" + design;
  }

  private static String getBaseDesignPath() {
    ServletContext servletContext = DalContextListener.getServletContext();
    return servletContext.getRealPath(getBaseDesign());
  }



(see attached file)
No tags attached.
blocks feature request 00350893.0PR17Q2 closed nonofrancisco Integrate module Aging Balance Report into Openbravo 3 distribution 
diff reportingutils.diff (3,791) 2017-01-30 17:23
https://issues.openbravo.com/file_download.php?file_id=10356&type=bug
Issue History
2017-01-30 17:23vmromanosNew Issue
2017-01-30 17:23vmromanosAssigned To => caristu
2017-01-30 17:23vmromanosFile Added: reportingutils.diff
2017-01-30 17:23vmromanosModules => Core
2017-01-30 17:23vmromanosTriggers an Emergency Pack => No
2017-01-30 17:25vmromanosSummaryReportingUtils should have a public getBaseDesignPath() method => ReportingUtils should have a public getBaseDesign() method
2017-01-30 17:25vmromanosDescription Updatedbug_revision_view_page.php?rev_id=14395#r14395
2017-01-31 08:54vmromanosRelationship addedblocks 0035089
2017-01-31 09:17hgbotCheckin
2017-01-31 09:17hgbotNote Added: 0093955
2017-01-31 09:17hgbotStatusnew => resolved
2017-01-31 09:17hgbotResolutionopen => fixed
2017-01-31 09:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a71a3822d5e5a15d62daa038c38004c98414b0a0 [^]
2017-01-31 09:19caristuReview Assigned To => alostale
2017-02-03 08:41alostaleNote Added: 0094025
2017-02-03 08:41alostaleStatusresolved => closed
2017-02-03 08:41alostaleFixed in Version => 3.0PR17Q2
2017-03-15 20:18hudsonbotCheckin
2017-03-15 20:18hudsonbotNote Added: 0095147

Notes
(0093955)
hgbot   
2017-01-31 09:17   
Repository: erp/devel/pi
Changeset: a71a3822d5e5a15d62daa038c38004c98414b0a0
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Jan 31 09:16:34 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a71a3822d5e5a15d62daa038c38004c98414b0a0 [^]

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.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java
---
(0094025)
alostale   
2017-02-03 08:41   
code reviewed
(0095147)
hudsonbot   
2017-03-15 20:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test