[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: Report internationalization in RCP application

Loïc,


I tested this with my installation:

Before you create the engine set the resource location to the folder with your properties file. In this example I used a folder called resources that was in my RCP application. This is where I put my properties file.

EngineConfig config = new EngineConfig();

try{
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("org.eclipse.birt.examples.rcpengine");
URL url = FileLocator.find(bundle, new Path("/resources"), null);
String myresourcepath = FileLocator.toFileURL(url).getPath();
config.setResourcePath(myresourcepath);


}catch(Exception e){

e.printStackTrace();
}


// Create the report engine
IReportEngineFactory factory = (IReportEngineFactory) org.eclipse.birt.core.framework.Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );


Jason
		

Loïc Bertholet wrote:
Thanks for your answer.

I've already tried that but it doesn't work.
I look at the source code and the called method don't seem to search in the report engine classloader...


org.eclipse.birt.report.model.api.DefaultResourceLocator.getResource( ModuleHandle moduleHandle, String fileName )

tries to find .properties file in the resource path with a "disk file" search and an "URL search" only.

It also look into the "org.eclipse.birt.resources" fragments classloader...

What I want to know is if there is simple way to internationalize report than creating a fragment or a new IResourceLocator...

Thanks.

Loïc