Menu

dbforms-errors.xml

2003-09-23
2003-09-30
  • nafise nafise

    nafise nafise - 2003-09-23

    I've configured dbforms-errors.xml to replace the Oracle error messages with my own messages, such as the below part:

    <dbforms-errors>
    <error id="00001"  type="WARN">
    <message language="ORA">Oracle message : English Duplicate Key</message>
    </error>
    </dbforms-errors>

    It works properly.

    Now, I want to configure this file using i18n for Oracle messages; Has any body done it before (Using ResourceBundles)?

    Thanks in advance
    Nafise

     
    • Henner Kollmann

      Henner Kollmann - 2003-09-24

      Which version do you use?
      Please could you explain in detail what you want to do?

      Thanks,
      Henner Kollmann

       
    • nafise nafise

      nafise nafise - 2003-09-25

      I use the latest version of dbforms : 1.1.3
      As I described I could replace the Oracle message (ex. ORA-00001 with my own message written in message tag in dbforms-errors.xml), but I wanna to show error messages in an internationalized application using at list two languages (ex. English and Farsi).  How could I configure dbforms-errors.xml to use resource bundles? or any other way to replace the error messages of my DBMS with my own error messages in multiple languages?

      Thank you,
      Nafise

       
    • Henner Kollmann

      Henner Kollmann - 2003-09-26

      Hi Nafise,
      i posted your message to our mailing list...

      Here is the answer from Shawn:

      Hello Nafise,

      I haven't done that (yet) myself but have you seen chapter 17 in the
      UsersGuide?

      17.3. Using i18n within DbForms

      Instead of 'hard coding' messages, labels, etc., dbForms has made available
      the 'message' tag. This tag can be used to display data retrieved via a
      resource bundle. The actual properties file used to retrieve the text is
      dependant on the end-user's locale-setting.

          <%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
          <! - - Retrieving a message  - - >

              <db:message key="msg.bienvenue.1"/>
          <BR><BR>
          <center>
            <db:message key="msg.bienvenue.2"/></center>
          <BR><BR>

      Is that what you were looking for?

      >> As I described I could replace the Oracle message (ex. ORA-00001 with
      >> my
      >> own message written in message tag in dbforms-errors.xml), but I wanna
      >> to show error messages in an internationalized application using at list
      >> two languages (ex. English and Farsi).  How could I configure dbforms-
      >> errors.xml to use resource bundles? or any other way to replace the
      >> error messages of my DBMS with my own error messages in multiple
      >> languages?
      >>
      >>
      >> Thank you,
      >>
      >> Nafise
      >>
      >> _____________________________________________________________________
      >> _
      >> You are receiving this email because you elected to monitor this forum.
      >> To stop monitoring this forum, login to SourceForge.net and visit:
      >> https://sourceforge.net/forum/unmonitor.php?forum_id=55829
      >>
      >
      >
      >
      > -------------------------------------------------------
      > This sf.net email is sponsored by:ThinkGeek
      > Welcome to geek heaven.
      > http://thinkgeek.com/sf
      > _______________________________________________
      > DbForms Mailing List
      >
      > http://www.wap-force.net/dbforms
      >

      --
      Shawn

      Happily using M2, Opera's revolutionary e-mail client:
      http://www.opera.com/m2/

      -------------------------------------------------------
      This sf.net email is sponsored by:ThinkGeek
      Welcome to geek heaven.
      http://thinkgeek.com/sf _______________________________________________
      DbForms Mailing List

      http://www.wap-force.net/dbforms

       
    • nafise nafise

      nafise nafise - 2003-09-26

      Dear Henner And Shawn;

      First of all thank you very much for the attention you paid. I've used the message tag of dbforms taglib in my jsp pages before, it works properly. But I want to use it in dbforms-errors and as you know this is a xml file not a .jsp. I don't know if there is anyway to use the message tag in dbforms-errors file or any other way to enable me defining two error messages in this file.

      Thank you,
      Nafise

       
    • nafise nafise

      nafise nafise - 2003-09-26

      two error messages(in two languages) for one uniq error code ;)

      Cheers,
      Nafise

       
    • Henner Kollmann

      Henner Kollmann - 2003-09-27

      Dear Nafise,

      no i understand your problem...
      In the moment this is not possible.
      You must patch the XMLErrorsUtil.getXMLErrorMessage method.

      After getting the message from aError you can search for the translation of the message with one of the MessageResources.getMessage routines.

      Only problem is to retrieve the request or the current locale.

      I think you need an extra parameter in getXMLErrorMessage.

      If you did the patch please send it back so that we can build it into the current release...

      cheers,
      Henner

       
    • nafise nafise

      nafise nafise - 2003-09-29

      Dear Henner;

      It would be my honor to prepare this patch, just let me know in which object you saved Locale and the name of the object's attribute". (the session and its key)

      Cheers,
      Nafise

       
    • Henner Kollmann

      Henner Kollmann - 2003-09-30

      current locale is stored in the HttpServletRequest.
      You can retrieve if with the MessageResources.getLocale method.

      Now you can use MessageResources.getMessage(msg, loc) to retrieve the message.

      To get the locale into the getXMErrorMessage you must extend it with an extra parameter locale and fill this in all occurences of getXMLErrorMessage.

      Found only 4 places...

      Cheers,
      Henner

       
    • Henner Kollmann

      Henner Kollmann - 2003-09-30

      If we transform this thread to one of the mailing lists i can anwser ealier.
      SF monitoring do not work well. So i do not get any hint that there are new mails.

      I look at the page each 2-4 days, hopefully.

      So answer is slow.

      Cheers,
      Henner

       

Log in to post a comment.