Get Dynamic HTML from Apex Page as CLOB

Good Morning,
I have two APEX pages that are designed to provide formatted report content; however, these are not intended to be navigable from within the application. In other words, I am not letting the user view the pages directly. Instead, their purpose is to generate dynamic content so that I can feed their HTML into a HTML to PDF converter so the generated PDF can be attached to an email and sent to clients. I have found that the easiest way to generate this report is directly in APEX, but I haven't yet found a way to just run the page via a PL/SQL API and retrieve the dynamic content into a CLOB so that I can send it to my converter utility. I have tried UTL_HTTP, but I am either using that API incorrectly, or the security context of the session is not proagating to the call (this is being performed in a secure APEX application), thus I receive the following error [ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1674 ORA-29024: Certificate validation failure]. I am using Apex version 3.2. Does anyone know a good and straight-forward API for doing what I need to accomplish? Thanks in advance.
Erik

To mimic the users session, you'd have to forward on the session cookies as part of the HTTP request.
A simpler option:
* Allow public access to the page
* Apply an authorization scheme to the page that looks something like this...
if owa_util.get_cgi_env('REMOTE_ADDR') = '127.0.0.1' then
  return true;
else
  return false;
end if;(PL/SQL Function Returning Boolean)
Then when you perform the request in your code, use 127.0.0.1 instead of the host name.

Similar Messages

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

  • Getting the HTML of a page.

    I wish I could retrieve as a string the HTML content of a page displayed by a webEngine.
    I know this code works:
    webEngine.getPage().getHtml(webEngine.getMainFrame());
    But getPage() and getMainFrame() are not public.
    What is the "official" way to get the HTML content of a page as a string?

    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.layout.VBox;
    import javafx.scene.web.WebView;
    import javafx.stage.Stage;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.ls.DOMImplementationLS;
    import org.w3c.dom.ls.LSSerializer;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    // Getting the HTML of a page. "Getting the HTML of a page"
    public class DocumentPrinter extends Application {
      public static final String CONTENT =
          "<dl>\n" +
          "<dt>Coffee</dt>\n" +
          "<dd>- black hot drink</dd>\n" +
          "<dt>Milk</dt>\n" +
          "<dd>- white cold drink</dd>\n" +
          "</dl>";
      public static void main(String[] args) { launch(args); }
      @Override public void start(Stage primaryStage) {
        // create view with some content in it.
        final WebView view = new WebView();
        view.getEngine().loadContent(CONTENT);
        view.setPrefSize(200, 100);
        // hold a log the view's document.
        final Label documentLabel = new Label();
        // write the document to the document label
        view.getEngine().documentProperty().addListener(new ChangeListener<Document>() {
          @Override public void changed(ObservableValue<? extends Document> observableValue, Document oldValue, Document webViewDocument) {
            try {
              Node originalRoot = webViewDocument.getDocumentElement();
              // copying the document is necessary in this case because the serializer
              // we are using is not realized by the webview document implementation.
              // if you used a different serialization library, perhaps the copy step would not be required.
              // http://stackoverflow.com/questions/5226852/cloning-dom-document-object
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              Document copiedDocument = db.newDocument();
              Node copiedRoot = copiedDocument.importNode(originalRoot, true);
              copiedDocument.appendChild(copiedRoot);
              // weird dom api for serialization.
              // http://stackoverflow.com/questions/1219596/how-to-i-output-org-w3c-dom-element-to-string-format-in-java
              DOMImplementationLS domImplLS = (DOMImplementationLS) copiedDocument.getImplementation();
              LSSerializer serializer = domImplLS.createLSSerializer();
              // update the document label with serialized document.
              documentLabel.setText(serializer.writeToString(copiedRoot));
            } catch (ParserConfigurationException e) {
              e.printStackTrace();
        // layout the scene.
        final VBox layout = new VBox(10);
        layout.setStyle("-fx-padding: 10; -fx-background-color: cornsilk");
        layout.getChildren().addAll(
          new Title("Web View"),          view,
          new Title("Original Content"),  new Label(CONTENT),
          new Title("Rendered Document"), documentLabel
        primaryStage.setScene(new Scene(layout, 450, 450));
        primaryStage.show();
      class Title extends Label {
        Title(String titleString) { super(titleString); setStyle("-fx-font-weight: bold;"); }
    }

  • When Publishing to BC, images get swapped around from other pages

    When i am Publishing my muse file to Business Catalyst, all my images get swapped around from other pages, both in slideshows and placed images, how do i get it to stop doing this! In preview mode the images are where i want them!
    This is one of my pages with the slide show with the correct image
    This is the image that is appearing in its place within the slide show which is from another page within my site!
    I have tried to look through each page and re publish the site which is working for some pages but then makes others worse!

    Check out Apnewbie's page on publishing errors. See if any of the suggestions help your particular situation....
    http://web.mac.com/mark8heaton/iWeb/PublishErrorsHelp

  • Why am I suddenly getting this message from a page I have been using for 6 months(Error code: sec_error_unknown_issuer) how do I get my page back?

    Why am I suddenly getting this message from a page I have been using for 6 months(Error code: sec_error_unknown_issuer) how do I get my page back?

    Did you reset Firefox recently?
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    If that is the case then you may have lost intermediate certificates that were stored in the cert8.db file in the Firefox profile folder.
    Check out why the site is untrusted (see the Technical details) and if this is caused by a missing intermediate certificate then see if you can install this intermediate certificate from another source.
    Some firewalls monitor secure (https) connections and send their own certificate instead of the website's certificate.
    You can retrieve the certificate and check details like who issued certificates and expiration dates of certificates.
    *Click the link at the bottom of the error page: "I Understand the Risks"
    Let Firefox retrieve the certificate: "Add Exception" -> "Get Certificate".
    *Click the "View..." button and inspect the certificate and check who is the issuer.
    You can see more Details like intermediate certificates that are used in the Details pane.

  • Global temporary table in PL/SQL called from APEX page

    I have a global temporary table in a PL/SQL procedure that is called from an APEX page.
    The global temp table is populated with data as the procedure runs and then at the end of the procedure I do a create_collection_from_query_b to populate a collection with the data from the temp table. (I do this b/c it is much faster than creating the collection and doing an add_member for each row.)
    The problem is that there are no commits in my procedure but I cannot get the bulk insert to work unless I define the temp table as on commit preserve rows.
    Can anyone shed any light on this issue.
    Thanks,
    Andrew

    alamantia wrote:
    My PL/SQL procedure is called from an after submit page process. Does that imply that there is a commit happening after that process is successful?Ultimately, yes.
    If the process calls the PL/SQL procedure and the temp table is in the procedure, wouldn't the commit fire after all the PL/SQL code is complete which would be after the bulk insert from the temp table to my collection?Yes, but at any point in the procedure containing code like
    :APEX_ITEM := ...or
    select ... into :APEX_ITEM from ...or
    my_procedure(p_in => ..., p_out => :APEX_ITEM, ...);or
    apex_util.set_session_state(...);then APEX will commit whilst maintaining session state.
    If you don't have any of these events in the procedure, then test to see if the commit is occurring in <tt>apex_collection.create_collection_from_query_b</tt> prior to creation of the collection.

  • Hyperlink from Apex page to MS Word. any body guide please

    I want to open a Microsoft word document from oracle apex page. i create a hyperlink and give him the path like <a href="d:\abc.doc"></a> it is not working properly. can any body guide me how can i open the .doc by pressing a button or by creating a hyperlink.

    Hi,
    can you provide here the ms word document full path..?
    I mean you have to put the document file in some path of web server.
    If you want to put the file into apex than you have to upload it apex workspace.
    How to upload a file?
    Step 1: go to shared component
    Step 2: go to static files
    Step 3: click on create and upload the document file here eg demo_file.doc
    Step 4: now create a new html region and put following code into source of html region
    <!--Click here-->
    Thanks,
    Jaydip Bosamiya
    +91 - 76000 23053
    http://jbosamiya.blogspot.com
    Edited by: Jaydip Bosamiya on Apr 1, 2011 10:09 AM

  • How can i get dynamic values to next page.

    HI!
    I am generating a dynamic rows with some different values.And in the end of each row there is a button .i want as i click that button i can get those values on next page.
    Can any one help me out in this.
    On click i can send values thouugh get or post to next page.But how will i read that on next page.
    Help if any one can.

    Not excatly.But i am trying to solve that problem.Responding early may
    help me.

  • DOCTYPE missing from ApEx pages

    How do I add the DOCTYPE stanza to the ApEx pages?
    We have a requirement that ApEx pages need to pass the w3c validators. Since the first error is "missing DOCTYPE", the validator can't do much more.
    Where do I go on an ApEx page or application to include the DOCTYPE? I tried the page header and page html header, but that only buried the DOCTYPE way down the page.
    I'm not even sure which DOCTYPE I should be using? HTML or XHTML
    Oracle Support basically shrugged their shoulders at my question, so I'm hoping I'll find better answers here.
    Thx.

    Thanks for pointing me to the info in the doc. A quick look at the template shows how easy it will be to make changes.
    What kind of doctype does ApEx try to be? I've seen some posts suggest the doctype is xhtml. When using the validator, it seems that xhtml doctypes give a lot less error than the html doctype.
    Any guidance on selecting the appropriate DOCTYPE?
    Thx.

  • Call iexplore.exe from apex page

    I have a requirement to have a link from my main application apex page to invoke a client windows os command 'iexplore.exe -noframemerging' (I think this ie option used to be -nomerge). The idea is, this will fire up a separate IE8 session in a separate browser session, thus partitioning it from any other IE sessions. I know in IE8 there is a 'New Session' menu option but we need a link that is more obvious/integrated within our application. Our idea is to "persuade" users to click this link in preference to 'New Tab' or 'New Window' option.
    Now, my quandary is how to do this. Should I be calling a Java Applet from the page (via Javascript) but is this "sand boxed" and thus will not let me call an executable for security reasons ?
    Obviously I would also like to cater for users running Firefox (which I presume could detect in javascript and pass the browser type into the applet).
    Is this sane, Is there any other way ?
    Any advice would be appreciated or has someone already been down this road and could give me some pointers or an example.
    Thanks in anticipation.

    Our corporate application already has calls to similar executables (ie MS Word, Excel) to do letter merges, document transfers etc using signed Java libs on the backend server. I suppose this requirement is different as I'm wanting to run an executable on the client pc. So, are we saying it is not possible to run an 'iexplore.exe' on the client PC (using a signed Java applet) ?
    Edited by: theArrow on Apr 11, 2011 1:20 AM
    Edited by: theArrow on Apr 11, 2011 4:52 AM

  • Removing index.html from home page / remove .html tags from all other pages

    Hello All,
    I was wondering if there is a way to remove the index.html from my main page, so that www.mypage.com/index.html is simply www.mypage.com/. This also applies to all the other pages in the site, but only for the .html extension: www.mypage.com/contact.html becomes www.mypage.com/contact. Almost all sites I know do this, but I can't figure out the technique beyond working some crazy voodoo with Apache.
    Thanks in advance for your help!

    if 'index.html' is in your HOST server's default filename list, then you can omit its name from any link, e.g.,
    <a href="/">Home</a>
    That link will cause the server to load the default file found in the root folder of the site.
    This is actually the preferred way to link to your home page.

  • Open dynamic tab from remote page

    Hi!
    I have a question. We use JDeveloper 11.1.2.1.0
    We are using dynamicTabShell template for dynamic tabs managment in our application. Everything works as it should if page is using dnymicTabShell template. But...
    I would like to have a Home.jspx that would load when client logs in. Home should be a special page without dynamic tabs support. I would like to have quick links on Home.jspx that would open certain page and bounded task flow with page fragments in application. How can I achieve that? Do I have to enable URL invoke property? Problem is, we implemented custom security that checks if client has proper permissions before task flow is launched through _launchActivity* method in launcher.java. URL invokation would make security more complex.
    In fewer words: Is there's a way of opening certain tab in application from page that does not use dynamicTabShell template? Or do I have to enable URL invoke property on bounded task flows with page fragments? How can I then check permissions if task flow is reachable through URL.
    I hope I'm being clear.
    Regards, Marko

    OK, is there no other way of opening a bounded task flow with page fragments in a page (which is using dynamicTabShell template) from other page that is not using dynamicTabShell template?
    Maybe calling _launchActivity in beforePhase is completely wrong approach, because "java.lang.NullPointerException: UIComponent is null" is returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Impossible to run an applet in a signed jar from APEX page

    <applet id="runApp"
    CODE="TestApplet"
    ARCHIVE="/i/...path to applets dir.../applets/test.jar"
    width=1 height=1>
    </applet>
    The class TestApplet is in the jar's root.
    Java console shows:
    java.lang.ClassNotFoundException: TestApplet
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://kor:7777/i/...path to applets dir.../applets/test.jar/TestApplet.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    The applet is not called by javascript => should not be blocked by Java plugin.
    Igor
    Edited by: kortchnoi on Nov 1, 2009 2:28 PM

    Well... All of a sudden it began to work. Why - I don't know. Maybe, because I have restarted the browser. Or else.
    Anyway, now I can launch *.exe (some legacy applications) from APEX on Firefox. Next step - IE that resists for the moment.
    Igor

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Clustered listener gets nothing back from APEX after upgrade to 4.1.1

    Hi,
    I'm not sure if that subject is entirely accurate, but that appears to be the effect we are experiencing. We have had an SR open for this since April and seem to have the engineers stumped. Maybe someone on here has some insight that may help...
    Environment: Seven APEX instances
    APEX 4.1.1 (problem started after upgrading from 4.0.x) running on an 11g RAC.
    Listener version 1.1.3.243.11.40 running on WebLogic 10.3.2.0
    Listeners are in 2x clusters on two different WebLogic domains spread over 4 different servers.
    Problem:
    In two of the apex instances, a couple of days after upgrading to 4.1.1, the listeners starting returning blank, empty pages to the browser. We went through all the usual debugging steps (/i/ directory, connectivity, etc) and nothing fixed the problem. Finally the only thing that fixes the problem is to shut down one of the two clustered WL managed servers running the listeners, reducing the listener to a single instance per APEX instance. Like clockwork, if the second managed server is brought back up, within minutes-to-hours, the listener starts returning blank pages to the browser. Just a couple of days ago, a third apex instance and its listeners has started to manifest the problem and had to be half shut down. We are beginning to think there is a bug in APEX 4.1.1 that deadlocks the listener (or something) when it is clustered...
    Other data points:
    The listenerAdmin and listenerStatus pages continue to work and report perfect health for all listeners involved.
    The APEX management console (p=4550:1) is also affected by the problem, not just apps.
    We ran the "apex_verify" script on all problem instances with no errors.
    We have hard rebooted all affected servers, with no change in the problem.
    This identical environment was running perfectly stable, clustered for many months on APEX 4.0 (and before).
    The only thing that keeps our APEX apps running is to run the listeners single instance (un-clustered).
    Thanks in advance for any help that anyone can provide on this very annoying problem!
    Brian
    Edited by: bpoarnet on Jun 12, 2012 12:51 PM

    Udo wrote:
    So it's somewhere within your WLS setup.Mmm... I won't discount anything, but I doubt it. If that were the case, how could this exact environment have managed to work flawlessly for the past 3 years on these clusters, the listener being upgraded several times through several versions of apex? Only directly after we upgraded apex (not the listener) to 4.1.1 did our troubles start. My suspicion is that there is a bug or a change in 4.1.1 (or maybe 4.1 as we applied 4.1.1 right after 4.1) that has manifested this problem for us.
    >
    They definitely are not being used equally, but none of them are being slammed. Usage is fairly light in all cases.... which sounds like if there is some kind of load balancing algorithm different from round robin in your scenario.Ahh, I misinterpreted your question. You were asking if the load is balanced fairly between nodes on the same cluster. I took you to be asking if our separate, unrelated apex instances get the same use. So, the answer then is "yes" hits to a single listener WLS cluster do appear to be getting assigned equally to the different nodes, and the clusters are installed as per the documentation with round-robin scheduling.
    ####<Jun 11, 2012 11:07:31 AM EDT> <Warning> <Socket> <hostname> <server-name> <ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <1339427251735> <BEA-000450> <Socket 5 internal data record unavailable (probable closure due idle timeout), event received 17>That could probably have a lot of reasons, but none of them is specific to APEX Listener. Google gives a lot of hits ranging from memory issues to missing classes, and ... duplicate configuration parameters, e.g. app names, jdbc pool names, etc.... and of course, I'm not convinced that this has much to do with the problem at hand. It just happened to be in the log at around the time that someone noticed the problem happening in one case.
    Could it be your APEX Listener is deployed multiple times on the same node using the same name?Good thought, but definitely no. We figured out that issue a couple of years ago, back when you had to hack the listener WAR file to make it use a non-temporary config.
    Lastly, I just want to thank you again Udo for patiently digging into this. We now have three SR's open with Oracle on this (RAC team, APEX team, and WebLogic team) and we have gotten nowhere yet with any of them...

Maybe you are looking for

  • Is there a step by step tutorial to upload iweb to domain?

    I just bought a domain through fatcow, I have created a website with iweb. Only problem I have no clue where to start to get from iweb to new domain. Any help much appreciated. Willing to go through a tutorial but can't find anything step by step?

  • IPad originally synced with PC, updates fail when on Mac

    I originally synced and stored my iPad info on a PC, then a few months later I got a MacBook Pro.  I'm running OSX 10.6.8 on Mac, iTunes 10.4.  The problem is that when I attempt to update the IOS on iPad (as I did today), the update fails, then I ha

  • Color depth of the mouse cursor

    Upgraded to srss 4.2 yesterday and discovered the addition of Xrender support. After enabling it the mouse cursor switches to an animated one. This looks really horrendous, since the mousecursor is displayed in black and white (1bit color depth). Doe

  • Can I have 2 libraries in Itunes

    Is it possible to have 2 itunes libraries located on the same computer but with one of the libraries being on a backup device?

  • Weird behaviour due to division - anyone else?

    Hello, I'm making my first app in java. Its a 2D graph that gets its values from a text file. I've got most of it working smoothly but the aspect ratio wasn't working, namely along the horizontal plane. I only have 2 parameters that are set initially