rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\CIDOCXXX.HPB 1.3 1998/12/30 14:53:10 loldham Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cidocxxx.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem jwetherb 09/29/94 - Creation Rem jwetherb 01/09/94 - Derive use_type from element_reference REM *************************************************************************** REM Hand-carved package body for DOCUMENT ATTACHMENT created on 29-SEP-94 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihdocxxx IS -- Generic post-process routines PROCEDURE check_delete(id number); str_type constant varchar2(6) := 'DOCXXX'; part_type constant varchar2(6) := 'DOC'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciodocument_attachment.data) IS --#BEGIN dummy number; use_type_parent varchar2(6); --#END BEGIN -- Perform INSERT-specific processing if operation = 'INS' then if pl.v.element_type_for is null then ciierr.fatal(1301,'ELEMENT_TYPE_FOR'); end if; -- Check for existence of document and element -- elements if ciiutl.el_exists(pl.v.document_reference,part_type) = false then ciierr.fatal(3500,'DOCUMENT ATTACHMENT','document', pl.v.document_reference); end if; if ciiutl.el_exists(pl.v.element_reference,pl.v.element_type_for) = false then ciierr.fatal(3500,'DOCUMENT ATTACHMENT',ciiutl.type_name(pl.v.element_type_for), pl.v.element_reference); end if ; --#BEGIN -- B453457 : Allow DOCXXX for some SACs select max(cet.supertype) into use_type_parent from ci_element_types cet where short_name = pl.v.element_type_for; if use_type_parent not in ('SHR', 'NSHR', 'SAC') or (use_type_parent = 'SAC' and pl.v.element_type_for not in ('ATT','MCH','CCN','COL','OCO','DFI','DPR','DSY', 'TRG','DBU','DFL','DAT','DOI','IND','ARG', 'PGD', 'RELEND','RPG','GRP','ORS','SRG','SYN','OTB','MWF', 'DOI','IND','DFI','OCO')) then -- The above list came from Model bug 24369 -- %0!s: Document Attachments are not valid for this element type -- Cause: Documents may only be attached to Primary Access Control -- elements (PACs) and some simple Secondary Access Control -- elements (SACs). -- Action: Attach this document to another element type. ciierr.fatal(1029, ciiutl.identify(pl.v.element_reference, pl.v.types)); end if; -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.element_reference, -- pl.v.element_type_for,'SEL'); --#END else if ciiutl.el_exists(id,str_type) = false then ciierr.fatal(3504,ciiutl.nls_type_name('DOCUMENT_ATTACHMENT'),id); end if; end if; -- Access rights for document attachment derive from the document -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.document_reference, -- part_type,'UPD','SHR'); -- Validate user-defined properties if cieval.is_extended then cieval.check_association(id,pl.v.types,(operation='UPD') ,pl.v.document_reference ,pl.v.element_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; -- Check that document attachment with this document and -- element doesn't already exist on insert -- CHECK REPLACED BY DEFERRED CONSTRAINT AT 4.0.6 if operation = 'INS' then -- Initialize unassigned properties with default values on INSERT pl.v.element_type_name := str_type; pl.i.element_type_name := true; end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for document attachment derive from the document -- 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 ciodocument_attachment.data) IS BEGIN null; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN null; 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 document is connected to other application systems END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /