Read out properties generated by XLF files

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

Similar Messages

  • Reader 10.1 generates enormous PS file; Reader 9.4.3 works OK

    I'm trying to print my TurboTax 1040 form. 
    Using Reader 10.1 when I print any Current Page Reader 10.1 generates an enormous (16MB) print file which overloads my printer.
    When I uninstall 10.1, install 9.4.3 (and then update), and then print the same Current Page Reader 9 generates a 845kb (that's right: kb) which my printer prints successfully. 
    Both versions of Reader used the default configuration.
    How can I configure Reader 10.1 to generate a print file similar to the one generated by Reader 9.4.3?
     Running Windows XP Pro SP3 32-bit fully patched; printing to HP LaserJet 4M+ with 38MB ram connected via Ethernet port.

    To uninstall the remnants of 9.x use the cleaner tool http://labs.adobe.com/downloads/acrobatcleaner.html
    This may also uninstall Reader X.
    Regarding Reader X (10.1.4), this is a bit old; try to update it to 10.1.10 (the last Reader X certified for Windows XP).
    You may also try to update to Reader 10.1.13 - although no longer officially certified for XP, it does run fine.
    If the crash remains, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].

  • How do I disable preparation for read out laid when I open files on the Mac Acrobat Pro DC

    I seem to remember this was a real problem in Windows? for earlier versions as I would sit and wait for Acrobat to do this meaningless chore as I never have files read to me.  But there was a software switch somewhere in the prefs.  I really can no longer find that switch.  Anyone know where it is or maybe this should be a requested feature?  Thanks

    Try: Edit > Preferences > Reading > Screen Reader Options > Only read the currently visible pages

  • How to use IMAQ to read out custom information in .tiff file?

    Currently, our lab use AFM to scan sample surface. The result was saved as .tiff file.
    Here are lots of information stored in the .tiff file, such as scan range, tip offset...
    But when I try to use IMAQ to load such .tiff file. I just get the image, and some information such as x resolution, y resolution, calibration.
    Is there some way to use IMAQ tool to extract all the information I need from .tiff file?
    Thanks a lot!

    I tried to use read text file vi. But what I get is some meaningless characters. Just like this.
    II* Ô   ô                                                                                 ¥ÂZEÃÒZE    ª}gDó» ‘N‘>test3                                   Mesuared by JSPM-5200                                                                                                                                                                                                                                            ?  Ù Ù :/  
    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ                       ÿÿÿÿ                    «ÊDÚ¢I@                {.A                   ?    @  ºB   @ PCG PCG  €?           €?jè@  €? øâE              SPM                                                                                                                                                                                                                                                                         ý?F                                                                                                    ÿÿÿÿ  ÿ ÿÿUÿþ    þ  þ þ 𪠠   
    "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~€‚„†ˆŠŒŽ’”–˜šœž ¢¤¦¨ª¬®°²´¶¸º¼¾ÀÂÄÆÈÊÌÎÐÒÔÖØÚÜÞàâäæèêìîðòôöøúüþ )19AJRZbjs{ƒ‹”œ¤¬´½ÅÍÕÞæîöÿ )19AJRZbjs{ƒ‹”œ¤¬´½ÅÍÕÞæîöÿ                               ªÿ ÿU ÿ ÿÿ ªÿÿ þþ  þ þ`  þðªŒþþ  
    "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~€‚„†ˆŠŒŽ’”–˜šœž ¢¤¦¨ª¬®°²´¶¸º¼¾ÀÂÄÆÈÊÌÎÐÒÔÖØÚÜÞàâäæèêìîðòôöøúüþ )19AJRZbjs{ƒ‹”œ¤¬´½ÅÍÕÞæîöÿ                                                              ª ÿ ÿª  ÿ ÿÿUªÿ  þªPþ  þþþðª þþ  
    Why is that ?

  • How to read out and modify text parts in a pdf-document?

    Hello,
    My problem is the following: I want to read out text passages of an existing pdf-file, compare them with files in an odbc-database and write down the results of that comparison in the same pdf-file. The term is: Read out a number in the file, search the database for the matching user-name, generate a field in the pdf and write down the search results in that.
    i have read that this could be possible with acrobat...my version is an acrobat 9 pro extended...
    could someone please tell me how to do that?
    big thanks

    As the definition of “color” vs. “black and white” differ by context – there aren’t any that I am aware of.
    You can, however, use the Preflight feature built into Acrobat to identify whatever you wish…

  • After the last update that was pushed out by Adobe, my Acrobat 9 Pro will not generate a PDF file fr

    After the last update that was pushed out by Adobe, my Acrobat 9 Pro will not generate a PDF file from; [right click], Combine files into one PDF multiple files chosen in the explorer.  A message pops up asking if I want to run repair.  Answering in the afirmative results in another message stating files are missing.  And we are back at square one.

    What is the exact error?  Else you could always reinstall your software.

  • How do you find out what application is generating a plist file in your preference folder?

    I have had two similar warnings come up in Drive Genius 3, a program that I use to manage my drives.  The warnings occur during a daily verification of preferences on my main drive, a 256GB SSD. 
    They state:
    "The preference file at '/Users/me/Library/Preferences/com.analogsolutions.Football.plist' may be corrupted."
    "The preference file at '/Users/me/Library/Preferences/org.machinedevelop.National.plist' may be corrupted."
    Per Drive Genius' advisement, "Corrupted files can cause appplication crashes and should be moved to the Trash." I delete the files, however they are regenerated each day. 
    Q: How do you figure out what application is generating a preference file?  And is there a way to tell if this is a OS generated preference file? 
    I have searched online and cannot find any information about either Analog Solutions or Machine Develop nor am I able to discern what these particular .plist files are for... 
    Q: Are these two .plist files truly potentially harmful?
    Thanks for the Help!
    iMac
    model iMac12,2
    3.4 GHz Intel Core i7
    8 GB 1333 MHz DDR3

    Hi Everyone, sorry for the late response.  I have been monitoring my Preferences Folder; every moment I am on my computer trying to catch what application/process generates these files.  I was hoping to try your suggestions, but oddly enough the offensive .plist files have not returned since the last time I deleted them about a week ago.... strange...
    In any case, I have responded to some of your suggestions and questions that I have information on:
    X423424X wrote: Ok, can you double click the .plist file?  If so it should attempt to launch the Property List Editor (in your Utilities folder).  That way you can look at stuff in the plist.  Maybe (hopefully) there's something in there that can shed some light on who is creating it.   If Property List Editor cannot open the file (some apps create files that have the .plist extension but don't actually create the proper XML format -- probably what ProSoft was alluding to) then try opening it with a text editor.
    The .plist file when opened in text editor contains a string of (what to me seems to be) an arbitrary list of numbers.
    Linc Davis wrote: Those files have been given obfuscated names so you won't know what created them. They must contain encrypted registration data for some third-party commercial software that you use.
    Yes, seems likely...
    Linc Davis wrote: It should be fairly easy to find out what application is creating them, if you really care. Move the files to the Desktop, then log out. Log back in while holding the shift key as you click the "Log In" button. That will prevent your login items from loading, among other things. Open your account preferences and launch the login items one at a time by double-clicking them in the list. After each one, check to see whether the files have been recreated.
    Ran through login, one by one, no luck in identifying the application(s). 
    X423424X wrote: Another thought, lock the plists on the hope that whatever is using them will "choke" and complain about it (no guarantee that will work but worth a try).
    Thanks, the lock idea is the one I will try next if they ever reappear...
    X423424X wrote: Also, I don't recall if I asked this but if those plists are deleted while logged in will they be recreated during that same login session.  Or do they only appear after you deleted them and then and then logged out and back in?  Or do you have to reboot to recreate them?
    Unfortunately I do not know for certain.  Though from all my login/startup/reboot tests I believe that they are not directly linked to starting up the machine or loging in either.
    I'm not really certain why the .plist have not returned.  I haven't uninstalled any programs, though I did run a couple updates for some widgets within the last week; however that was about 3 days after I deleted the last set of .plist files and usually they reappered everyday.  In any case, given that they have not been regenerated I guess my problem is solved per se, at least I am no longer getting that annoying warning everyday.   Still, it's a bit of a mystery  
    Thanks again for all the help!

  • Java.lang.NullPointerException   in the code to read a properties file

    I have written the following code to read a properties file...........
    <b>
    public Property(String fileName)
        try
           InputStream is = MyClassName.class.getClass().getClassLoader().getResourceAsStream(fileName);     
           prop.load(is);
           is.close();
        catch (Exception ex)
            System.out.println("The Exception is:        " + ex.getMessage());
            ex.printStackTrace();
    </b>
    But this code is giving <b> java.lang.NullPointerException </b> at <b> prop.load(is) </b>
    please help me....
    regards
    Brahmachaitanya

    hi,
        If you are loading a resource (property) file from a jar file you can use
    getResourceAsStream("com/test/test.properties").
        if the propery file is in outside of your jar file . you can use
    Property portalProps = new Property ();
    try {
                   FileInputStream fileInputStream = new FileInputStream("<FilePath + FileName>");
                   portalProps.load(fileInputStream);
                   fileInputStream.close();
              } catch (IOException e) {
                   //Log the error
    refer the following link for more details
    http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html

  • How to read the properties file available in Server File structure in webdy

    hi all,
    I have developed one webdynpro application. In this application i need to access mdm server to continue. For getting the connection i need to pass the IP addresses.
    Can i have code  how to read the properties file which is residing in the server file. with out included along with the application. keeping some where in the file structure in the server. I want to read that properties file by  maintain the iP addresses and users in  properties file based on the key i want to read like below.
    servername="abcServer"
    username="john"
    password="test123"
    Please send me the code how to read this properties file from the file structure and how to read this values by key  in webdynpro application
    Regards
    Vijay

    Hi Vijay,
    You can try this piece of code too:
    Properties props = new Properties();
    //try retrieve data from file
    //catch exception in case properties file does not exist
    try {
             props.load(new FileInputStream("c:\property\Test.properties")); //File location
             String serverName = props.getProperty("servername"); //Similarly, you can access the other properties
             if(serverName==null)
               //....do appropriate handling
         }     catch(IOException e)
                   e.printStackTrace();
    Regards,
    Alka.

  • How get output generated as csv file  by reading  by buffered reader and wr

    how get output generated as csv file by reading by buffered reader and writer

    String file_location = "C\temp\csv.txt");
    try {
         URL fileURL = getClass().getResource(file_location);
         if (fileURL != null){
              BufferedReader br = new BufferedReader(new InputStreamReader(fileURL.openStream()));
              String s = br.readLine();
              while (s != null)  {
                   if (!s.equals ("")) {
                        System.out.println(s);
                   s = br.readLine();
              br.close();
         else {
              // error
    catch (IOException ex){ex.printStackTrace();}rykk
    Message was edited by: a dummy
    rykk.

  • How do I read a properties file in WEB-INF without hard-coding a path?

    Hello,
    How do I read a properties file in WEB-INF without hard-coding a path?
    I tried:
    Properties properties = new Properties();
    properties.load(new FileInputStream("db.properties"));
    driver = properties.getProperty("driver");
    but it cannot find the db.properties file.
    Thanks for the help.
    Frank

    Don't use a File to read those properties.
    Better to use the servlet context and
    getResourceAsStream() method to get the InputStream.
    It'll look for any file in the CLASSPATH. If you put
    that properties file in the WEB-INF/classes directory
    you'll have no problems, even if you deploy with a
    WAR file.Completely agree with this approach. Just have to mention the following for completeness
    according to the API,
    "This method is different from java.lang.Class.getResourceAsStream, which uses a class loader. This method allows servlet containers to make a resource available to a servlet from any location, without using a class loader. "
    So using this method, the resource can be anywhere under your web context, not just in the classpath.
    Cheers,
    evnafets

  • Using image data read out from a file

    Hi,
    Having used the GetBitmapFromFileEx(), GetBitmapInfoEx() to acquire the necessary image data (most of them is the .png format), then using the FileToArray() to put the image data in my own binary file, e.g., "mypicture.dat". My idea is that whenever need to use the image, I can read out it from mypicture.dat and then display it on a pcture control.  But when loading the image data to the memory, I have no idea to map the image data buffer to an image resource, which can let to acquire a bitmap ID.  Because from the  cvi's image processing function lists, it seems that must through such as  the GetBitmapFromFileEx(), GetBitmapFromFile() to acquire the image data buffer and the bitmap ID, then using SetCtrlBitmap() to diplay it. Is there any way to resolve the problem? Thanks.
    David 

    Well, to read and write raw data file informations from a PNG image you must adhere to this standard. As a source of informations you may take a look to this Wikipedia page and to the links in this page from the PNG Home site.
    So the problem is: does your application worth the effort to study this documentation?
    Edit: FYI part of this job has been already made in CVI by Guillaume Dargaud for his ReadSavePNG instrument driver. It's been a long time since I have used this instrument, as I/O operations on PNG files have been integrated into CVI since release 8 and support for JPEG files in release 7 or so. Nevertheless I saw functions in that instrument for accessing raw data in a PNG file so you may find them useful for your needs.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all,
    I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file.If calling a servlet for the same is d best way to do that, plz can ne1 tell me :
    1> whether to override the doPost method in the servlet in which to read d file using FileInputStream
    2> Putting the contents in an array and then how to pass this array to the JSP page.
    Thanks,
    deepthy.

    I'm using a properties file to let my web application know what the name of the database is. I'm using an abstract class GeneralDao which will be extended by all the DAO's (Data Access Objects or java classes containing SQL statements).
    Here's the code :
    protected Connection getDatabaseConnection()
              throws Melding
         Connection dbconn = null;     
         ResourceBundle resBundle;
         try
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         resBundle = ResourceBundle.getBundle("gcoConfig");
         String dbConnectie = resBundle.getString("databaseconnection");
         gcoLogger.debug("lezen databaseconnection in resourceBundle " );
         dbconn = DriverManager.getConnection(dbConnectie);
         } catch (InstantiationException exc)The ResourceBundle is used to read the properties file, named gcoConfig.properties.
    With the getString() command I read the content of the string named databaseconnection.
    The gcoConfig.properties file is placed inside the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes
    The GeneralDao is placed in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes\org\gertcuppens\cluifDao.
    So this class is placed some folder below the WEB-INF\classes folder of gcoConfig.properties.
    And the content of the properties file is just one line :
    databaseconnection=jdbc:mysql://localhost/cluif
    If you want to let the JSP know what's inside the properties file, wrap the content in a Javabean, put it in the request or even the session and pass the control to the JSP.

  • I need help with a PDF file that is an image, the "Read Out Loud' option does not work, please help!

    I need help with a PDF file that is an image, the "Read Out Loud' option does not work, please help!

    You mean an image such as a scanned document?
    If that is the case, the file doesn't contain any text for Reader Out Loud to read. In order to fix that, you would need an application such as Adobe Acrobat that does Optical Character Recognition to convert the images to actual text.
    You can also try to export the file as a Word document or something else using ExportPDF which I believe offers OCR and is cheaper than Acrobat.

  • Adobe Reader 11.0.1 cannot read Captivate CS5 generated PDF files

         I have a some training programs made with Captivate version CS-5 generated as PDF files. When I try to open them in the new reader, I see only one page (irrespective of the number of pages in the original file) with some garbled data such as "[email protected]". Is there a way to overcome this problem. I am using Windows 7.

    Thanks for the link, but installing the flash player and the newer version of the Reader [11.0.02] doesn't help. So I had to reinstall the X version to make things work. I want to make a bug report but the form isn't working either!

Maybe you are looking for