Posts

Showing posts from June, 2012

Two Apex 4.2 Noteworthy APIs

Well, yesterday oracle released the first early adopter of application express, having had a chance to have a little play around, these are the ones that caught my attention: APEX_IR See:  http://apex.oracle.com/pls/apex/f?p=38997:1:0::NO:RP,1:P1_MARQUEE_FEATURE:Interactive%20Report%20Enhancements There are currently some interactive reports utility functions/procedures as part of the apex_util package. These will now be deprecated, and functionality will be added to a package named APEX_IR. The most exciting addition is the ability to get the derived IR query (from added filters/sorts). Without any published API docs, I can only assume this is through the function get_report. Further, I set up an example on page 2 of the sample database application. Created a new popup page with a dynamic region with the following source: declare l_report apex_ir.t_report; begin l_report := apex_ir.get_report( p_region_id => 6506762112827941367, p_page_id => 2);

Enhancing gedit for PL/SQL Development

Most text editors allow customisation of syntax highlighting and the like, and having recently moved to using gedit, thought i'd enhance it a bit. In a fresh installation, it already has reasonable support for oracle based keywords, but could do with a bit of an update. The object that does the syntax highlighting is gtksourceview - depending on the version of gedit, either version 2 or 3.  By going to the project page on gnome, you will see the howto for adding a new language:  https://live.gnome.org/Gedit/NewLanguage . (Linux only) Since package source code is typically in files with the extension pks and pkb, it is first necessary to update the system to recognise that those files are of the mime type text/x-sql (or a custom one if you really want). So, create an xml file with the following: <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="text/x-sql"> <comment>SQL Source including P

Saving Files Client Side

A couple of html5 interfaces that allow you to download files from the client side are: FileSaver BlobBuilder These haven't quite made it into the browsers, but there are projects on GitHub for both of these interfaces, whilst we wait for them to become main stream. The basic examples on the FileSaver project README are saving both a text file based on an input string, and saving a canvas as an image file (you can already redirect the user to the data url of the canvas object, but this would actually download the file). See:  https://github.com/eligrey/FileSaver.js  and  https://github.com/eligrey/BlobBuilder.js . Anyways, i'll give a little focus on saving a file.  I have a basic page with a text field to be used as the file name (:P20_FILE_NAME) and a text area with the data that I want to save to a file (:P20_EXPORT_CONTENT). First I need to add a reference to the two interfaces (I just added these into the page header - obviously better to import these files into

Error Handling API

Originally heard about this from Patrick's blog months back. See  http://www.inside-oracle-apex.com/apex-4-1-error-handling-improvements-part-1/  and  http://www.inside-oracle-apex.com/apex-4-1-error-handling-improvements-part-2/ . Then a couple of weeks back I was looking at the new features on the Apex builder guide, where they mention about the enhanced error handling. See  http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/what_new.htm#CEGIEDHE . So I thought I may as well set up a basic example to see how it is. The only sections in the documentation that really talk about it are: Application Definition Page Definition Which is basically about setting the error handling (PL/SQL) function. The main source of information is on the API docs for apex_error . This page talks about data types, and available functions/procedures you can use with this package, which will allow customising the displayed error message. Whilst the API docs do provide a good example, I ju

Oracle HTTPS Requests: Set up the Wallet

In addition to setting up the ACL, if you wish to make HTTPS requests you will need to set up a wallet - and more than likely, import trusted certificates. On the oracle server, open the wallet manager. In linux this is with the command: owm. Assuming no current wallet exists, create a new one by going to File --> New. At this point you will need to give the wallet a password. Save the wallet and take note of the directory it installed to (this is what you need to pass to utl_http, and no single file). The default directory this is saved to is generally: $ORACLE_HOME/owm/wallets/oracle. The next step is to import trusted certificates into the wallet. The process varies between OS/Browser. First, go to the website you are intending on making requests to and view the certificate information which is normally done by clicking a button in the address bar. Linux Chrome: Click the button the left of the URL Click certificate information Click Details Click Export Specify t