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

Bug 217950

Summary: Add BIRT-specific Java system property to map to Viewer's BIRT_RESOURCE_PATH
Product: z_Archived Reporter: Linda Chan <lchan>
Component: BIRTAssignee: Jerry Cheng <cyfgod>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: cyfgod, qaobsolete, yli
Version: 2.2.0   
Target Milestone: 2.3.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Linda Chan CLA 2008-02-05 21:03:45 EST
An user may want to explicitly specify the use of BIRT_RESOURCE_PATH (defined in the viewer's web.xml on a deployment server), as the root path in a file-based Property Binding for a data source or data set.
  
A simple solution is to register a BIRT-specific jvm variable "birt.viewer.resource.path" that maps to the value of BIRT_RESOURCE_PATH (similar to the BIRT-specific jvm variable "birt.viewer.working.path").  With this available, an user can then specify the following JavaScript expression:
 config[ "birt.viewer.resource.path" ] + "/data/mytestfile.dat"
similar to 
 config[ "birt.viewer.working.path" ] + "/..../data/mytestfile.dat"
Comment 1 Jerry Cheng CLA 2008-02-18 01:26:20 EST
Support it.
In deployment env, please change the init value of BIRT_RESOURCE_PATH in web.xml. It can be ${birt.viewer.resource.path}.
Comment 2 Ivy Li CLA 2008-02-21 15:17:43 EST
Please roll back this change since those paths should not be registered as system parameter. Please pass in the resource path value that viewer loaded from web.xml to appContext to Engine when viewer start the task. Then user will be able to access the value from the script. 
Comment 3 Jerry Cheng CLA 2008-02-21 21:35:19 EST
Push resource path to appcontext when call engine task.
Please use reportContext.getAppContext.get("birt.viewer.resource.path") to get resource folder in script.