APEX 5 – Oracle JET Chart integration

Video

Oracle JET is the new Oracle Javascript framework, based on many well establishes JS libraries, bundled together, and added visualisations etc.

I really like the new chart types which adds a lot of control to developers and also gives the end-users some eye candy (see the movie).

I wanted to include these charts in an APEX 5 project, so in this first POC I did the following:

  • Downloaded the Oracle JET Demo which included relevant JS libs and CSS
  • Copied the Oracle JET directory to my webserver
  • Created a region type plugin to render the chart
  • Included the relevant CSS and JS files in the plugin
  • Added HTML code and onload javascript code in the plugin (ex. http://www.oracle.com/webfolder/technetwork/jet/uiComponents-barChart-default.html)
  • Changed toolbar images to use icons from the Font Awesome library

My initial version of the plugin looks like this now:

 

The next step will be to implement:

  • AJAX Data fetch
  • Handling of refresh events (Dynamic Actions)
  • Parameters to control toolbar and other Oracle JET Chart options

Oracle JET Charts will (as far as I can read) be available in APEX 5.1. I am looking forward to this, because these charts seems to have a lot of potential.

Will post more when I progress further with this plugin.

ODTUG Kscope 15 – Lessons learned I

Safely returned to Denmark after a great ODTUG Kscope 15 experience with lots of fantastically talented APEX entusiasts from around the world.

Kscope 2015

We (my college Tine and myself) basically attended all the APEX sessions we could during the conference. I will try to sum up the essence of what we leaned in a number of blogs which will be published over the next week or two.

APEX Episode 5:  A New Frontier

Joel Kallman held a great and very motivating session where he smashed the myth that APEX cannot be used for enterprise grade application development.  See more under #letswreckthistogether. Joel referred to a great quote from Billy Verreynne:

What does any business application deal with? DATA! That is the core. That is what drives the business. Applications come and go. Data is forever. Where does the data live? In the database. The database is the core. The database has been that since the 80’s. Is still that. Focus on the core. Design for the core. Leverage the core.

Having established that, where and what and how is the best way to deal with the data? INSIDE the database. Not in Java Beans. Not outside the database where you have to re-invent the wheel ito concurrency controls and caching and all that. What the hell for!? Can a bunch of Java Beans provide better caching and concurrency than Oracle? Of course not!

Thus the fastest and most optimal way to deal with DATA, the core of the bussiness, residing in your Oracle Data Server, is using PL/SQL

You can read the whole conversation here: https://community.oracle.com/message/885538

Joel actually has a very good answer to this:

Billy,

1) You will be called a dinosaur for such archaic thinking.
2) You rule.

Joel

It is great that there is a movement for spreading this important message so we can have more APEX applications in the world🙂.

Interstellar: The Universal

Shakeeb Rahman from the Oracle APEX development team walked through the new universal theme (42), and talked about the conversion from existing themes, and how to use the Theme Roller.

When converting from other themes (Theme 24, 25, and 26), a migration guide is available here : apex.oracle.com/ut

Under the migration guide, a Bookmarklet is available to assist when mapping templates. This bookmarklet is a piece of Javascript code which can be used during the migration. To install this, please follow the above link and navigate to the “Bookmarklet” under the “Migration Guide”. To install the bookmarklet, drag the bookmark into your bookmarks bar.

Stepping through the migration, it looks like this:

2015-07-12 02.28.53 pm

 

Note the selection of “Reset Grid” and “Match template classes”. The match is set to “No” because this will be done by the bookmarklet.

2015-07-12 02.37.54 pm

See more details here : https://apex.oracle.com/pls/apex/f?p=42:2000:::NO:RP::#

Theme Roller

Shakeeb also demonstrated how easy it is to use the Theme Roller. The way to work with UI customisation has drastically changed in APEX 5. Where in earlier versions we were creating new CSS content in order to customize, now this is all done visually using the Theme Roller:

2015-07-12 02.41.08 pm

Once the desired colours has been set using the colour wheel, the new Style can be saved. To make this new style permanent, this should be set in the “User Interface” setup in APEX:

2015-07-12 02.42.16 pm

Next blog in a few days…

Enjoy

Martin B. Nielsen

 

APEX 4.2 Sneak preview – Mixing user interfaces

Playing around with the APEX version 4.2 (pre-production) on apex.oracle.com, I noticed that the sample application can switch between a web and mobile user interface (using the “mobile” navigation item:

Looking at the link to the mobile version of the application, it links to a page in the same application (as the web version). In this case, the “HOME_JQM_SMARTPHONE” page. This means it is possible to mix several User Interfaces in the same application. For now, the possible interfaces are “Desktop” and “jQuery Mobile Smartphone”.

The setup is done under Application Properties, in the new User Interface tab.

The result is a mix of desktop and mobile pages in the application:

The application can even be set up to “auto detect” the device which connects to the application.

The new concept of “Global pages” (instead og page zero), now allows us to create a global page per user interface (one for Desktop and one for the Smartphone).

Nice and very useful functionality for the APEX 4.2 developers I am sure there are developers out there who will want to separate the desktop and mobile into 2 application, but to have the freedom of mixing will allow us to deliver a complete application (in one packaged .sql file).

I cant wait until the 4.2 version is released !.

Dear customers, please call us and order lots of new desktop/mobile applications🙂

 

 

APEX Best Practices

When building many APEX applications, it is good to think about some best practices concerning as you go along.

APEX is so easy to get started with, that many developers just start an application, as a prototype, and gradually this application is adapted by the end users, and “glides” into a production state. Thinking about at few simple guidelines during the development phase, can really help make the maintenance/enhancement phase a lot easier.

I have divided the best practices into 3 areas: Installation, Pre-development and Development. Many of the practices are learnings from APEX books, seminars, and experience from many APEX projects.

Installation

The APEX installation is fairly simple, however here are a few tips:

  • Install APEX in its own tablespace (I always install APEX objects in a tablespace called “APEX”). This way the APEX objects can be backup up separately if needed, and it is easier to control the growth.
  • The same goes for tablespaces for your APEX projects. I create 1 tablespace per APEX workspace (before reating the workspace). The database schema for the workspace should be created like “CREATE USER APP1 DEFAULT TABLESPACE APP1”. After creating the database user, create the workspace (based on the existing user).
  • Concerning choice of web server, the new APEX listener is really great for serving the dynamic APEX content from the database. However running the listener in “stand alone” mode should only be used when developing -not in production. I have seen that rendering static files in the standalone mode is not optimal.
  • Concerning your own (custom) static files, it is best to keep these in a separate directory on the server. Remember that when APEX is updated, the APEX image catalog will be replaced with files from the new installation.

Pre-Development

When starting APEX development, the following advice is good to remember:

  • Create seperate user accounts for the developers. At some point it could be necessary to see who changed what.
  • Setup “User Interface Defaults”. This setup is performed on table/column level, and is only necessary to do once. Setup as much as you can : Prompts, Help text, lengths, item types etc. These values are used when creating new components (regions, fields..) using the APEX wizards.
  • Determine the strategy for re-use. If the application components (List of values, templates…) can be re-used in other applications, you should consider created a “master” application containing re-usable components. The new application should then “subscribe” to the components in the master application.
  • Determine which theme to use. If all applications used in the company should have the same look and feel, consider setting up a company specific theme. Select one of the standard APEX themes, and modify this to your company needs.
  • Design the data and process model. The SQL Developer tool from Oracle includes the “Datamodeller” which can be a great help in creating these models. For larger applications, consider integrating the model with the APEX application. This can be achieved by exporting the model from SQL developer (into a “Reporting schema”).
  • Decide the security model for your application. A number of Authorization schemes should be created, and can then be used when creating new tabs, pages and other APEX components.
  • Decide the strategy for deployment between environments (dev/test/prod). Basically the APEX application (and database objects) can be deployed manually (using the standard DDL files, program files and APEX .sql file), or “packed” into a single .sql using “Supporting Objects”. The build in supporting objects is most useful, when the same application should be deployed on multiple environments (ex. when selling the application to multiple customers). If manuel deployment is chosen, consider creating a install.sql file which created database objects, and deploys PL/SQL program modules etc.
  • Set up version control. This is always a point asked by new users, since APEX version control differs from many other development environments. Know this: APEX has build in tracking (and reports) to show which developer changed what at wha time. The standard file artifact from APEX is a single .sql file containing the complete application. This singe file can be saved in a standard version control system (CVS, SVN…) however is can not really be used to show the application changes (its just a bunch of PL/SQL calls which builds the application). Consider using the APEXReportSplitter if there is a need to store and track  each APEX component in a file based versioning system.

Development

During the development phase, these tips can make life easier:

  • Place all PL/SQL logic in database packages. This way it is much easier to maintain the code, and use IDE’s which are best at coding in PL/SQL. Another benefit is that the stored PL/SQL program units can be re-used by other programs. It means keeping the presentation logic seperate from controlling and domain logic (MVC pattern). Note that SQL Developer has a tool for migrating PL/SQL code in APEX to packages.
  • Plugins can be downloaded from several sites, and used in the APEX application. This is a great way to improve the look and feel of the application without spending a lot of development time. The sites are APEX-plugin.com and the Oracle plugin repository.
  • When find yourself creating the same components several times, consider building your own plugins. Company wide plugins are highly efficient for keeping the same look and feel, and then the code has en single place of maintenance. When creating these enterprise plugins, the PL/SQL code behing the plugin can be placed in database packages (in a common database schema). So even if the plugin instance is loaded into many applications, the code behind the plugin can be maintained in one place (per database).
  • Page Zero: Another way to re-use with the application, is to place components on Page Zero. You can use the “Condition” to specify which page(s) the component should be displayed on.
  • Use Dynamic Actions instead of home made javascript. Dynamic Actions are declarative, which means other programmers can see that the logic exists on the page (instead of having this hidden as custom javascript on the page).
  • If you do resort to custom Javascript, consider using JQuery, so there is a better change of cross browser compatibility.
  • One of the greatest advantages in APEX is the Interactive Reports (IR). Use this whenever you can, because it works great for the in-experienced user, and at the same time gives great reporting capability to the more advanced end users. However take care concerning the query behind the report. Especially function calls in the column list can really drain the CPU.
  • Aliases: Use aliases for applications and for the pages which are linked directly by users. The application and page id can change, so a link containing aliases are better.

More on best practices (in Danish) here.

Happy APEX Developing, and let me know what should be added to the list🙂

Martin B. Nielsen

MBNDATA Søger APEX Specialister

Vi mærker en stigende efterspørgsel på rigtig dygtige APEX folk, som har været i dybden med produktet.

Derfor søger vi løbende nye medarbejdere/freelance partnere, med følgende skills:

  • Oracle Application Express (APEX)
  • SQL
  • PL/SQL
  • HTML, CSS, Javascript, jQuery

Hvis du er interesseret i at arbejde med os, send venligst dit CV til Martin Nielsen, eller kontakt os på telefon 40 98 96 37.

MBNDATA flytter til ny adresse

MBNDATA er flyttet i nye lokaler!

Med udsigt over Holbæk Fjord, samt til Orø og Hørby Færgekro med lystbådehavn – har MBNDATA  fået nye og større lokaler at boltre sig i. MBNDATA’s Salgs- og Marketingafdeling vil herfra yde vore kunder og samarbejdspartnere den perfekte service i nye omgivelser.

Har du/ I spørgsmål der vedrører jeres eksisterende it-løsning, eller står I og skal investere i ny – så kontakt endelig vores salgs- og martingansvarlig, Peter Klug på mobil +45 2623 2676, eller mail: peter@mbndata.dk . Vi tilbyder, ganske uforpligtende, at lave en mindre it-løsning – baseret på interne data. Fremsend dette og vi udarbejder Jeres nye og fremtidssikrede it-løsning.

Vores nye er adresse er:
MBNDATA
Østerled 28A
4300 Holbæk

Vi glæder os til at høre fra jer!

Hilsen

MBNDATA