Tuesday, June 22, 2010

Customize APEX Admin Login Page

How often you log on to the wrong APEX workspace and do something you're not supposed to do for that workspace? I make this careless mistake a couple of time and the result is catastrophic. The root cause (obviously) is that I did not pay enough attention to the URL, but I also blamed (sort of an excuse) that the Admin Login Page looks exactly the same for all APEX instances.

In order to prevent it from happening again, I modified the Admin Login Page so that it shows some instance information in eye-catching way. In addition the workspace becomes a dropdown list so that I don't have to type in the name anymore.

The changes are very simple, and it's very easy to rollback, in case you screw it up.

Here is an result of the changes:


SQL for the changes

-- Add a name in the login box

-- login as system and change schema to APEX owner
connect / as sysdba
alter session set current_schema = APEX_030200;

-- Change the plug header with your choice in HTML code

UPDATE WWV_FLOW_PAGE_PLUGS 
   SET PLUG_COMMENT = PLUG_HEADER   
     , PLUG_HEADER  = '

PRODUCTION

' WHERE FLOW_ID = 4550 AND PAGE_ID = 1 AND PLUG_DISPLAY_SEQUENCE = 20; -- If you have applied translation UPDATE WWV_FLOW_PAGE_PLUGS SET PLUG_COMMENT = PLUG_HEADER , PLUG_HEADER = '

PRODUCTION

' WHERE FLOW_ID LIKE '455%' AND PAGE_ID LIKE '1.%' AND PLUG_DISPLAY_SEQUENCE = 20; -- To rollback to the original value UPDATE WWV_FLOW_PAGE_PLUGS SET PLUG_HEADER = PLUG_COMMENT , PLUG_COMMENT = NULL WHERE FLOW_ID = 4550 AND PAGE_ID = 1 AND PLUG_DISPLAY_SEQUENCE = 20; UPDATE WWV_FLOW_PAGE_PLUGS SET PLUG_HEADER = PLUG_COMMENT , PLUG_COMMENT = NULL WHERE FLOW_ID = LIKE '455%' AND PAGE_ID = LIKE '1.%' AND PLUG_DISPLAY_SEQUENCE = 20; -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Change Workspace as dropdown list UPDATE WWV_FLOW_STEP_ITEMS set DISPLAY_AS = 'COMBOBOX' , LOV = 'select short_name NAME, short_name from ' || 'wwv_flow_companies where ID NOT IN (0,3)' , LOV_DISPLAY_NULL = 'YES' , LOV_NULL_TEXT = '-- Select One --' WHERE FLOW_ID = 4550 AND NAME = 'F4550_P1_COMPANY'; -- To rollback to original value UPDATE WWV_FLOW_STEP_ITEMS set DISPLAY_AS = 'TEXT' , LOV = NULL , LOV_DISPLAY_NULL = 'NO' , LOV_NULL_TEXT = NULL WHERE FLOW_ID = 4550 AND NAME = 'F4550_P1_COMPANY';

No comments :