cancel
Showing results for 
Search instead for 
Did you mean: 

Read out properties generated by XLF files

Former Member
0 Kudos
84

Dear community,

I have a problem reading out property files generated by Web Dynpros XLS (S2X-Editor). What I have to do is generate a printer-friendly version of my Web Dynpro views to enable users to get a printable report.

Now my problem is reading out the property-files generated by Web Dynpro with a java utility class.

I think my attempt fails, because those property files for each view follow a naming convertion, which is like this:


 com.mypackage.mysubpackage.MyViewName.wdview_<Locale>.properties

.

so when I try to access those property files with a call like


	 Locale sessionLocale = WDResourceHandler.getCurrentSessionLocale(); 
	 ResourceBundle resourceHandler = ResourceBundle.getBundle("com.mypackage.mysubpackage.MyViewName.wdview",sessionLocale);

I guess the resourceHandler thinks "wdview" is the name of my resource and tries to resolve this name to a propery file such as wdview_de.properties.

Am I missing something? Did anyone experience a similar behaviour or knows a working work-around?

My SAP-solution would be to duplicate code (...) which is no fun and a real pain when application texts are changed on later development stages...

Thanks for your support!

regards,

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

found the solution myself, so here is my insight:

The view-specific property-files generated by the XLF-files can not be accessed by Java as the ResourceBundle.getBundle(...) method replaces all dots in the name of the Resource file according to this:

It generates a path name from the candidate bundle name by replacing all "." characters with "/" and appending the string ".properties".

(see SUN Java API docs [ResourceBundle|http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html])

Thing is the generated property-files of the views get merged into property files for the component. So if your component sports 12 views with one xlf- and property-file each, there is gonna be one big property-file for the whole component, that resides in your wdp folder.

Accessing this file is pretty straight-forward, the naming is like "Resource" + <Name of Component> +".properties".

Maybe someone else struggles with WDJ and needs this.

regards,

Christian

Edited by: Christian Henn on Jan 17, 2008 6:01 PM

Edited by: Christian Henn on Jan 18, 2008 11:06 AM