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 18:11 Go to next message
john.libby is currently offline john.libbyFriend
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 18:55 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
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?
Previous Topic:Deploying the latest BIRT-viewer on JBoss 5.1.0 fails
Next Topic:ods limitations?
Goto Forum:
  


Current Time: Fri Nov 28 14:59:09 GMT 2014

Powered by FUDForum. Page generated in 0.01924 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software