Minor refactor AOP_pu_params

Modified   database/LOGGER/Packages/aop_processor.pkb
--MOD FUNCTION AOP_pu_params - refactor existing recognition of "name in out type" with sub-expr
AOP_pu_params now searches for %ROWTYPE and %TYPE params

Modified   database/LOGGER/Packages/aop_processor.pkb
--NEW TYPE param_list_typ - used instead of the l_inject_params CLOB.
--MOD FUNCTION NOW PROCEDURE AOP_pu_params  (embedded PROCEDURE store_var_def)
-- Searches 'LOOKING FOR ATOMIC VARS', 'LOOKING FOR ROWTYPE VARS', 'LOOKING FOR TAB COL TYPE VARS'
--Uses store_var_def to compile 2 lists, IN in params and OUT in VARS
--RETURNS io_param_list AND io_var_list
--MOD PROCEDURE AOP_is_as passes empty param_list to AOP_pu_params and then onto AOP_pu_block
--MOD PROCEDURE AOP_pu_block - now takes io_param_list and inject individual params from the list
Modified   database/LOGGER/UnitTest/aop_test.pkb
--New tests.
Removing extra lines from Injection.

Modified   apex/f104/application/pages/page_00023.sql
--DEL 'P23_ORIG_TEXT','P23_AOP_TEXT' - not used.
--FIX beforeBranchtoQuickAOPUploadOrigTextToRawInput - set display values to NULL.
--2 other DA's set to never - remaining issues may require change to NAVBAR.
Modified   database/LOGGER/Packages/aop_processor.pkb
--MOD procedure splice - removing extra NLs when injecting consecutive params.
--MOD PROCEDURE AOP_pu_block - format param lines with RPAD
Modified   database/LOGGER/UnitTest/aop_test.pkb
Ensuring we can start a process passing a report_id and then retrieve the results from forms with that report_id.

Modified   database/LOGGER/Packages/ms_logger.pkb
Modified   database/LOGGER/Packages/ms_logger.pks
--MOD FUNCTION f_process_id - added params i_process_id IN INTEGER  DEFAULT NULL
                                          ,i_ext_ref    IN VARCHAR2 DEFAULT NULL
--  now checks for existance of i_process_id or for process_id of i_ext_ref or returns g_process_id
--MOD PROCEDURE log_process - now takes i_origin instead of i_module_name and i_unit_name.
--REMOVED Register operations - unused.
--REPLACE proc new_process with FUNCTION new_process
--The function returns a value for process_id.  Importantly it can be added to a prog unit header above the l_node, to ensure the process is started before the node is created.  The call can be used to add an ext_ref as below.
--    l_process_id      INTEGER := ms_logger.new_process('PB','report',:p_report_run_id);
--    l_node ms_logger.node_typ := ms_logger.new_func('PB' ,'beforepform');
Modified   database/LOGGER/Packages/ms_api.pkb
Modified   database/LOGGER/Packages/ms_api.pks
--NEW FUNCTION get_trace_URL - uses f_process_id's new params
Ensure trace file link only when a process has created a traversal.

Modified   apex/f104/application/pages/page_00008.sql
--Redo the Saved reports, adding Highlight for "Info ?"
--Now have "Primary", "Exceptions", "Messages", "Params and Notes"
--New DA HideControlPanel js toggles ControlPanel off.
Modified   apex/f104/application/pages/page_00024.sql
--Recopied IR from p8, use "Messages" as the default.
--New DA HideControlPanel js toggles ControlPanel off.
Modified   database/LOGGER/Packages/aop_processor.pkb
--FIX PROCEDURE AOP_block - bind variables do not need to be recognised in var list.
--MOD PROCEDURE AOP_prog_units
--BEFOREPFORM signifies beginning of report. Create a new process before the node
Modified   database/LOGGER/Packages/ms_api.pkb
--MOD FUNCTION get_trace_URL
              ,get_user_feedback_URL
              ,get_user_feedback_anchor
              ,get_support_feedback_anchor
-- no URL if not traced.  uses ms_logger.f_process_traced
Modified   database/LOGGER/Packages/ms_logger.pkb
Modified   database/LOGGER/Packages/ms_logger.pks
--NEW FUNCTION f_process_traced
Improving Quiet Mode - relogging nodes in DEBUG mode.

Modified   database/LOGGER/Packages/ms_logger.pkb
Modified   database/LOGGER/Packages/ms_logger.pks
--MOD PROCEDURE log_node
--Log traversal or update it if already logged.
--Log any unlogged refs.
--MOD PROCEDURE dump_nodes
--Log traversals (using the given msg_mode) that have not yet been logged,
--or were logged at a higher msg_mode.
--search back recursively to first logged traversal, at an equal msg_mode
--log_node will update node with the new msg_mode
--and log any remaining unlogged refs.
--MOD PROCEDURE create_ref --don't create refs unless node at debug level
Revised string recognition and line injection

Modified   database/LOGGER/Packages/aop_processor.pkb
--MOD procedure splice - add l_leading_nl_offset, l_trailing_nl_offset
--MEANING of g_curremt_pos
--  p_pos - the current position is taken to indicate the next character to be read eg by regex_substr
--  so when you splice with current position, it is to be between pos-1 and pos
--Logic to manage NEW LINES
--  Current char is a NL - we want to skip it in the splice,
--  since we are going to add a NL infront of the splice anyway.
--  Apply a leading new line and indent by g_indent_spaces * p_indent
--  Add a trailing newline, because there is a word-char before the next NL.
--NEW FUNCTION trim_whitespace
--NEW FUNCTION flatten
--MOD FUNCTION get_next
--Param description
-- l_either_match is the match from both i_search and i_stop
-- i_modifier is applied to the std REGEXP_SUBSTR search
-- g_upto_pos is the start of the match
-- g_past_pos is the end of the match
-- IF i_trim_result    THEN stripped of upto 1 leading and trailing whitespace
-- IF i_trim_pointers  THEN g_upto_pos and g_past_pos will point to the start and stop of the trimmed match
-- IF match FROM i_search THEN g_current_pos will advance to g_past_pos, otherwise g_current_pos does not change.
-- IF i_upper    THEN  result is in UPPER
-- IF i_lower    THEN  result is in LOWER
-- IN HTML mode i_colour determines the highlighting used when the match is consumed (g_current_pos set to g_past_pos)
-- IF i_raise_error and NO MATCH, and exception is raises, and the search string written out.
--DEL FUNCTION get_next_lower - not worth keeping
--DEL FUNCTION get_next_upper - not worth keeping
--MOD PROCEDURE go_upto - now uses get_next to search
--DEL FUNCTION matched_with - use REGEXP_LIKE instead
--MOD PROCEDURE AOP_pu_params - change evaluation order to get best match of VAR TYPE
--FIX PROCEDURE AOP_declare - Ensure BEGIN is consumed before calling AOP_block
--MOD PROCEDURE AOP_is_as - don't pass i_inject_node, generate the injections here instead for
--    NEW PROCESS
--    NEW NODE
--Consume END if package BEGIN is not found.
--Set current pos to null, just to emphasise we are finished with this pass.
--MOD PROCEDURE AOP_block - raise error if expected keyword not found.
--FIX PROCEDURE AOP_pu_block - Ensure BEGIN is consumed before calling AOP_block
--Add extra BEGIN infront of existing BEGIN, ensuring not trimmed.
--FIX   function weave - Ensure BEGIN is consumed before calling AOP_block
APEX workaround for CLOB submit issue - take Compare Source page off the menu.

Modified   apex/f104/application/pages/page_00002.sql --label change
Modified   apex/f104/application/pages/page_00008.sql --Name changed 'Process Traces'
Modified   apex/f104/application/pages/page_00009.sql --Name changed 'Logger Control'
Modified   apex/f104/application/pages/page_00021.sql --Help Information
Modified   apex/f104/application/pages/page_00022.sql --Help Information
Modified   apex/f104/application/pages/page_00023.sql - Region name change 'Compare Source'
Modified   apex/f104/application/pages/page_00101.sql - auto changes, probably related to public page
Modified   apex/f104/application/shared_components/navigation/breadcrumbs.sql
Deleted    apex/f104/application/shared_components/navigation/tabs/standard/source.sql
Modified   apex/f104/application/shared_components/navigation/tabs/standard/t_processes.sql
Modified   apex/f104/application/shared_components/navigation/tabs/standard/t_registry.sql
Modified   apex/f104/install.sql
Add        apex/f104/application/shared_components/navigation/tabs/standard/aop_source.sql
Indent is now calculated from the block opening keywords.

Modified   database/LOGGER/Packages/aop_processor.pkb
--MOD Block Open REGEXs to search for LF+spaces+keyword
--NEW FUNCTION calc_indent takes the current indent and the last match.
--  Calcs new indent if leading char is LF. -> Count leading spaces
--  Uses as the i_indent param to most routines that have this param.
--  Eg AOP_block
Auto Info messages for report triggers

Modified   database/LOGGER/Packages/aop_processor.pkb
--MOD PROCEDURE AOP_pu_block - Add INFO for report trigger BEFOREPFORM and AFTERREPORT
Fixes for indents, multiple tables with same name, supported types.

Modified   database/LOGGER/Packages/aop_processor.pkb
Modified   database/LOGGER/Packages/aop_processor.pks
--NEW global  g_end_user --owner for normal packages, invoker for invoker packages.
--NEW FUNCTION table_owner
--MOD PROCEDURE AOP_pu_params, FUNCTION AOP_var_defs, PROCEDURE AOP_block
-- - calc l_table_owner using FUNCTION table_owner
-- - swap all_tab_columns for user_tab_columns
--REPLACE use of DB function supported_data_type WITH REGEXP_LIKE(x , G_REGEX_SUPPORTED_TYPES)
--PROCEDURE AOP_block - change calls to calc_indent passing a better default indent, that will work well, if match param is useless, eg if there is no leading NL
--MOD function weave - new param p_end_user - sets g_end_user
--MOD procedure advise_package - passes p_end_user to weave
Modified   database/LOGGER/UnitTest/aop_test.pkb
--Additional tests.
Modified   database/LOGGER/Views/aop_source_v.vw
--Fixed the outer joins
Modified   database/SYS/Users/logger.user
--grant select any table to logger;
Derive module type and owner - store on process

Modified   apex/f104/application/pages/page_00008.sql
--FIX swap ms_metacode.purge_old_processes to ms_logger.purge_old_processes
Modified   apex/f104/application/pages/page_00009.sql
--ADD P9_NUM_ROWS and P9_GO - control rows displayed
Modified   apex/f104/application/pages/page_00010.sql
--ADD P10_NUM_ROWS and P10_GO - control rows displayed
Modified   apex/f104/application/pages/page_00021.sql
--ADD P21_SCHEMA - and pass it to aop_processor.weave
Modified   database/LOGGER/Packages/ms_logger.pkb
Modified   database/LOGGER/Packages/ms_logger.pks
--NEW FUNCTION object_owner
--NEW FUNCTION object_type
--MOD FUNCTION find_module - Derive module type and owner
--NEW PROCEDURE reset_sequence - does not yet work.
--MOD FUNCTION new_process - new params i_module_name and i_unit_name
--  will look up module_type and unit_type
Modified   database/LOGGER/Tables/ms_tables.tab
--alter table ms_module add owner varchar2(30);
Fixed?? a bizarre error with apparent incomplete restoration of quotes.

Occurred where quotes where nested '   ''   '
But problem noticed in 1 piece of target code "rep_pb_pack" and only in the clean AOP version.
Seemed to dissapear after trimming clob.  I only did this because i noticed the problem occurred when
using reapply_aspect, but not with QUICK AOP in the App.

Modified   database/LOGGER/Packages/aop_processor.pkb
--NEW EXCEPTION x_restore_failed
--NEW FUNCTION trim_clob
--MOD function weave    - handles x_restore_failed (however most likely never get this error)
--                      - uses trim_clob on result.
--MOD function get_body - uses trim_clob on result.
--MOD procedure reapply_aspect - use UPPER on i_object_name
--MOD procedure restore_comments_and_quotes - uglify with exception generation.
Modified   database/LOGGER/Packages/ms_logger.pkb
Modified   database/LOGGER/Packages/ms_logger.pks
--MOVE constants to the spec for MSG_LEVEL, MSG_MODE, OPEN_PROCESS
--NB - Now able to use package constants in SQL (without need for functions)
Added a 3rd step to Quick AOP - for debugging purposes.

Modified   apex/f104/application/create_application.sql
Modified   apex/f104/application/pages/page_00002.sql
--break_on 'USING_AOP'
Modified   apex/f104/application/pages/page_00009.sql
--Add static LOV to module_type
--Change label and image on link to Unit Registry
--Add buttons ALL_QUIET, ALL_NORMAL, ALL_DEBUG, REPORT_STD to set msg_level and open_process on module and units.
--New processes for the new buttons.
Modified   apex/f104/application/pages/page_00010.sql
--Add button OVERRIDDEN
--NEW process SetAllOverridden
Modified   apex/f104/application/pages/page_00022.sql
--Added a NEXT button and new process to create clean AOP in collection AOP_OUTPUT_CLEAN for step 3.
Modified   apex/f104/application/pages/page_00024.sql
--New saved report 'No debugging'
Add        apex/f104/application/pages/page_00025.sql
--like p22 loads AOP_OUTPUT_CLEAN into a textarea.
Modified   apex/f104/application/set_environment.sql
Modified   apex/f104/application/shared_components/navigation/breadcrumbs.sql            - for p25
Modified   apex/f104/application/shared_components/navigation/tabs/standard/t_plugin.sql - for p25
Modified   apex/f104/install.sql                                                         - for p25
NEW Patch: LOG-01_07A_07B_SYS - Extra grants
NEW Patch: LOG-01_07A_07B_LOGGER - See commit summary

+ Added a 3rd step to Quick AOP - for debugging purposes.
+ Fixed?? a bizarre error with apparent incomplete restoration of quotes.
+ Derive module type and owner - store on process
+ Fixes for indents, multiple tables with same name, supported types.
+ Auto Info messages for report triggers
+ Indent is now calculated from the block opening keywords.
+ APEX workaround for CLOB submit issue - take Compare Source page off the menu.
+ Revised string recognition and line injection
+ Improving Quiet Mode - relogging nodes in DEBUG mode.
+ Ensure trace file link only when a process has created a traversal.
+ Ensuring we can start a process passing a report_id and then retrieve the results from forms with that report_id.
+ Removing extra lines from Injection.
+ AOP_pu_params now searches for %ROWTYPE and %TYPE params
+ Minor refactor AOP_pu_params
Fixed missing grant