Use resourceBundle properties file from KM

Hi,
I have a properties file called com.mycomp.apps.phonebook.properties in the KM Content of the portal in KM Content => root => mycomp => apps => phonebook => customizing
Now I'm developing a new LinkCommand service for the UserDetails.
http://help.sap.com/saphelp_nw04/helpdata/en/65/29b24053c13f5fe10000000a155106/frameset.htm
The already existing LinkCommand "Send E-mail..." is read from the original resourceBundle com.sap.ip.collaboration.gwui.api.wdf.mail.SendTo
For my new LinkCommand I would like to use the existing properties file. How do I have to define this file in the uicommand xml or properties xml sheet?
Can anybody help me?
With the local project resourceBundle it's working, but I would like to use the file in the KM. Andy ideas?
Regards,
Stefan

Hi Praven,
Copying all existing SendTo properties file to my project would be an option but I wouldn't win anything.
I'm quite happy with the existing SAP collaboraton properties files using e.g. for "Send e-mail".
I won't change this existing ones. I created a new LinkCommand. And for this new LinkCommand I'm looking for a solution how I can handle the translation for it.
I would prefer e using my existing file which is located in the KM. The reason why it's located in the KM is, if I need to change a translation or add a new translation properties file I only need to change it in the KM. If it's a part of the project I need by every change to deploy the project new.

Similar Messages

  • Read resourceBundle properties file from KM

    Hi,
    I have a properties file called com.mycomp.apps.phonebook.properties in the KM Content of the portal in KM Content => root => mycomp => apps => phonebook => customizing
    Now I'm developing a new LinkCommand service for the UserDetails.
    http://help.sap.com/saphelp_nw04/helpdata/en/65/29b24053c13f5fe10000000a155106/frameset.htm
    The already existing LinkCommand "Send E-mail..." is read from the original resourceBundle com.sap.ip.collaboration.gwui.api.wdf.mail.SendTo
    For my new LinkCommand I would like to use the existing properties file. How do I have to define this file in the uicommand xml or properties xml sheet?
    Can anybody help me?
    With the local project resourceBundle it's working, but I would like to use the file in the KM. Andy ideas?
    Regards,
    Stefan

    Hi Praven,
    Copying all existing SendTo properties file to my project would be an option but I wouldn't win anything.
    I'm quite happy with the existing SAP collaboraton properties files using e.g. for "Send e-mail".
    I won't change this existing ones. I created a new LinkCommand. And for this new LinkCommand I'm looking for a solution how I can handle the translation for it.
    I would prefer e using my existing file which is located in the KM. The reason why it's located in the KM is, if I need to change a translation or add a new translation properties file I only need to change it in the KM. If it's a part of the project I need by every change to deploy the project new.

  • Unable to load properties file from filesystem

    Hi,
    I have a client swing-applicatiion packaged in a jar-file. The application uses some resource files, including a xxxx.properties file to set defaults for the application. All resource files are included in the jar file and everything works as expected. I load the xxxx.properties file as follows:
    is_ = getClass().getResourceAsStream("/resources/xxxx.properties");
    Because it is not possibl to change any property values inside the jar-file without recreating this jar-file, i want to exclude the xxxx.properties file from the jar-file and put it in the folder containing the jar-file.
    So i have:
    drive:/folder/app.jar
    drive:/folder/xxxx.properties
    Now i read the xxxx.properties file from disk in stead of the 'resouce'-folder within my application (jar):
    is_ = getClass().getResourceAsStream("drive:/folder/xxxx.propoerties");
    but it doesn't work, the file isn't found.
    What am i missing here?
    Any suggestions?

    The best way to approach this is to include the properties file in the Jar as you originally did. If the user changes any property, save the entire set of properties to a sub-directory of user.home (perhaps based on the package name of the main class). Check for the copy in user.home before using the 'default' properties built into the Jar.
    Other places/ways to store the changed information.
    - java.util.prefs.Preferences
    - Assuming the app. has a GUI and can be deployed over a network, the JNLP API PersistenceService. Here is a demo. of the PersistenceService (http://pscode.org/jws/api.html#ps).
    Edit 1:
    I did not at first notice that this post was in Java Applet Development.
    <li> Applets can also (theoretically) use cookies to store information. This is prone to failure when users disable cookies.
    <li> To store information on the local file system (e.g. in user.home) or to use Preferences (AFAIU) would require trusted code.
    <li> If the user has the Next Generation Java Plug-In (Java 1.6.0_10+) it is possible to leverage the JNLP API services in an embedded & sand-boxed applet.
    Edited by: Andrew Thompson on Feb 1, 2011 9:32 AM

  • How to get File Reference of a properties file from EJB

    Hi,
    I am using Sun App server 7 with Oracle 9i. I am keeping all my SQL statements in a properties file from which I am loading it while making a database operation from Stateless beans. My problem is I am not able to get the reference of the properties file. Here is the code through which I am getting the SQL statements loaded to a cache.
    String sqlFileName = "SQL.properties";
    sqlCache.load(new FileInputStream(sqlFileName));
    From the cache I am sending the SQL statement depending on the key value. But the problem is I have to keep the SQL.properties file on the App Server config directory of the instance where the server.xml file resides. Otherwise it is not able to find the properties file. But I don't want to put the properties file on the config directory of the server instance. Please help how to get the properties file from the packakge. My file is residing inside a package com.company.sql . Botht the properties file and the class accessing the file are residing in the same package. Please help how to get the reference of the file with out putting the file in the config directory.
    Thanks
    Amit Patnaik

    Just wanted to warn you of the hazards if you read a file from EJB
    So please make sure that these hazards will not affect your application. However the solution suggested to use getResourceStream() concurs with ejbSpec
    This snippet is from suns blueprint on ejb
    Why can't EJBs read and write files and directories in the filesystem? And why can't they access file descriptors?
    Enterprise beans aren't allowed to access files primarily because files are not transactional resources. Allowing EJBs to access files or directories in the filesystem, or to use file descriptors, would compromise component distributability, and would be a security hazard.
    Another reason is deployability. The EJB container can choose to place an enterprise bean in any JVM, on any machine in a cluster. Yet the contents of a filesystem are not part of a deployment, and are therefore outside of the EJB container's control. File systems, directories, files, and especially file descriptors tend to be machine-local resources. If an enterprise bean running in a JVM on a particular machine is using or holding an open file descriptor to a file in the filesystem, that enterprise bean cannot easily be moved from one JVM or machine to another, without losing its reference to the file.
    Furthermore, giving EJBs access to the filesystem is a security hazard, since the enterprise bean could potentially read and broadcast the contents of sensitive files, or even upload and overwrite the JVM runtime binary for malicious purposes.
    Files are not an appropriate mechanism for storing business data for use by components, because they tend to be unstructured, are not under the control of the server environment, and typically don't provide distributed transactional access or fine-grained locking. Business data is better managed using a persistence interface such as JDBC, whose implementations usually provide these benefits. Read-only data can, however, be stored in files in a deployment JAR, and accessed with the getResource() or getResourceAsStream() methods of java.lang.Class.
    Hope this info helps!

  • Changing a .properties file from within a programme

    Hi, I was just wondering is there anyway that i can change a .properties file from within a programme?
    I have certain values in the .properties file and I want to add a username and password to the file once it has been entered in a login part of the programme.
    I have had a look at the docs and can not seem to find any suitable methods.
    Cheers Gareth.

    store is a good method.
    In practical use, sometimes you have a .properties file full of comments (properties files are to be modified by humans, and humans need comments), but they are not retrieved by "load" so they will not be stored back by "store". It's a pity that it happens (the equivalent Windows API, WritePrivateProfileString, has a better behaviour).
    Maybe someone has written a method that can modify a properties file, without changing the order of the pairs name=value and without throwing out comments.

  • UNable to locate Properties files from Servlets

    I have a Web App deployed in the default domain (domain1)that contains a servlet which needs to read in values from a .properties file from the filesystem. However, whenever I try to use it, I always end up with a FileNotFoundException.
    I tried keeping the properties file in the d:\Sun\AppServer7\bin as well as d:\Sun\AppServer7\domains\Domain1\server1\bin and still get the same exception.
    Can anyone tell me where I need to keep the .properties file? FYI, I have deployed the same on Tomcat 4.x and the same app worked perfectly (with the prop file in d:\tomcat4\bin directory).
    Thanks,
    Chetan

    Try the instance config directory. In your case, this is probably D:\Sun\AppServer7\domains\domain1\server1\config.

  • Cannot seem to read properties file from JSP

    Hi all,
    In an ISA 4.0 application I want to read a properties file from a JSP to decide whether or not to execute some specific JavaScript code. I want the properties file because in it I can easily configure this externally. I put my properties file in /WEB-INF/classes.
    I develop on an environment using Tomcat where this works fine. On an acceptance machine using the SAP J2EE engine however this won't work, to my surprise. Can anyone give me a suggestion on why my properties file is not read?
    Here's the Java scriptlet code:
    UserSessionData userSessionData = UserSessionData.getUserSessionData(session);
    // theme will be something like "themes/zester":
    String theme = (String) userSessionData.getAttribute(Constants.THEME_KEY);
    boolean showScript = false;
    int slashIndex = theme.indexOf('/');
    String themeKey = null;
    // get the "zester"-like part from the theme:
    if(theme != null && slashIndex > -1) {
      themeKey = theme.substring(slashIndex + 1);
    Properties props = new Properties();
    InputStream is = application.getResourceAsStream("/WEB-INF/classes/script.properties");
    if(is != null) {
      props.load(is);
      is.close();
      Enumeration keysEnum = scriptProps.propertyNames();
      while (themeKey != null && keysEnum.hasMoreElements()) {
       if(theme.toUpperCase().endsWith((String) keysEnum.nextElement())) {
        showScript = true;
        break;
       showScript = false;

    Hi Kishor,
    Thank you for taking the time!
    I agree, this issue may have to do with the deployment. There is however a remark in the <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html">ServletContext</a>  interface documentation on methods <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getResource(java.lang.String)">getResource()</a> and <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getResourceAsStream(java.lang.String)">getResourceAsStream()</a> that may also be of interest here:
    "The servlet container must implement the URL handlers and URLConnection objects that are necessary to access the resource."
    Is this remark of relevance to the subject, or is this thought too far fetched? Mind you, the documentation also states that "This method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war file". It should, therefore, be possible to read a file from disk???
    Cheers,
    Peter-Jan Bosch

  • Multiple use of properties file

    Is there a way to use a properties file for multiple languages?
    ie.
    en_EN points to the en_EN properties file
    I want en_US to also point to that, is this possible? (it now points to default language if not present)
    And anyone got a good tutorial / overview of the possibilities of properties file? have not been able to find a good example that shows all possibilities
    Thanks

    Provide an en version which contains all the English stuff, then put all the en_US and en_EN variants into those files respectively.

  • Log4J - reading properties file from /WEB-INF directory issue..

    I'm just learning to implement Log4J; the approach I am taking for my JSF application running under Tomcat 5.5x is to create an initialization servlet to initialize the logger, and then access the logger instance within my backing beans and application module services. I include log4j.jar file in /WEB-INF/lib and log4j.properties in /WEB-INF.
    First I wanted to see if this was a good approach, and secondly I'm having trouble accessing the log4j.properties file from the /WEB-INF directory (see below) - any suggestions on how to set up the path so that the properties file can be found (I receive a java.io.filenotfoundexception)?
    Where I'm looking for direction is how to define a single instance of the logger and then access that instance from my java classes versus re-creating the logger in each class.
    ----- web.xml --------
    <servlet>
    <servlet-name>LogServlet</servlet-name>
    <servlet-class>com.sidehire.view.util.LogServlet</servlet-class>
    <init-param>
    <param-name>setup</param-name>
    <param-value>/WEB-INF/log4j.properties</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    ------ LogServlet class ------
    public void init()
    throws ServletException {
    String config = getInitParameter("setup");
    PropertyConfigurator.configure(config);
    Thanks
    Message was edited by:
    javaX

    Try to put the log4j.properties in your WEB-INF/classes/ directory.
    You could wrap one log4j instance in a static method in a utility class, but then you would probably lose other information depending on your logger configuration.
    If you create an instance in each class, which after all is just one line like this:
    static Logger logger = Logger.getLogger(ChangePasswrdAction.class.getName());
    then you are able to get time and method information.

  • Using Search_replace.properties file

    I am trying to use Migration assistant to migrate my forms form 6i to 10g.
    While doing so , I want to use search_replace.properties file to search for soem strings and automatically replace them.
    I want to search for 'message_box(' but it is not being read due to this '(' special symbol.
    How can I include special symbols in search or replace string?

    So no reply on this thread...
    I will take look at jdapi, but with my poor knowledge of java ......
    JeanYves

  • How can I use mp4 audio files from my iTunes library in an Elements 10 slide show?

    How can I use mp4 audio files from my iTunes library in an Elements 10 slide show?

    AAC is Advanced Audio Coding.  Basically it's a format that sounds better than MP3 but doesn't take up as much space as a lossless format (like you'd have on a CD).  More than likely you've had that encoding turned on when you ripped your music into itunes (it's the default encoder).  Therefore your LG phone won't play them.
    You need to turn off the AAC format by going to the iTunes menu, Preferences, General (at the top), then clicking the "Import Preferences" button.  Change the AAC Encoder to MP3 Encoder.  After that you'll have to make MP3 copies of your songs by right clicking them and selecting "Create MP3 Version."  You'll get a copy of the song that should transfer to your SD card and have MP3 encoding.  Hopefully your phone will play that.

  • Is this how to use a properties file?

    Hi:
    The following is how I intend to create and read a properties file, please verify for me that the idea is correct.
    1. create myProp.properties
    2. in myProp, the content is like such:
    a=myA
    b=myB
    c=myC
    3. In my application,
      FileInputStream in = new FileInputStream(getClass().getResourceAsStream("/myProp.properties"));
      Properties p = new Properties();
      p.load(in);
      String a = p.getProperty("a");
      String b = p.getProperty("b");
      String c = p.getProperty("c");Thanx!

    It depends on what youare doing but if you have a set of properties that you are going to always use from one running of the application to the next, they should generally be defined as static finals.
    For example, lets say you want a configuration file for an application that holds the user's preferences. You might want something like this:
    public class Preferences {
       private static final String ALWAYS_ON_TOP = "always on top";
       private Properities preferences = new Properties();
       static {
          //load the file
       public boolean setAlwaysOnTop(boolean alwaysOnTop) {
          preferences.put(ALWAYS_ON_TOP, String.valueOf(alwaysOnTop));
       public boolean getAlwaysOnTop() {
          return Boolean.valueOf(preferences.get(ALWAYS_ON_TOP));
       public void save() {
          /save file
    }

  • ResourceBundle, Properties file ...syntax...HELP PLEASE

    Would someone please tell me how to correctly write a StringArray with key value pair in a properties file?
    Example:
    button.labels="Mrc","DataExtraction","ScheduleProcessing"
    button.Actions=mrc/data/schedule
    button.ImageIcons=FTIlittle.gif,FTIlittle.gif,FTIlittle.gif
    these are the ways I have tried...
    here is the code snippet:
    buttonLabels = resources.getStringArray("button.labels");
    buttonActions = resources.getStringArray("button.Actions[]");
    buttonImageIcons = resources.getStringArray("button.ImageIcons[]");
    I keep getting the error saying that my 'array' in the .properties file is not an array.
    How do I do this...
    Thanks in advance!

    Hello and Welcome to Apple Discussions. 
    Apple advise to use the Disk Utility if possible rather than fsck in 10.4.
    Boot from your Tiger install DVD.
    Don't run the installer but rather choose Disk Utility from the menu bar. In Disk Utility select Macintosh HD on the left hand pane and then click "Repair Disk" and "Repair Disk Permissions".
    Quit Disk Utility and exit the Installer.
    Let us know how you get on.
    mrtotes

  • How do you use .wsse policy file from Java Client?

    I'd like to call a WSSE enabled web service from my Java client but setup my encryption/signing requirements with a .wsse policy file.
    I know how to call a web service by programmatically setting up the security headers as described in:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
    But how can I do the same thing by simply using a .wsse file?

    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.net.*;
    public class links extends java.applet.Applet {
       Panel panel = new Panel();
       public links(){
          super();
          add(panel);
          Link link = new Link(this,"Answers for programmers;- ","http://forum.java.sun.com");
          panel.add(link);
       public void init(){
          setVisible(true);
       public class Link extends Label implements MouseListener {
          Applet applet;
          Color fcolor = Color.blue;
          Color lcolor = Color.pink;
          String text;
          String word;
       public Link(Applet ap, String s, String s1){
          super(s);
             this.applet = ap;
             this.text = s;
             this.word = s1;
             addMouseListener(this);
          setForeground(fcolor);
       public void paint(Graphics g){
       super.paint(g);
          if (getForeground() == lcolor){
             Dimension d = getSize();
             g.fillRect(1,d.height-5,d.width,1);
       public void update(Graphics g){paint(g);}
       public void mouseClicked(MouseEvent e){
          try{
             URL url = new URL(word);
             applet.getAppletContext().showDocument(url,"_self");
          catch(MalformedURLException er){ }
       public void mouseEntered(MouseEvent e){
          setForeground(lcolor);
          setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          repaint();
       public void mouseExited(MouseEvent e){
          setForeground(fcolor);
          setCursor(Cursor.getDefaultCursor());
          repaint();
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
       public static void main (String[] args){
          new links(); 
    }

  • Using Multiple Properties Files in Struts Framework

    Hi Everybody!
    I just to know how to use a multiple message-resources files in a Struts Framework.
    I've 2 properties file :
    1. ApplicationResources_A.properties
    2. ApplicationResources_B.propertiesI put the files under WEB-INF/classes dir.
    My configuration in struts-config file something like below:
    <!--  Begin Testing -->
         <message-resources key="A" parameter="ApplicationResources_A" />
         <message-resources key="B" parameter="ApplicationResources_B" />
    <!--  End Testing -->
    </struts-config>
    if my JSP code is like below , this error is thrown:
    org.apache.jasper.JasperException: Cannot find message resources under key A
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message bundle="A" key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message bundle="B"  key="user.lang.desc"/></td>
      </tr>
    but  if I change the  JSP code like below it  work fine:
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message  key="user.lang.desc"/></td>
      </tr>
    In this code , I dont know  which resources file is used.
    So how do I solve this problem. Thanks you.

    I have defined the following:
    struts-config.xml
    <message-resources key="ldap" parameter="com/project/struts/ldap"/>
    Action.java
    In execute method:
    MessageResources messageResources= MessageResources.getMessageResources("com/project/struts/ldap");
    System.out.println("INITIAL_CONTEXT_FACTORY"+messageResources.getMessage("INITIAL_CONTEXT_FACTORY"));
    and it is working, however I have to change "com/project/struts/ldap" value in Action.java file whenever there is any change in name or location of ldap.properties.
    Can I access this properties in such way that I don't have to change parameter path manually in Action.java (modifying in struts-config.xml is okay)? like access through key="ldap" or something.
    Thanks and regards,

Maybe you are looking for

  • User Authorisations in Dialog Programming.

    Hi Friends, I have a small requirement, I want to create user authorisations in dialog programming. Actually client requirement is he want to enter absence details of each and every branch. For that i have created a cusom table and i  also i have dev

  • PO creation and GR query

    Hi I am relatively new to the SRM module and I have query for you guys. In extended classic scenario, (or irrespective of deployment scenarios) for PO creation in the backend R/3 system I believe the BAPI is called through RFC and hence PO is created

  • Trouble connecting to PC by name

    Hi I am trying to use Remote Desktop Connection to access a Windows XP Professional PC. I recently found out that I can get in by using the IP address. However, if I try to identify the PC by name, the program returns a message saying I may not have

  • EDI output message for Outbound Deliv send with application own transaction

    Dear All, I encountering a problem with the output message "WSOR" via EDI. What i want:        I would to configure this message output without the Dispatch time " 3: Send with application own transaction". What is encountering now:       I have done

  • Why does the Save As File command create an empty .eml file?

    When I use the >Save As >File command with a selected email, a .eml file is created with the right name, but it is empty. I am using Thunderbird 31.2.0 on OS X 10.8.5.