Monday, March 02, 2020

APEX Media Extension (AME) Publicly Available

After two months of beta testing, we have released the first production version of APEX Media Extension v20.1.

I'm extremely proud to bring our second product to the Oracle and APEX community.  With our first product, APEX Office Print (AOP), we wanted to make the Printing and Exporting of documents easy.  With APEX Media Extension (AME) we want to make the processing of media easy for any Oracle database and Oracle APEX developer!

We got the idea of doing this product when Oracle Intermedia/Multimedia became decommissioned in the Oracle database, but we still needed the manipulation of images in our projects. We did research on the best use of existing tools, but it always seemed we couldn't rely on any one tool and we needed different tools and custom code to come to a solution.

In our first release of AME, you will find the following features:
  • resize images
  • rotate and flip images
  • crop images
  • add one or more watermarks or overlays (images and text) to images
  • compress images
  • greyscale images
  • change image formats (jpg, png, ...)
  • get image information (width, height, mime type, ...)
  • read media metadata (Exif, IPTC, and XMP)
Just like with AOP, AME also comes with a FREE plan.

You can get started by downloading the software from the APEX Media Extension (AME) website.
The zip contains a PL/SQL API, an Oracle APEX Plug-in, and an APEX sample application.

Here's a short video which shows you AME in action:


The architecture of AME is very similar to the one of AOP. There's an AME Server that accepts REST requests. On top of the REST API, we've built a user-friendly PL/SQL API.
The APEX Plug-in is a bit different, as this plug-in is an enhancement of the Dropzone plug-in by Daniel Hochleitner. We customized the plug-in so the manipulation of the images is done in the browser before the media is sent to the server.

As we love our AOP customers, we decided to put AME in our upcoming AOP release! So when you upgrade to AOP v20.1 (Gold and Enterprise on-premises licenses), you can use AME too without needing to do a separate install :)

Just like with AOP, we will have a separate AME Roadmap and of course, your voice is important to us! So let us know what you would like to see.

Here's already a quick preview of what we currently have in the pipeline:
  • audio manipulation and metadata info
  • video manipulation and metadata info
  • online photo editor
So what's next?

I will do six blog posts with different use cases of AME, based on real-world examples, so you can see AME in action.

1. In our project for a flight school, we had to automatically create thumbnails and resize images.

2. An auction company wanted to allow people to upload pictures of the goods they want to sell, but every picture needs a watermark and stored on a specific location.

3. The Belgium Tennis Organization wants uniformity in images, so they store the original image and bring them to the same mime type, resolution and compression rate.

4. A photographer wanted to do analysis on his pictures; where it was taken (GPS location), if they used flash, which aperture it was set to etc. This meta data is stored with tags encoded using Exif, IPTC, and XMP.

5. Cavanti is allowing veterinarians to draw the issues a horse has directly on an image. So the final picture is overlain with different images.

6. A hotel in Belgium wanted to grayscale and rotate images

These posts will showcase the features of AME and the power it can bring to your projects. Try out APEX Media Extension (AME), we hope you enjoy it and feel free to let us know what you are searching for!

Sunday, February 16, 2020

Free Oracle Cloud: 19. Oracle APEX upgrades (19.1 to 19.2)

This post is part of a series of blog posts on the Best and Cheapest Oracle APEX hosting: Free Oracle Cloud.


Many people wonder how you can upgrade your Oracle APEX version to the latest version in your cloud account. The short answer is: you can't...

Oracle is doing this for you, whenever they believe it is the right time to do. The idea is that at some point you can tell Oracle when it would be a good time to upgrade your APEX environment in a specified window, but today, that is not there yet.

I read that a few days ago Oracle upgraded the APEX release to 19.2 on the free cloud.

I didn't use my Always FREE Oracle Cloud account for a few weeks, so it was stopped.
I went in the Oracle Cloud console to start it again and up we go.


Through the Tools menu, I open APEX and logged in into my CLOUD workspace. But, to my surprise my APEX version was still 19.1.

I was doing a few things when suddenly I got "Application Express is being upgraded to a newer version":


When trying to open APEX from the console, I couldn't anymore.


I waited a couple of minutes and there it was ... APEX came back and was upgraded to 19.2:



So it looks like Oracle is checking your APEX release when you start your database and when it sees it's an older version, it will just upgrade. I thought that probably because my account was stopped, Oracle will try again in the maintenance window, but my experience learns it's not waiting on that window.

I'm glad Oracle upgraded APEX for me automatically, but it would be nice to have a log somewhere or some info that it will do this. Hopefully, this blog post will help people who only fire up their instance occasionally when doing a demo. It's best to do it a bit before so the upgrade takes place before you need your APEX instance.

Sunday, January 19, 2020

Print PDF from Oracle APEX to Local or Remote Printer

On Twitter, I got a lot of reactions on my previous blog post Printing to local (Zebra) printer from Oracle APEX in the Cloud.


As more people asked the question of how to print to a local printer from Oracle APEX, I will cover 3 options in this post. All options make use of some features of APEX Office Print (AOP).

When you install the AOP Sample Application, you find the examples under the following sections:


1. Call Print Window of the browser directly from a button


Create a button on the page e.g. PDF and add a Dynamic Action to it. The Dynamic Action calls some JavaScript:


This JavaScript calls following AJAX Process, which uses the AOP PL/SQL API to generate a PDF:


When the PDF is produced, the printJS JavaScript function is being called, which opens the browser's print window. The end-user can change the Printer and hit the Print button.
So this option is not a direct print to a predefined printer, but a two-step process: open print window, hit print.

2. Print directly to an IP Printer

One of APEX Office Print's unique features is that the AOP Server can send a document directly to the IP address of a printer. AOP is really smart and if it sees the printer doesn't support native PDF or the document type we send, it will convert to PDF or Postscript, which all printers support.

The only thing you have to do, in order to print directly to an IP Printer is to add some global variables of AOP. In the below example it will send a PDF to the IP Printer on the same server AOP is running but on port 3000.


3. Use of Post-Process command

You can configure the AOP Server with some post-processing commands, which allow you to run some command-line tools before and after the AOP Server is creating the output. This is a really powerful feature and one use case is to send the document directly to a local (or network or remote) printer.


Just like with the IP Printer, you define the post-process command in some global variables of AOP.

This technique I also described in the previous blog post where we printed to a local Zebra printer. The only special thing in that post was that we used ngroc to make AOP known to the Oracle Cloud.
When you have the AOP Server running on-premises, you don't have that step as your APEX app will call the on-premises AOP Server. The only thing you need to make sure is that AOP Server knows the printer you configured in the post-process command.


There you go, three options to print from your Oracle APEX app directly to a local or remote printer using APEX Office Print.

Tuesday, January 14, 2020

Printing to local (Zebra) printer from Oracle APEX in the Cloud

These days Oracle Application Express (APEX) is being used more and more in "local" applications like a bar, a restaurant, a power station, etc. On many occasions, they also have the requirement to print something to a local printer.

As the Always FREE Oracle Cloud is becoming more and more popular and stable, people use that service to host their APEX apps, instead of installing Oracle XE with APEX locally.

In this blog post, I will demonstrate how to print from the Oracle Cloud to a local Zebra printer by using APEX Office Print (AOP).

In my test case, I have a Zebra Printer GK420t connected to my local computer.

It's a 3 step process:

  1. Run APEX Office Print (AOP) on a local pc
  2. Make AOP available to the Oracle Cloud
  3. Use the AOP APEX Plug-in to do the print

1. Run APEX Office Print (AOP) on a local pc

The first thing we do is download the on-premises version of APEX Office Print (AOP) for your Operating System. Unzip the file and go to the server directory and run APEX Office Print.

./APEXOfficePrintOSX64

The first time you run AOP, AOP will create an aop_config.json file, which holds the configuration of AOP. We want to make a small modification to the file to include the local printer name.
So exit AOP again (CTRL-C) and do:

vi aop_config.json


On the last lines, you see post_process_commands, here you define your command to print to your local printer. Note that you can have as many post process commands by comma separating them.

If you want to know which printers are available on your machine, you can do:

lpstat -p | awk '{print $2}'


It will not only show you the local (connected) printers, but also the network printers. You can use any of those with AOP.

That's it! Just run AOP again and you are all set 😀



2. Make AOP available to the Oracle Cloud

Next, we need to make this local AOP server known to the Oracle Cloud. There are different ways of doing this, you could create a domain and point to the IP address of the local machine, but as the Oracle Cloud only accepts HTTPS, you would also need to set up an SSL certificate (e.g. with Letsencrypt). As this is a local machine, there's a high chance that the IP changes, so I looked for another solution which makes it easy to expose a local webserver to the internet.

This is exactly what a tool called ngrok is doing. Ngrok creates a public URL for a local webserver, in our case AOP.

Installation of ngrok, is as simple as installing AOP: download, unzip, run!

Download ngrok, unpack and run the executable:

./ngrok http 8010


It will show you the URL you can use to access your local AOP server, both HTTP and HTTPS.
In the Oracle Cloud, you always want to use the HTTPS connection.

3. Use the AOP APEX Plug-in to do the print

Import the AOP plug-in in your Oracle APEX app and specify the HTTPS URL as the AOP URL in the Component Settings of the Plug-in. Next, create a Dynamic Action and specify the Post Processing Command you want to run:


That's it! Don't think it can be any simpler than that ;)