Monthly Archives: February 2011

Usage of the confirm/confirmDelete JavaScript. How to generate the question text dynamically

This article describes the way you can use the confirm/confirmDelete JavaScript routine (confirm for versions after Apex 4.0 and confirmDelete for versions until Apex 4.0), which is defined in the standard APEX JavaScript library, so it can be used in the applications that the users develop and use, the way that this routine calls the process execution and the way it's value can be set dynamically.

 You have probably noticed the fact that after you create a form on a table or a view or a form on a table with report, with the page create wizard, with the delete operation included, the Delete button's target is an URL with the following value:

javascript:apex.confirm (htmldb_delete_message,'DELETE');

or

javascript:confirmDelete (htmldb_delete_message,'DELETE');

depending on the Apex version you use.

Continue reading

All ninjas are welcome: Publish on ApexNinjas.com!

We have just done finishing the authorization for the ApexNinjas.com blog administration! This means that all APEX ninjas that want to publish on our site are more than welcome! Want to be part of a solid and enthusiastic APEX collective?

Just email us at apexninjas@gmail.com and we will email you back with an user name and password. All contributors will be able to create their own articles and comments, moderate and manage all comments from their posts, upload and manage their own images, change author description and so on.

Debugging "ORA-06550 Duplicate column name" error

Just trying to modify our blog user table, to fit the requirements for guest users, who could just publish articles on apexninjas.com and don't have access to all the tabs… So, added a new column and suddenly the "Create user" page gives me a "ORA-06550 Duplicate column name" error on submit (ORA-06550: line 1, column 139: PL/SQL: ORA-00957: duplicate column name ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored).

How to debug this error. Execute the following query:

Continue reading

How to add help to Apex pages

This article describes the way help can be added to APEX pages. This is very important to inform the users of the application about the functionalities that are available in each of the pages.

 When editing the page attributes, a user can fill in the page help. This is done in the "Page" part of the page:

The text has to be written in HTML code, for example (for a page containing all the available articles in the blog):

<br>

<table bgcolor="#CCCCCC" width="100%"><tr><td><b>Articles

</b></td></tr></table>

<br>

<b>Articles</b> is the page that displays all the articles that are available for the blog users.

<br><hr>

  Continue reading

Apex Authentication issues. Building your own APEX authentication scheme.

This article describes some considerations about how APEX authentication works and describes a possible way of building your own authentication politics.

When you create a new APEX application, along with the pages that you add in the application creation process, APEX automatically creates a login page with the number 101. Also in the application creation process the user can chose one of the three options: Application Express, No authentication and Database account. It is not really that important the choice, as it can be modified afterwards at any point, and for example the Application Express scheme can be basically modified to act just like any of the other two.

Continue reading

Developing and publishing APEX multilanguage apps

I started looking into developing APEX multilanguage applications a while ago. Although the premises looked good (APEX has globalization features and allows publishing an application in multiple language), the case at that time, which involved publishing a bi-lingual application in a runtime environment proved to have major faults. Still, this whitepaper describes the complete process or developing and publishing an APEX multilanguage application.

The main unanswered question remains: is there a way to publish multilanguage applications in an APEX runtime environment, where each deploy is done by running sql scripts with no Application Builder access? Anxiously waiting for an answer for 2 years!

Download the whitepaper from here.

Apex Authorization issues. Building APEX authorization schemes and use authorization in Apex objects

 This article describes some considerations about how APEX authorization works and describes ways of building authorization schemes and applying the defined authorization schemes to pages or objects within a page.

After creating an APEX application, if the application is accessed by multiple users that have multiple roles or rights and you want to find a way to limit their access to the pages and objects that they are allowed to view then authorization schemes are the answer. You can limit the users' access to pages, tabs, lists or pretty much any object within the regions of the page.

Continue reading

Setup APEX PDF report printing with OC4J

APEX allows two versions of printing server configurations: standard, using a print server of your choice, or advanced, that requires BI Publisher. ApexNinjas.com gives you a simple and robust solution: APEX PDF printing using OC4J as a print server (on Linux Centos with Oracle XE).

Step 1. Install OC4J server

Install the OC4J server as described here in detail. Start the server as a service or daemon.

Step 2. Configure OC4J with APEX-FOP

Access OC4J Application Server control from http://yourserver:8888 (ex.: http://www.apexninjas.com:8888). Login with oc4jadmin and the password provided in step 1.

Continue reading

Oracle context issues in APEX. Solving user overlapping problem

As it is well known, contexts offer a great possibility for a user to apply fine-grained access control, as the applications can be associated with different function-based security policies. Application contexts allow flexible, parameter-based access control using attributes of interest to an application.

Therefore, contexts are important if a developer wants to base predicates on context values, set and access user attributes, use context values within attributes as bind values.

Being ORACLE objects, the contexts can be used in APEX as well. If you have a view that filters the records based on a context, you can display the query results if in the APEX page that queries the view you set the context first, with a value that you ask.

This article describes the way contexts work in APEX and the way they should be used in a multi-user application and how the user overlapping issues can be solved.

Continue reading

Start Java program as Linux daemon

Use this script to run Java programs as daemons (services) on Linux Centos (or other Red Hat releases). This script originates from a script use to do the same thing in Linux Suse and was adapted for Centos by Joshua Davis. Save the code below in a sh file (Ex.: daemon.sh), set the variables at the beginning of the script. To start/stop the daemon using daemon.sh, just use:

./daemon.sh start

./daemon.sh stop

./daemon.sh status

Continue reading