Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 217204

Summary: Add BIRT resource folder and BIRT_HOME variables in ReportContext global variable
Product: z_Archived Reporter: Linda Chan <lchan>
Component: BIRTAssignee: Haojun Chu <hchu>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: lzhu, wyan, xxue
Version: 2.2.0   
Target Milestone: 2.3.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Linda Chan CLA 2008-01-30 20:43:34 EST
For file-based data source properties like a flatfile data source data file, or a connection profile store file path, an user should have the option to customize the root path of his file location, such as in BIRT_HOME or the BIRT resource folder.
Providing corresponding variables for the BIRT resource folder and BIRT HOME folder in the ReportContext global variable list would allow an user to reference those folder locations in a JavaScript expression for a data source property binding.
For example,
   reportContext.getGlobalVariable( "BIRT_RESOURCE_FOLDER" ) + "/data/csv.dat"
Comment 1 Gary Xue CLA 2008-01-30 22:19:20 EST
The get/setGlobalVariable() method is used for user-defined global variables. For BIRT system properties, it's more user friendly if we provide getter/setter methods, e.g., get/setResourceHome().
Comment 2 Haojun Chu CLA 2008-03-03 03:02:18 EST
the viewer sets the resource home in the appContext:

appContext.put("BIRT_RESOURCE_FOLDER", "c:/resources/"), 

passes the appContext in the renderTask/runTask through:

task.setAppContext(appContext)

the user can get the resource in the script:

reportContext.getAppContext().get("BIRT_RESOURCE_FOLDER")


No new API needed to support this case.