Posts

Showing posts with the label plugin

Building ORDS plugins

Image
Oracle Request Data Services (ORDS) released version 3 recently. If you didn't notice, this version allows you to develop plugins (with Java) that can be imported into your ORDS instance, and provide extended functionality. You want to refer to the Oracle REST Data Services Plugin API, located here:  http://download.oracle.com/otndocs/java/javadocs/3.0/plugin-api/index.html , which itself includes a couple of nice documents: Getting started guide Developer guide This post just re-iterates a lot of what has already been covered in the getting started guide, with a focus on using IntelliJ IDEA. Setting the project up in IntelliJ IDEA So the first step is to set up a new project. First however, you will want to verify what version of Java you are using on your server (assuming you are developing on a separate workstation). This can be verified with the command java -version. [user@host ~]# java -version java version "1.7.0_79" OpenJDK Runtime Environment (rh...

Logging in without user intervention

For this, I set up an authentication plugin and behind the scenes it's using a web service to check if the client is valid or not. To automate the login process, you need to make use of the sentry function that gets called every time you access a page in the application. This is what the item help says: Enter the name of the PL/SQL function the plug-in can use to perform the session sentry verification. It can reference a function of the anonymous PL/SQL code block, a package function or a stand alone function in the database. For example: check_ldap_session_sentry When referencing a database PL/SQL package or stand alone function, you can use the #OWNER# substitution string to reference the parsing schema of the current application. For example: #OWNER#.check_ldap_session_sentry There is however one caveat with this. It doesn't run on whatever you have defined as the login page (User interface attributes --> Desktop --> Login URL) - which is reasonable enough. ...

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...

Item Plugin Template

This is more a reference on how to create a basic item plugin - just a text field that is exactly the same as Text item type. There is a more detailed guide for those interested on the Oracle Learning Library - http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r40/apexplugins/apexplugins_ll.htm A lot of the values to use in your plugin can be obtained from the t_page_item record, with one exception - the name attribute. For this, you need to use the function get_input_name_for_page_item. The reason for this is that APEX needs to be able to map this input field to an item in session state. This gets the necessary element name (i.e. p_t02) and adds the additional hidden element to the page - p_arg_names. With that in mind, the most basic of plugins (well, render function) - that adds no extra functionality is: function render_file_item( p_item in apex_plugin.t_page_item, p_plugin in apex_plugin.t_plugin, p_value ...

Google Visualization API (Org Chart)

Wanted to have a go at making a family tree, and came across this API. It is worth noting this particular chart doesn't allow you to specify more than one node for the parent, so not exactly perfect for a family tree. See:  http://code.google.com/p/google-visualization-api-issues/issues/detail?id=162 . I believe it worthwhile to read the getting started guide for google visualizations: http://code.google.com/apis/visualization/documentation/using_overview.html and the actual guide for using the organizational chart: http://code.google.com/apis/visualization/documentation/gallery/orgchart.html . Why use this over the charts provided in APEX? For one thing, there is no organizational chart available, to my knowledge. For another, it is not flash ;-) That can only be a good thing! Alright, down to business. Firstly create a table to store the data: CREATE TABLE "PERSON" ( "PERSON_ID" NUMBER NOT NULL ENABLE, "NAME" VARCHAR2(200 BYT...