-- Customer specific once-script to synchronize the primary company employees
-- in an XD configuration.
--
-- (c) 2016 SG|facilitor bv
--
-- Support: +31 53 4800700
SET ECHO ON
SPOOL xVENR35574.lst
SET DEFINE OFF

INSERT INTO fac_usrrap (fac_usrrap_omschrijving,
                        fac_usrrap_view_name,
                        fac_functie_key,
                        fac_usrrap_functie)
    VALUES ('PRS: Synchronisatie master xml',
            'venr_v_imp_prs_perslid_sync',
            75,
            1);


COMMIT;

-- Toevoegen API om persoonsgegevens op te vragen (vanuit andere XD-omgeving)
INSERT INTO fac_api (fac_api_name,
                     fac_api_omschrijving,
                     fac_api_filepath,
                     fac_api_loglevel,
                     fac_usrrap_key,
                     fac_api_stylesheet,
                     fac_api_options_json)
    VALUES ('PRS_SYNC',
            'Synchronisatie master xml',
            'appl/api/api_fetchXML.asp',
            1,
            (SELECT fac_usrrap_key FROM fac_usrrap WHERE fac_usrrap_view_name = 'venr_v_imp_prs_perslid_sync'),
            'CUST/VENR/xsl/perslid_sync.xsl',
            NULL);

-- Toevoegen gebruiker om PRS_SYNC-API uit te voeren
INSERT INTO prs_perslid (prs_perslid_module,
                         prs_srtperslid_key,
                         prs_afdeling_key,
                         prs_perslid_naam,
                         prs_perslid_oslogin,
                         prs_perslid_apikey,
                         prs_perslid_flags,
                         prs_perslid_systeemadres)
   SELECT 'PRS',
          prs_srtperslid_key,
          prs_afdeling_key,
          'API-user tbv. XD-module',
          '_PRS_SYNC',
          'JnAXUHijEkdhfCnmcypEHkGNWuGqCUXh',
          4,
          NULL
     FROM prs_perslid
    WHERE prs_perslid_key = 4;

COMMIT;
BEGIN adm.systrackscriptId('$Id$'); END;
/
SPOOL OFF
@venr.sql
