on 2008 Jan 16 4:38 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.