rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cigem.hpb 1.4 1998/12/14 17:35:31 cvanes Exp $ rem Rem Copyright (c) 1996 by Oracle Corporation Rem NAME Rem cigem.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 07/10/96 - Creation REM *************************************************************************** REM Hand-carved package body for GENERAL MODULE created on 29-APR-96 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihgem IS -- Generic post-process routines PROCEDURE check_delete(id number); pac_type constant varchar2(6) := 'MOD'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciogeneral_module.data) IS language_name varchar2(10); BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.id,pac_type,operation,'SHR'); -- Validate user-defined properties if cieval.is_extended then cieval.check_element(id,pl.v.types,(operation='UPD') ,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; -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then pl.v.element_type_name := pac_type; pl.i.element_type_name := true; pl.v.module_type := 'GEM'; pl.i.module_type := true; if pl.v.name is null then pl.v.name := pl.v.short_name; pl.i.name := true; end if; end if; -- Default the module type to 'LIBRARY' if language is set to D2KLIB (Bug533067) if pl.v.language_reference is not null then select max(lang.internal_name) into language_name from ci_languages lang where lang.id=pl.v.language_reference; if language_name = 'D2KLIB' then pl.v.general_module_type := 'LIBRARY'; pl.i.general_module_type := true; end if; end if; --Temporary fix- really should have constraint to enforce this... (Bug533067) --If changing module type to something other than 'LIBRARY', -- if module is in language 'D2KLIB', switch it back to 'LIBRARY' -- if operation = 'UPD' -- and not pl.i.language_reference -- and pl.i.general_module_type -- and pl.v.general_module_type != 'LIBRARY' then -- select max(lang.internal_name) -- into language_name -- from ci_languages lang -- ,ci_general_modules gem -- where lang.id=gem.language_reference -- and gem.id=pre_process.id; -- if language_name = 'D2KLIB' then -- pl.v.general_module_type := 'LIBRARY'; -- end if; -- end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS --Cursor to find any specific module components attached to a general module CURSOR mco_delete IS select mco.id ref from ci_specific_mcos mco where mco.general_module_reference = pre_process.id; BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(id,pac_type,operation,'SHR'); -- if operation is 'DELETE', make sure no non-cascading references exist if operation = 'DEL' then check_delete(id); -- Remove secondary delete processing - Bug 876810 -- Delete any module components specific to this general module -- in_delete_gem := true; -- FOR mco IN mco_delete LOOP -- ciospecific_mco.del(mco.ref); -- END LOOP; -- in_delete_gem := false; end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl ciogeneral_module.data) IS dummy number; BEGIN if operation = 'INS' then ciiutl.create_appxxx(pac_type,pl.v.id,pl.v.name); elsif operation = 'UPD' then if pl.i.name or pl.i.short_name then cioapp_con_interface.traverse('CIHAPPCONU1',id, 'APPMOD'); end if; end if; /* Deleted loads of 2ndary insert stuff */ END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation = 'DEL' then -- Delete the general module and all it's related sub-bits ciiutl.delete_element(id,pac_type); end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN null; -- 4.0.12 Removed all simple delete checking -- Check if this general module is connected to other application systems -- Check if any module component links are connected to me. -- Check if any module networks are connected to me -- Check if any other Modules refer to Program Data owned by me select count(*) into dummy from ci_module_program_data modpgd ,ci_program_data pgd where pgd.general_module_reference = check_delete.id and modpgd.PROGRAM_DATUM_REFERENCE = pgd.id and modpgd.general_module_reference != check_delete.id; if dummy > 0 then ciierr.post(1345,ciiutl.identify(id, 'GEM')); error_count := 1; end if; if error_count > 0 then raise cdapi.apierror; end if; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /