This discussion is archived
7 Replies Latest reply: Nov 19, 2012 6:06 AM by toki79 RSS

Apex Plugin Development. Howto refer a file?

toki79 Newbie
Currently Being Moderated
Hi,

i am trying to develop an apex plugin. I need to load a file which is not a css or javascript but an java.class. I found the packages apex_css and apex_javascript, but i did not find a way to get only the path of my custom file.

Can somebody give me an advice? Perhaps somebody did already use an java applet as apex plugin?

Thanks!

Tobias
  • 1. Re: Apex Plugin Development. Howto refer a file?
    Tom Petrus Expert
    Currently Being Moderated
    p_plugin.file_prefix
    Alternatively, you can always put the file in the apex_images directory and use
    apex_application.g_image_prefix
  • 2. Re: Apex Plugin Development. Howto refer a file?
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Tobias,

    the purpose of apex_css and apex_javascript are to avoid that a file is loaded multiple times on a page. If you load a file for an applet or an image, you have to load it multiple times (if the component is used multiple times) anyway. Use the following code to include an applet on a page, assuming that you have uploaded java.class as file of the plug-in.
    sys.htp.p('<applet code="' || p_plugin.file_prefix || 'java.class" width="350" height="350">Java applet that does something</applet>');
    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 3. Re: Apex Plugin Development. Howto refer a file?
    toki79 Newbie
    Currently Being Moderated
    That solved my issue. Thanks!

    oh no..

    The resulting html code is wrong:
     <applet code="wwv_flow_file_mgr.get_file?p_plugin_id=37324526778091070&p_security_group_id=1768426873207992&p_file_name=DrawingLines.class" width="350" height="350">Java applet that does something</applet>
    The String in attribute "code" is not real a path..

    Edited by: toki79 on Nov 19, 2012 12:01 PM
  • 4. Re: Apex Plugin Development. Howto refer a file?
    toki79 Newbie
    Currently Being Moderated
    unfortunately the solution does not work
  • 5. Re: Apex Plugin Development. Howto refer a file?
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Tobias,

    I'm not really familiar with the &lt;applet> tag, but looking at http://www.w3schools.com/tags/tag_applet.asp
    I think you can also use "archive" (which is a URL) and then just reference a class file of that archive in "code".

    Anyway, you might want to reconsider using &lt;applet> and replace it with &lt;object> as mentioned in the above document, because "applet" isn't supported in HTML5 anymore.

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
  • 6. Re: Apex Plugin Development. Howto refer a file?
    fac586 Guru
    Currently Being Moderated
    toki79 wrote:
    That solved my issue. Thanks!

    oh no..

    The resulting html code is wrong:
    <applet code="wwv_flow_file_mgr.get_file?p_plugin_id=37324526778091070&p_security_group_id=1768426873207992&p_file_name=DrawingLines.class" width="350" height="350">Java applet that does something</applet>
    Can we back up several steps and ask why you need to use a Java applet in the first place? Inferring from "DrawingLines.class" that you have a requirement involving drawing, why not use SVG or one of many JavaScript libraries (e.g. Processing.js) that would be more APEX/device/browser-friendly?
  • 7. Re: Apex Plugin Development. Howto refer a file?
    toki79 Newbie
    Currently Being Moderated
    For now I just like to find out if it is possible to use an java applet with an apex plugin. DrawingLines is just a dummy. My real intention is to build a kind of olap browser plugin to enable ad-hoc reporting. This is an feature that I often miss in apex.
    If it turns out that I cannot use an applet I will look for other technologies or give up :-)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points