rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\CIMODMOD.HPB 1.5 1998/12/30 14:57:16 loldham Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cimodmod.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem aheath 07/08/94 - Creation REM *************************************************************************** REM Hand-carved package body for MODULE NETWORK created on 28-SEP-94 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihmodmod IS -- Generic post-process routines PROCEDURE check_delete(id number); str_type constant varchar2(6) := 'MODMOD'; part_type constant varchar2(6) := 'MOD'; use_type constant varchar2(6) := 'MOD'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciomodule_network.data) IS BEGIN -- Perform INSERT-specific processing if operation = 'INS' then -- Check for existence of parent module and child module -- elements if ciiutl.el_exists(pl.v.parent_module_reference,part_type) = false then ciierr.fatal(3500,'MODULE NETWORK','parent_module', pl.v.parent_module_reference); end if; if ciiutl.el_exists(pl.v.child_module_reference,use_type) = false then ciierr.fatal(3500,'MODULE NETWORK','child_module', pl.v.child_module_reference); end if ; else if ciiutl.el_exists(id,str_type) = false then ciierr.fatal(3504,ciiutl.nls_type_name('MODULE_NETWORK'),id); end if; end if; -- Access rights for module network derive from the parent module -- Access rights checking performed by triggers in config 4.0.9 /* ciiacc.check_access_rights(pl.v.parent_module_reference, part_type,'UPD','SHR'); if operation = 'INS' then ciiacc.check_access_rights(pl.v.child_module_reference, use_type,'SEL','SHR'); end if; */ if operation = 'INS' then if pl.i.called_sequence = false then pl.v.called_sequence := ciiexp.default_str_seq( pl.v.parent_module_reference, pl.v.child_module_reference, str_type, NULL, 'CHILD_MODULE_REF'); pl.i.called_sequence := true; end if; end if; -- Check that module network with this parent_module and -- child_module doesn't already exist on insert -- CHECK REPLACED BY DEFERRED CONSTRAINT AT 4.0.6 if operation = 'INS' or (operation = 'UPD' and pl.i.called_sequence) then -- Initialize unassigned properties with default values on INSERT pl.v.element_type_name := str_type; pl.i.element_type_name := true; end if; -- Validate user-defined properties if cieval.is_extended then cieval.check_association(id,pl.v.types,(operation='UPD') ,pl.v.parent_module_reference ,pl.v.child_module_reference ,pl.v.user_defined_property_0,pl.i.user_defined_property_0 ,pl.v.user_defined_property_1,pl.i.user_defined_property_1 ,pl.v.user_defined_property_2,pl.i.user_defined_property_2 ,pl.v.user_defined_property_3,pl.i.user_defined_property_3 ,pl.v.user_defined_property_4,pl.i.user_defined_property_4 ,pl.v.user_defined_property_5,pl.i.user_defined_property_5 ,pl.v.user_defined_property_6,pl.i.user_defined_property_6 ,pl.v.user_defined_property_7,pl.i.user_defined_property_7 ,pl.v.user_defined_property_8,pl.i.user_defined_property_8 ,pl.v.user_defined_property_9,pl.i.user_defined_property_9 ,pl.v.user_defined_property_10,pl.i.user_defined_property_10 ,pl.v.user_defined_property_11,pl.i.user_defined_property_11 ,pl.v.user_defined_property_12,pl.i.user_defined_property_12 ,pl.v.user_defined_property_13,pl.i.user_defined_property_13 ,pl.v.user_defined_property_14,pl.i.user_defined_property_14 ,pl.v.user_defined_property_15,pl.i.user_defined_property_15 ,pl.v.user_defined_property_16,pl.i.user_defined_property_16 ,pl.v.user_defined_property_17,pl.i.user_defined_property_17 ,pl.v.user_defined_property_18,pl.i.user_defined_property_18 ,pl.v.user_defined_property_19,pl.i.user_defined_property_19 ); end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for module network derive from the parent module -- Access rights checking performed by triggers in config 4.0.9 /* if operation = 'DEL' then ciiacc.check_access_rights(id,str_type,'UPD','MM'); else ciiacc.check_access_rights(id,str_type,operation,'MM'); end if; */ -- if operation is 'DELETE', make sure no non-cascading references exist if operation = 'DEL' then check_delete(id); end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl ciomodule_network.data) IS cursor existing_parents(pid IN number,pchild IN number) is select plm.id id from ci_module_networks modmod , ci_plsql_modules plm where plm.id = modmod.parent_module_reference and plm.plsql_module_type = 'TYPE BODY' and modmod.child_module_reference = pchild and modmod.id != nvl(pid,0); existing_parent existing_parents%ROWTYPE; BEGIN if cdapi.load_mode then return; end if; if operation = 'SEL' then return; end if; -- B644633: A procedure that is a child of a TYPE BODY may only be -- a child of one PLM /** jkc 30sep98 - correct error message for b644633 **/ open existing_parents(pl.v.id,pl.v.child_module_reference); fetch existing_parents into existing_parent; if existing_parents%FOUND then -- %0!s: %1!s is already a child of %2!s. It may only be the child of one TYPE BODY -- Cause: A PLSQL Module that is a child of a TYPE BODY PLSQL Module is -- specific to that Type Body and it should not be possible -- to reuse it elsewhere (ie via a Module Network, as a child -- of another Type Body or of a Procedure etc). -- Action:Do not associate this PLSQL Module with this TYPE BODY -- PLSQL Module. ciierr.fatal(1024, ciiutl.identify(pl.v.id, pl.v.types), ciiutl.identify(pl.v.child_module_reference, 'MOD'), ciiutl.identify(existing_parent.id, 'MOD')); end if; if existing_parents%ISOPEN then close existing_parents; end if; /* Bug 805818 - remove all code for secondary update to create NAI */ END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation='DEL' then ciiutl.delete_element(id,str_type); end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN null; END; --============================= CHECK SUPER ================================-- -- return false if module is shared into another app sys FUNCTION check_super(mod_ref number) RETURN boolean IS cnt number; BEGIN select count(*) into cnt from ci_app_sys_modules where module_reference = check_super.mod_ref and application_system_reference != cdapi.app_sys_ref ; if cnt = 0 then return(true); else return(false); end if; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /