Rem    NAME 
Rem      cksysfol.sql
Rem    DESCRIPTION
Rem      Creates a System Folder
Rem                Default Languages 
Rem                Default Value Types
Rem    RETURNS
Rem 	 None
Rem    NOTES
Rem      Called from the RAU during the stage CKSYSFOL
Rem	 DO NOT RUN THIS SCRIPT MORE THEN ONCE
Rem    CREATED
Rem	  08/04/1999

DECLARE
   ar_irid                 number;
   wkarea_irid		   number;
   dummy_wrkarea           boolean := FALSE;
   folder_irid             number;
   folder_ivid             number;
   org_irid                number;
   org_ivid                number;
   max_default_value_types number;
   rtn_id                  number; 
   vat_type                number;  
   comment                 varchar2(100);
   ps1_irid                number;
   ps1_ivid                number;
   l_SUPPORTS_DESIGNER     varchar2(1);
   l_SUPPORTS_JDEVEE       varchar2(1);

   TYPE t_Value_Type is record 
     ( name         varchar2(20) 
     , datatype     varchar2(20) 
     , lob_flag     varchar2(1) 
     , derived_from binary_integer  -- index number of source record 
     , irid         number          -- store irid for later use 
     ) ; 
 
   Type tt_Value_Type is table of t_Value_Type index by binary_integer; 
 
   init_value_types  tt_Value_Type; 
 
BEGIN
  dbms_output.enable(1000000);

  -- Added for Bug 1326447
  update ck_installed_objects 
    set ci_created = 'N'
  where ci_stage='CKSYSFOL';
  -- End addition for Bug 1326447
  
  select SUPPORTS_JDEVEE
  ,      SUPPORTS_DESIGNER
  into   l_SUPPORTS_JDEVEE
  ,      l_SUPPORTS_DESIGNER
  from   rm$repositories;

  -- Check Global Shared Workarea exists 
  dbms_output.put_line('* Checking if Global Shared Wokrarea exists' );
  begin
    select irid
    into wkarea_irid 
    from I$sdd_workareas 
    where name = 'GLOBAL SHARED WORKAREA';
  exception when no_data_found then 
    dummy_wrkarea := TRUE;

    -- Create a dummy workarea to put the SYSTEM FOLDER in 
    wkarea_irid := jr_workarea.create_workarea( user, 
                                                'SYSTEM WORKAREA', 
                                                'Temporay WorkArea used to create the SYSTEM FOLDER');
  end;


  -- Set workarea context
  jr_context.set_workarea(wkarea_irid);

  -- Now create a FOLDER called SYSTEM FOLDER
  dbms_output.put_line('* Creating SYSTEM FOLDER');

  -- USBUG 1006132 CREATION OF SYSTEM FOLDER RESULTING IN DANGLINGS RM DATA CAUSING FP TO HANG
  -- USBUG 989215  NEED TO IDENTIFY SYSTEM FOLDER AND ALL ITS CONTENTS BY GUID 

  folder_irid := 1773150433009805186156169550188005433;
  folder_ivid := 1773150433009809908522652419833219129;

  insert into SDD_FOLDERS ( IRID
                          , IVID
                          , DATE_CREATED
                          , CREATED_BY
                          , OWNING_USER 
                          , ELEMENT_TYPE_NAME 
                          , CONTAINER_SUBTYPE                  
                          , REMARK  
                          , NAME    
                          , OS_TIMESTAMP   
                          , ROOT_FLAG
                          , SYSTEM_ELEMENT_FLAG )
  values                  ( folder_irid
                          , folder_ivid
                          , SYSDATE
                          , USER
                          , USER
                          , 'CEL'
                          , 'FOL'
                          , 'SYSTEM FOLDER'
                          , 'SYSTEM FOLDER'
                          , SYSDATE
                          , 'Y'
                          , 'Y');

  -- USBUG 1006123 NEED TO PREVENT USERS UPDATING CONTENTS OF THE SYSTEM FOLDER 
  -- USBUG 1103313 CHANGES TO ALLOW SYSTEM FOLDER TO BE VERSIONED

  -- create the appropiate access rights 
  dbms_output.put_line('* Creating access rights for SYSTEM FOLDER');

  insert into sdw_access_rights ( IRID
                                , IVID                
                                , GRANTEE_REFERENCE      
                                , GRANTOR_REFERENCE      
                                , OBJECT_REFERENCE       
                                , OBJECT_TYPE            
                                , ACCESS_PRIVS )
  values                        ( jr_util.get_new_irid()
                                , jr_util.get_new_irid()
                                , USER
                                , USER
                                , folder_irid 
                                , 'CEL'
                                , jr_acc_rights.full_access_rights );

  -- US-BUG 878957 Grant SELECT on System Folder to PUBLIC 
  -- US BUG 1006123 NEED TO PREVENT USERS UPDATING CONTENTS OF THE SYSTEM FOLDER 
  insert into sdw_access_rights ( IRID
                                , IVID                
                                , GRANTEE_REFERENCE      
                                , GRANTOR_REFERENCE      
                                , OBJECT_REFERENCE       
                                , OBJECT_TYPE            
                                , ACCESS_PRIVS )
  values                        ( jr_util.get_new_irid()
                                , jr_util.get_new_irid()
                                , 'PUBLIC'
                                , USER
                                , folder_irid 
                                , 'CEL'
 					  ,  sdd_acc_priv_list('N',     -- 'Delete'
								     'N',     -- 'Administrate'
								     'N',	  -- 'Insert'
								     'Y',	  -- 'Select'
                                                     'N',	  -- 'Update'
                                                     'N',	  -- 'Version'
                                                     'N',	  -- 'Compile'
                                                     'N') );  -- 'Update Spec'



  -- now turn off access rights checking
  jr_context.disable(jr_context.access_rights);

  -- set working folder context
  dbms_output.put_line('* Setting working folder context to SYSTEM FOLDER');
  jr_context.set_working_folder('SYSTEM FOLDER', folder_irid);

  -- now create the default languages
  dbms_output.put_line('* Creating Default Languages');

  insert into SDD_LAN ( IRID
                      , IVID
		      ,	NAME 
                      , ELEMENT_TYPE_NAME                  
                      , LANGUAGE_TYPE          
                      , SOURCE_DIRECTORY       
                      , RUNTIME_DIRECTORY      
                      , COMMAND_LINE           
                      , DESCRIPTION            
                      , GENERATABLE_FLAG       
                      , INTERNAL_NAME          
                      , OBM_FLAG )
  select LAN_IRID
  ,	 LAN_IVID
  ,	 LAN_NAME 
  ,      'LAN'
  ,      LAN_TYPE                      
  ,      LAN_SOURCE_DIRECTORY           
  ,      LAN_RUNTIME_DIRECTORY 
  ,      LAN_COMMAND_LINE  
  ,      'Default Language Definition'
  ,      LAN_GENERATABLE_FLAG 
  ,      LAN_INTERNAL_NAME 
  ,      nvl(LAN_OBM_FLAG,'N') 
  from   CDI_LANGUAGE_DEFINITIONS;

  -- Only install the ORG unit if RM$REPOSITORIES.SUPPORTS_JDEVEE 
  -- US BUG 790286 DEFAULT ORG UNIT WITH NAME SYSTEM NEEDS TO BE CREATED
  -- US BUG 989215 NEED TO IDENTIFY SYSTEM FOLDER AND ALL ITS CONTENTS BY GUID 
  org_irid := 1773150433009814630889135289478432825;
  org_ivid := 1773150433009819353255618159123646521;

  if l_SUPPORTS_JDEVEE = 'Y' then 

     insert into SDD_ORG ( IRID
                         , IVID
                         , NAME
                         , ELEMENT_TYPE_NAME
                         , VIRTUAL_FLAG
		         , SYSTEM_ELEMENT_FLAG
	       	        , EXTERNAL_FLAG) 
     values ( org_irid
           , org_ivid 
           , 'SYSTEM'
           , 'ORG'
           , 'N'
           , 'Y'
	   , 'N');

  end if;

if l_SUPPORTS_DESIGNER = 'Y' then 

-- START CUT AND PASTE FROM NEXT LINE

BEGIN
--
--
-- Create the preference set itself
--
--
        dbms_output.put_line('* Creating the CG$GENERAL default preference set' );
        
	ps1_irid := 1553836547856609109482550445614506495;
        ps1_ivid := 1553836548166094119303895514339287551;
        
        INSERT INTO SDD_PRS (
        ELEMENT_TYPE_NAME,
        FROZEN_FLAG,
        IRID,
        IVID,
        NAME,
        PRODUCT_FLAVOR)
        VALUES
        ( 'PRS',          -- Element type name
          'N',            -- Frozen flag
          ps1_irid,       -- irid
          ps1_ivid,       -- ivid
          'CG$GENERAL',   -- name
          'CGSF');        -- product flavor

--
-------------------------------------------------------------------------------
--
-- *** Set up the preference values in each of the preference sets ***
--
-------------------------------------------------------------------------------
--

--
--
-- Set up the preferences in the main preference set
--
--

        dbms_output.put_line('* Inserting preferences for the CG$GENERAL preference set' );

        dbms_output.put_line('* -BLKDEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870281240324181061731221802950929,
         1443870281549809190883076290527731985,
         'CGSF','PRS',
         'BLKDEC','NONE');
         
        dbms_output.put_line('* -BLKFTS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870281859294200704421359252513041,
         1443870282168779210525766427977294097,
         'CGSF','PRS',
         'BLKFTS','0.05 in');
         
        dbms_output.put_line('* -BLKHDS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870282478264220347111496702075153,
         1443870282787749230168456565426856209,
         'CGSF','PRS',
         'BLKHDS','0.05 in');
         
        dbms_output.put_line('* -BLKJUS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870283097234239989801634151637265,
         1443870283406719249811146702876418321,
         'CGSF','PRS',
         'BLKJUS','LEFT');
       
        dbms_output.put_line('* -BLKMLR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870283716204259632491771601199377,
         1443870284025689269453836840325980433,
         'CGSF','PRS',
         'BLKMLR','0.05 in');
         
        dbms_output.put_line('* -BLKMLL');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870284335174279275181909050761489,
         1443870284644659289096526977775542545,
         'CGSF','PRS',
         'BLKMLL','0');
         
        dbms_output.put_line('* -BLKSBP');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870284954144298917872046500323601,
         1443870285263629308739217115225104657,
         'CGSF','PRS',
         'BLKSBP','RIGHT');
         
        dbms_output.put_line('* -BLKSBS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870285573114318560562183949885713,
         1443870285882599328381907252674666769,
         'CGSF','PRS',
         'BLKSBS','0.05 in');
         
        dbms_output.put_line('* -BLKSBW');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870286192084338203252321399447825,
         1443870286501569348024597390124228881,
         'CGSF','PRS',
         'BLKSBW','0.2 in');
         
        dbms_output.put_line('* -BLKSLR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870286811054357845942458849009937,
         1443870287120539367667287527573790993,
         'CGSF','PRS',
         'BLKSLR','0.05 in');
         
        dbms_output.put_line('* -BLKTFB');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870287430024377488632596298572049,
         1443870287739509387309977665023353105,
         'CGSF','PRS',
         'BLKTFB','N');
         
        dbms_output.put_line('* -BLKTLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870288048994397131322733748134161,
         1443870288358479406952667802472915217,
         'CGSF','PRS',
         'BLKTLM','0.1 in');
        
        dbms_output.put_line('* -BLKTLP');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870288667964416774012871197696273,
         1443870288977449426595357939922477329,
         'CGSF','PRS',
         'BLKTLP','ON DECORATION');

        dbms_output.put_line('* -BLKTLS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870289286934436416703008647258385,
         1443870289596419446238048077372039441,
         'CGSF','PRS',
         'BLKTLS','1');
         
        dbms_output.put_line('* -BUTIWD');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870289905904456059393146096820497,
         1443870290215389465880738214821601553,
         'CGSF','PRS',
         'BUTIWD','0.25 in');
        
        dbms_output.put_line('* -CBXIWD');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870290524874475702083283546382609,
         1443870290834359485523428352271163665,
         'CGSF','PRS',
         'CBXIWD','0.25 in');
         
        dbms_output.put_line('* -CLSIWD');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870291143844495344773420995944721,
         1443870291453329505166118489720725777,
         'CGSF','PRS',
         'CLSIWD','0.4 in');

        dbms_output.put_line('* -CONDEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870291762814514987463558445506833,
         1443870292072299524808808627170287889,
         'CGSF','PRS',
         'CONDEC','NONE');
         
        dbms_output.put_line('* -CONMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870292381784534630153695895068945,
         1443870292691269544451498764619850001,
         'CGSF','PRS',
         'CONMAR','0.05 in');
         
        dbms_output.put_line('* -CONTLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870293000754554272843833344631057,
         1443870293310239564094188902069412113,
         'CGSF','PRS',
         'CONTLM','0.1 in');

        dbms_output.put_line('* -CONTLS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870293619724573915533970794193169,
         1443870293929209583736879039518974225,
         'CGSF','PRS',
         'CONTLS','1');

        dbms_output.put_line('* -GRPDEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870294238694593558224108243755281,
         1443870294548179603379569176968536337,
         'CGSF','PRS',
         'GRPDEC','INSET RECTANGLE');
         
        dbms_output.put_line('* -GRPFTS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870295167149623022259314418098449,
         1443870295476634632843604383142879505,
         'CGSF','PRS',
         'GRPFTS','0.1 in');
         
        dbms_output.put_line('* -GRPHDS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870295786119642664949451867660561,
         1443870296095604652486294520592441617,
         'CGSF','PRS',
         'GRPHDS','0.05 in');
         
        dbms_output.put_line('* -GRPHIS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870296405089662307639589317222673,
         1443870296714574672128984658042003729,
         'CGSF','PRS',
         'GRPHIS','0.2 in');
         
        dbms_output.put_line('* -GRPMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870297333544691771674795491565841,
         1443870297643029701593019864216346897,
         'CGSF','PRS',
         'GRPMAR','0.1 in');
                  
        dbms_output.put_line('* -GRPUTT');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870298261999721235710001665909009,
         1443870298571484731057055070390690065,
         'CGSF','PRS',
         'GRPUTT','SD');

        dbms_output.put_line('* -GRPTLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870299190454750699745207840252177,
         1443870299499939760521090276565033233,
         'CGSF','PRS',
         'GRPTLM','0.2 in');

        dbms_output.put_line('* -GRPTLS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870299809424770342435345289814289,
         1443870300118909780163780414014595345,
         'CGSF','PRS',
         'GRPTLS','1');

        dbms_output.put_line('* -HELPLN');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870300428394789985125482739376401,
         1443870300737879799806470551464157457,
         'CGSF','PRS',
         'HELPLN','110');
         
        dbms_output.put_line('* -HLPFRM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870301047364809627815620188938513,
         1443870301356849819449160688913719569,
         'CGSF','PRS',
         'HLPFRM','ofgwfhf');
         
        dbms_output.put_line('* -IMGSBH');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870301666334829270505757638500625,
         1443870301975819839091850826363281681,
         'CGSF','PRS',
         'IMGSBH','0.2 in');
         
        dbms_output.put_line('* -IMGSBW');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870302285304848913195895088062737,
         1443870302594789858734540963812843793,
         'CGSF','PRS',
         'IMGSBW','0.2 in');
         
        dbms_output.put_line('* -ITMIPG');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870303213759878377231101262405905,
         1443870303523244888198576169987186961,
         'CGSF','PRS',
         'ITMIPG','0.1 in');
         
        dbms_output.put_line('* -ITMPIG');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870304761184927483956444886311185,
         1443870305070669937305301513611092241,
         'CGSF','PRS',
         'ITMPIG','0.05 in');

        dbms_output.put_line('* -LWCFLN');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870305380154947126646582335873297,
         1443870305689639956947991651060654353,
         'CGSF','PRS',
         'LWCFLN','MIXED');

        dbms_output.put_line('* -LOVBUT');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870305999124966769336719785435409,
         1443870306308609976590681788510216465,
         'CGSF','PRS',
         'LOVBUT','Y');

        dbms_output.put_line('* -LOVITG');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870306618094986412026857234997521,
         1443870306927579996233371925959778577,
         'CGSF','PRS',
         'LOVITG','0');

        dbms_output.put_line('* -NAVCCF');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870307237065006054716994684559633,
         1443870307546550015876062063409340689,
         'CGSF','PRS',
         'NAVCCF','Y');
       
        dbms_output.put_line('* -NAVCUR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870307856035025697407132134121745,
         1443870308165520035518752200858902801,
         'CGSF','PRS',
         'NAVCUR','Y');
         
        dbms_output.put_line('* -NAVKEY');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870308475005045340097269583683857,
         1443870308784490055161442338308464913,
         'CGSF','PRS',
         'NAVKEY','Y');
         
        dbms_output.put_line('* -NAVNPB');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870309093975064982787407033245969,
         1443870309403460074804132475758027025,
         'CGSF','PRS',
         'NAVNPB','Y');
         
        dbms_output.put_line('* -NAVWND');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870309712945084625477544482808081,
         1443870310022430094446822613207589137,
         'CGSF','PRS',
         'NAVWND','Y');

        dbms_output.put_line('* -OFABCS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870310331915104268167681932370193,
         1443870310641400114089512750657151249,
         'CGSF','PRS',
         'OFABCS','0.1 in');
         
        dbms_output.put_line('* -OFADEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870310950885123910857819381932305,
         1443870311260370133732202888106713361,
         'CGSF','PRS',
         'OFADEC','NONE');
         
        dbms_output.put_line('* -OFAFTS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870311569855143553547956831494417,
         1443870311879340153374893025556275473,
         'CGSF','PRS',
         'OFAFTS','0.1 in');
         
        dbms_output.put_line('* -OFAHDS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870312188825163196238094281056529,
         1443870312498310173017583163005837585,
         'CGSF','PRS',
         'OFAHDS','0');
         
        dbms_output.put_line('* -OFAJUS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870312807795182838928231730618641,
         1443870313117280192660273300455399697,
         'CGSF','PRS',
         'OFAJUS','LEFT');
         
        dbms_output.put_line('* -OFAMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870313426765202481618369180180753,
         1443870313736250212302963437904961809,
         'CGSF','PRS',
         'OFAMAR','0.05 in');
         
        dbms_output.put_line('* -OFAMLL');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870314355220231945653575354523921,
         1443870314664705241766998644079304977,
         'CGSF','PRS',
         'OFAMLL','0.05 in');
         
        dbms_output.put_line('* -OFARCS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870314974190251588343712804086033,
         1443870315283675261409688781528867089,
         'CGSF','PRS',
         'OFARCS','0.1 in');
         
        dbms_output.put_line('* -OFATLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870315593160271231033850253648145,
         1443870315902645281052378918978429201,
         'CGSF','PRS',
         'OFATLM','0.2 in');
         
        dbms_output.put_line('* -OFATLS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870316212130290873723987703210257,
         1443870316521615300695069056427991313,
         'CGSF','PRS',
         'OFATLS','1');
         
        dbms_output.put_line('* -OLBLST');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870316831100310516414125152772369,
         1443870317140585320337759193877553425,
         'CGSF','PRS',
         'OLBLST','CGUTIL$CALENDAR');

        dbms_output.put_line('* -PAGCHT');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870317450070330159104262602334481,
         1443870317759555339980449331327115537,
         'CGSF','PRS',
         'PAGCHT','50');
         
        dbms_output.put_line('* -PAGCON');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870318069040349801794400051896593,
         1443870318378525359623139468776677649,
         'CGSF','PRS',
         'PAGCON','0');
         
        dbms_output.put_line('* -PAGCWD');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870318997495379265829606226239761,
         1443870319306980389087174674951020817,
         'CGSF','PRS',
         'PAGCWD','55');
         
        dbms_output.put_line('* -PAGFTS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870319616465398908519743675801873,
         1443870319925950408729864812400582929,
         'CGSF','PRS',
         'PAGFTS','0.1 in');
         
        dbms_output.put_line('* -PAGHDS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870320235435418551209881125363985,
         1443870320544920428372554949850145041,
         'CGSF','PRS',
         'PAGHDS','0.1 in');
         
        dbms_output.put_line('* -PAGIBS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870320854405438193900018574926097,
         1443870321163890448015245087299707153,
         'CGSF','PRS',
         'PAGIBS','0.1 in');
         
        dbms_output.put_line('* -PAGMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870321473375457836590156024488209,
         1443870321782860467657935224749269265,
         'CGSF','PRS',
         'PAGMAR','0.05 in');
         
        dbms_output.put_line('* -PAGTFB');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870322092345477479280293474050321,
         1443870322401830487300625362198831377,
         'CGSF','PRS',
         'PAGTFB','N');

        dbms_output.put_line('* -PLSIWD');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870322711315497121970430923612433,
         1443870323020800506943315499648393489,
         'CGSF','PRS',
         'PLSIWD','0.4 in');
         
        dbms_output.put_line('* -POPCHT');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870323330285516764660568373174545,
         1443870323639770526586005637097955601,
         'CGSF','PRS',
         'POPCHT','40');
         
        dbms_output.put_line('* -POPHSB');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870323949255536407350705822736657,
         1443870324258740546228695774547517713,
         'CGSF','PRS',
         'POPHSB','N');
         
        dbms_output.put_line('* -POPMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870324568225556050040843272298769,
         1443870324877710565871385911997079825,
         'CGSF','PRS',
         'POPMAR','0');
         
        dbms_output.put_line('* -POPTFB');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870325187195575692730980721860881,
         1443870325496680585514076049446641937,
         'CGSF','PRS',
         'POPTFB','N');
         
        dbms_output.put_line('* -POPVHT');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870325806165595335421118171422993,
         1443870326115650605156766186896204049,
         'CGSF','PRS',
         'POPVHT','40');

        dbms_output.put_line('* -RADDEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870326425135614978111255620985105,
         1443870326734620624799456324345766161,
         'CGSF','PRS',
         'RADDEC','INSET RECTANGLE');
         
        dbms_output.put_line('* -RADFTS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870327044105634620801393070547217,
         1443870327353590644442146461795328273,
         'CGSF','PRS',
         'RADFTS','0.1 in');
         
        dbms_output.put_line('* -RADHDS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870327663075654263491530520109329,
         1443870327972560664084836599244890385,
         'CGSF','PRS',
         'RADHDS','0.05 in');
         
        dbms_output.put_line('* -RADHIS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870328282045673906181667969671441,
         1443870328591530683727526736694452497,
         'CGSF','PRS',
         'RADHIS','0.15 in');
         
        dbms_output.put_line('* -RADMAR');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870329519985713191561942868795665,
         1443870329829470723012907011593576721,
         'CGSF','PRS',
         'RADMAR','0.1 in');

        dbms_output.put_line('* -RADTLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870330138955732834252080318357777,
         1443870330448440742655597149043138833,
         'CGSF','PRS',
         'RADTLM','0.2 in');

        dbms_output.put_line('* -RADTLP');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870331067410762298287286492700945,
         1443870331376895772119632355217482001,
         'CGSF','PRS',
         'RADTLP','ON DECORATION');
         
        dbms_output.put_line('* -RADTLS');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870331686380781940977423942263057,
         1443870331995865791762322492667044113,
         'CGSF','PRS',
         'RADTLS','1');
         
         dbms_output.put_line('* -SPRBEV');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870332305350801583667561391825169,
         1443870332614835811405012630116606225,
         'CGSF','PRS',
         'SPRBEV','NONE');
         
        dbms_output.put_line('* -STBDEC');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870332924320821226357698841387281,
         1443870333233805831047702767566168337,
         'CGSF','PRS',
         'STBDEC','NONE');
         
        dbms_output.put_line('* -STBTLM');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870333543290840869047836290949393,
         1443870333852775850690392905015730449,
         'CGSF','PRS',
         'STBTLM','0.2 in');

         
        dbms_output.put_line('* -TLSSBH');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870334162260860511737973740511505,
         1443870334471745870333083042465292561,
         'CGSF','PRS',
         'TLSSBH','0.2 in');
         
        dbms_output.put_line('* -TLSSBW');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870334781230880154428111190073617,
         1443870335090715889975773179914854673,
         'CGSF','PRS',
         'TLSSBW','0.2 in');

        dbms_output.put_line('* -TXTSBW');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870335400200899797118248639635729,
         1443870335709685909618463317364416785,
         'CGSF','PRS',
         'TXTSBW','0.2 in');
         
        dbms_output.put_line('* -USECAL');
        INSERT INTO SDD_UPR (
        CIELEMENT_REF, ELEMENT_TYPE_NAME, FROZEN_FLAG, IRID, IVID,
        PRODUCT_FLAVOR, PREFERENCE_FOR, PREFERENCE_NAME, PREFERENCE_VALUE ) VALUES
        ( ps1_irid,         -- CG$GENERAL
         'UPR',
         'N',
         1443870336019170919439808386089197841,
         1443870336328655929261153454813978897,
         'CGSF','PRS',
         'USECAL','Y');
END;

-- END CUT AND PASTE HERE

end if; 
-- EOif SUPPORTS_DESIGNER =Y

 
  -- now turn on access rights checking
  jr_context.enable(jr_context.access_rights);

  -- USBUG 1152133 - ACCESS RIGHTS ERROR WHEN ENABLING VERSION SUPPORT
  jr_context.set_workarea ('');

  -- Finally Delete the Temporary WorkArea if one was created
  if (dummy_wrkarea) then
    dbms_output.put_line('* Removing WorkArea');
    jr_workarea.delete_workarea(wkarea_irid, user);
  end if;
  
   -- if we have got this far evereything should have worked correctly 
   -- update ck_installed_objects to reflect this
   -- Added for Bug 1326447
   
    update ck_installed_objects 
    set ci_created = 'Y'
    where ci_stage='CKSYSFOL';
   -- End addition for Bug 1326447
  
  commit;

  dbms_output.put_line('* Operation Complete');
                     
EXCEPTION

  WHEN OTHERS THEN 

     dbms_output.put_line('* Exception Raised  ');
     dbms_output.put_line('...ERROR: '||substr(sqlerrm,1,240));
     rollback work;
     RAISE;
END;
/
