Translate

Donnerstag, 4. Januar 2018

maintenance information for application down-time

Environment APEX 5.1 (but will work for older versions as well)

In reply to APEX community forum question 

"show a different page for maintenance purposes"

I like to explain my maintenance solution.

I created a "maintenance Info"-Region on the Login page, which is shown during maintenance time (and the app/server is not down) and can be maintained by the Admin/developer without using APEX Developer but from the UI itself.

I experienced, that "system parameters" are quite useful, if the Admin can change them without using the APEX Developer.

6 Steps and you are set:

1. create a table named SYSTEM_PARAMETERS for the SYSTEM_PARAMETERS with a structure like:

ID, name(varchar 50), active (varchar 10 for: yes/no), from (datetime), to (datetime), Info_text_for_users (varchar 500), remarks (varchar 500)

2. create two pages with type form and report to maintain the data

3. On the Login-page 101 create a new region called: "maintenance_region"

4. for the region "maintenance region" create a "server-side-conditon of type "Rows returned" and SQL:

select 1 from SYSTEM_PARAMETERS
WHERE id = '1' --- maintenance works
and active  = 'Yes'

So, when there is a maintenance period switch your system parameter to YES and this region is shown.

5. For the existing "Login_region" create the same as above, but ofcourse set 

... and active = 'No'

6. create a field  P101_INFO_TEXT_FOR_USERS in the "maintenance_region" with type text and 
Source: "Sql Query rerturing single row"  with 
SQL:
select text from SYSTEM_PARAMETERS where id = '1'

In addition (optionally) it proofs well to have "General Info" (like News) region on page No. 1 of the application for announcements such as maintenance and other news. A few days before maintenance starts, I usually do announce that. This region can be maintained by the Admins as well and will work similar as the above (table with text/content and valid from/to columns).

Now, as maintenance is carried out (and the application actually is not down), the Admin excluded himself from the application, as the Login region with username/password is not shown anymore...
Workaround: copy page 101 to 102 (before you do the above 6 steps) and when you like to enter (e.g. for testing) your app, you can use page 102 by manipulating the login_url.

Hope that finds your interest.