4 Replies Latest reply: Nov 19, 2012 10:09 AM by 560962 RSS

    Use a static file as HTML region source

    560962
      Hi All,

      Sorry for maybe trivial question, but is there a way to use static files as HTML region source? The files are simple enough but have to be translated so we'd rather keep them as static files, rather than paste them in multiple region sources to display conditionally.

      I tried something like

      <embed src="#WORKSPACE_IMAGES#&FSP_LANGUAGE_PREFERENCE.file01.txt" >

      This however is showing the HTML source on screen and not rendering it as html.

      The other option I tried is creating an URL region that would get the content from the same server, e.g.:

      http://localhost:9080/apex/wwv_flow_file_mgr.get_file?p_security_group_id=4874627831984398&p_fname=en_file01.txt

      ... but I'm running against an access control list (ACL) error. The file opens when one loads the link directly in a browser but localhost apparently is not allowed in ACL and I would not have sysdba access where I deploy.

      finally I saw recommendation to use an iframe in a similar discussion to display pdf file here Display PDF in Apex Region land tried
      <iframe src="#WORKSPACE_IMAGES#&FSP_LANGUAGE_PREFERENCE.file01.txt&embedded=true" style="" ></iframe>

      but receive "Not found

      The requested URL /apex/wwv_flow_file_mgr.get_file was not found on this server" as if the file name is not received at all? Same name is parsed correctly in the embed tag.

      Please help

      Atanas
        • 1. Re: Use a static file as HTML region source
          jariola
          Hi,

          For me it sounds you could use shortcuts instead of some files in workspace files
          http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldapp_cut.htm#sthref1696

          Regards,
          Jari
          -----
          My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
          Twitter: http://www.twitter.com/jariolai
          • 2. Re: Use a static file as HTML region source
            560962
            Hi Jari,

            This is really helpful and as shortcutnames can use substitution strings I can now use only one HTML region and the source would be like:

            "&P5_LANG_UPPER._DI"

            A minor problem was that the :FSP_LANGUAGE_PREFERENCE we use is lowercase like 'en' but the shortcut names are saved as all uppercase but a computation solved this.

            And, the shortcuts text does not get into the translations, which was the initial reason we wanted to keep the region text out of the application.

            Thanks a lot!

            Atanas
            • 3. Re: Use a static file as HTML region source
              Arie Geller
              Hello Atanas,

              >> the shortcuts text does not get into the translations …

              Just so you know, and for future reference, the shortcuts of type Message are fully translatable (as mentioned in the documentation Jari pointed out to you).

              Regards,
              Arie.

              -------------------------------------------------------
              &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

              &diams; Author of Oracle Application Express 3.2 – The Essentials and More
              • 4. Re: Use a static file as HTML region source
                560962
                Hi Arie,

                I just noticed this and came back to modify the post. There is a checkbox to exclude a region Title from translation, but not the region itself, shortcut or not.
                This could be useful though as you pay the translation house by the character .


                Atanas