Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » resource file usage
resource file usage [message #728712] Fri, 23 September 2011 14:11 Go to next message
john.libby is currently offline john.libby
Messages: 3
Registered: September 2011
Junior Member
I can't seem to find anything on the usage of resource files (properties files, specifically) for use in scripts and data source binding (other than profiles or localization). Is it possible to do this? I need to use values from properties files for both datasource binding but also other context-specific values, such as external filepaths. One way I found to get properties is using reportContext.getMessage("foo"), however this assumes there is a default localization, which doesn't apply to the types of properties I'm trying to use. Is there another way to get values from a properties file, or perhaps turn localization off so that it will not look for the file with locale appended?
Re: resource file usage [message #728727 is a reply to message #728712] Fri, 23 September 2011 14:55 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If your file is in the resource folder just use
reportContext.getResource("yourfile"); This will return a path to the
file which you should be able to open and read. I used it once to get
an image from a jar file like:

var jarfile = reportContext.getResource("myimages.jar");
fulljarimage = "jar:"+jarfile.toString()+"!/BIRT1_2ndEd_frontsmall.jpg";


Jason

On 9/23/2011 2:11 PM, john.libby wrote:
> I can't seem to find anything on the usage of resource files (properties
> files, specifically) for use in scripts and data source binding (other
> than profiles or localization). Is it possible to do this? I need to use
> values from properties files for both datasource binding but also other
> context-specific values, such as external filepaths. One way I found to
> get properties is using reportContext.getMessage("foo"), however this
> assumes there is a default localization, which doesn't apply to the
> types of properties I'm trying to use. Is there another way to get
> values from a properties file, or perhaps turn localization off so that
> it will not look for the file with locale appended?


Jason Weathersby

BIRT Exchange
Previous Topic:Deploying the latest BIRT-viewer on JBoss 5.1.0 fails
Next Topic:ods limitations?
Goto Forum:
  


Current Time: Sun Apr 20 03:00:19 EDT 2014

Powered by FUDForum. Page generated in 0.01945 seconds