Enable HTTPS for your APEX website

Category APEX / 24-JAN-17 24 Jan 2017 by Jeff Eberhard

For years I've known about the security risks of building and serving APEX application over just plain HTTP.  My reasons for not doing so? Cost and Complexity.

Last year those reasons became obsolete by the service provided by Let's Encrypt. Dimitri introduced the use of HTTPS for your APEX apps last spring and I finally got around to updating my website(s) to use HTTPS.

The following are basically my notes for enabling HTTPS in my environment.  I have a droplet on DigitalOcean that is running centOS 6.7.   This comes with shell access so according to the Let's Encrypt site I can use the Certbot ACME client.  I visited the Certbot site and selected the software (Apache) and system (CentOS 6) for my system.

This gave me the commands I needed to install certbot. I logged into my server (as root) and ran the following commands as directed:

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

I then executed certbot-auto which presents various dialog screens to step you through the process of obtaining and activating the certificates.

$ ./certbot-auto

Certbot was downloaded to a directory that was not included in my path, so I moved it.

$ mv certbot-auto /usr/local/sbin/certbot-auto

Also certbot didn't see all the sites I had configured (I forget why) I had to specify the site name(s) when I ran certbot wizard. 

$ certbot-auto --apache -d eberapp.com -d www.eberapp.com

Certbot took care of creating the virtual hosts configuration files to redirect HTTP traffic to HTTPS and all the certificate settings.

 

New Year, New Adventure

Category APEX / 05-JAN-15 5 Jan 2015 by Jeff Eberhard

As Joel Kallman has announced here, 2015 is going to be a great and exciting year for Oracle APEX.  I’m also enthused about this upcoming year.  I am beginning this year by joining the fine folks at Insum Solutions (insum.ca).

‚Äč

"Insum is a highly creative solution center specialized in Oracle Database, developing innovative applications for clients and partners in North America. Founded in 2002, Insum has been assisting customers realize the full benefits of Oracle Database with Application Express since 2005. In fact, Insum is a pioneer with APEX and is today the largest consultancy specialized in Oracle APEX developments in North America. Privately held with offices in Montreal, Canada and South Burlington, USA, Insum has the most complete and experienced staff to serve the needs for complex application development and deployments in a wide range of industries. Come discover our unique APEX center of excellence"

For me, joining Insum Solutions will allow me to have more opportunities to use my APEX skills and share that APEX knowledge with others.  Indeed, 2015 is starting out with excitement and I can’t wait to see what happens.

Show Success Message with Dynamic Action

Category APEX / 30-DEC-14 30 Dec 2014 by Jeff Eberhard

This post  will describe one method to show a Success Message from a Dynamic Action.  A common scenario for an APEX page is to have a button that will submit the page, and have a page process perform some PL/SQL which includes a message defined in the "Process Success Message" that is displayed when the page is re-rendered.

To avoid the page submission and re-rendering we may want to perform the PL/SQL by using Dynamic Actions.  Although we can perform the PL/SQL using an "Execute PL/SQL Code" dynamic action, the dynamic action definition does not include an option for defining a "Process Success Message".  

In the example ( demo ) we have a page that contains a report and a button.  Each time the button is pressed some PL/SQL code will be run to add a record to the table referenced in the report.

We could simply add an alert action to our dynamic action to give a browser message to the user but for this example we want to mimic the APEX success message.  The success message displayed on the paged varies from theme to theme and is dependent on the page template we use for a page.

This example will use the "One Level Tabs - No Sidebar" template from the standard APEX Theme "26. Productivity Applications".    Looking at the page template we see the #SUCCESS_MESSAGE# substitution string is located after the #REGION_POSITION_01# substitution string and a little bit before the "uOneCol" div element.  Looking further down the template definition, in the Subtemplate group of items, is the "Success Message" template definition.

Copy the code from the Success Message field to be used later.

Create a Dynamic Action that will be executed when we click a button.

Create a "Execute PL/SQL Code" true action that will perform the desired PL/SQL.

Next create a "Refresh" true action that will reload the report dynamically on the page.

Finally create an "Execute JavaScript Code" true action that will show our success message.

Add the following code to the true action:

var messageHtml = '';

messageHtml = '<section class="uRegion uWhiteRegion uMessageRegion clearfix" ';
messageHtml += ' id="uSuccessMessage">';
messageHtml += '  <div class="uRegionContent clearfix">';
messageHtml += '    <a href="javascript:void(0)" ';
messageHtml += '      onclick="$x_Remove(\'uSuccessMessage\')" ';
messageHtml += '      class="uCloseMessage"></a>';
messageHtml += '    <img src="/i/f_spacer.gif" class="uCheckmarkIcon" alt="" />';
messageHtml += '    <div class="uMessageText">';
messageHtml += '      New Message Record has been Added.';
messageHtml += '    </div>';
messageHtml += '  </div>';
messageHtml += '</section>';

$("#uOneCol").after(messageHtml);

 

The code defines a javaScript variable and then the code from the page template is added to the variable.  A few modifications are made to the code that was copied from the page template.

  1. Replace the #IMAGE_PREFIX# substitution string with the image prefix on your installation.
  2. Add a backslash (\) in front of the single quotes to escape them.
  3. Replace the #SUCESS_MESSAGE# with the actual message you want to be displayed.

The last line uses some jQuery code to add the code in the messageHtml variable to the page before the "uOneCol" div.

 

 

 

1 2 3 4 5 6 7 8 9 10 Next Set

Search

Archives

Categories

Subscribe in a Reader

RSS

revolverMap