Forum Stats

  • 3,741,232 Users
  • 2,248,397 Discussions
  • 7,861,693 Comments

Discussions

WWV_FLOWS.FLOW_STATUS & FLOW_UNAVAILABLE_TEXT

22054
22054 Member Posts: 39
edited Oct 15, 2004 4:40PM in APEX Discussions
We need to be able to be able to block all access to our htmldb application on pre-determined days each month. We want to set the values in WWV_FLOWS.FLOW_STATUS and FLOW_UNAVAILABLE_TEXT programmatically. However, it appears that if the values are modified outside the htmldb application builder, the triggers on that table would make our application lose its security_group_id rendering it inaccessible to developers in the application builder.
I was hoping to write a pl/sql procedure in our application schema that would query values from a table periodically to set the flow status and unavailable text. Are there additional API calls I need to include in that pl/sql procedure to setup the htmldb global variables needed to retain the security_group_id?

Comments

  • 60437
    60437 Member Posts: 16,564
    Richard,

    Blocks like the following will do it:
      begin
    --
    -- set status unavailable with message
    --
    wwv_flow_api.set_security_group_id(p_security_group_id=>99999999999999);
    wwv_flow_api.set_flow_status (p_flow_id =>102,p_flow_status => 'UNAVAILABLE',p_flow_status_message => 'Application is unavailable until Monday.');
    commit;
    end;
    /

    begin
    --
    -- set status available again
    --
    wwv_flow_api.set_security_group_id(p_security_group_id=>99999999999999);
    wwv_flow_api.set_flow_status (p_flow_id =>102,p_flow_status => 'AVAILABLE_W_EDIT_LINK');
    commit;
    end;
    /
    Plug in the correct application ID, of course. You need the set_security_group_id call only if you run this from a job or SQL*Plus, or anywhere other than from within an application running in the same workspace as the application whose status you want to change. If it is not run from within such an application context, it must run in a schema associated with the workspace. You can copy the set_security_group_id call from an application export file, around line 14. Use the Application Builder to set up any associated values that go with the application status of your choosing, but be aware that you must set the status to one of the following: AVAILABLE, AVAILABLE_W_EDIT_LINK, DEVELOPERS_ONLY, RESTRICTED_ACCESS, UNAVAILABLE, UNAVAILABLE_PLSQL, UNAVAILABLE_URL.

    Scott
  • 22054
    22054 Member Posts: 39
    Thanks for the api pointer, Scott. I haven't had time to look at the 1.5.1 patch yet, does it include more api documentation than the 1.5.0 initial release?
This discussion has been closed.