-- Customer specific once-script AAIT#31941.
--
-- (c) 2015 Facilitor bv.
SET ECHO ON
SET DEFINE ON
column fcltlogfile new_value fcltlogfile NOPRINT;

SELECT UPPER (USER) || '_AAIT#31941' || '.lst' AS fcltlogfile FROM DUAL;

spool &fcltlogfile
SET DEFINE OFF;

INSERT INTO fac_api
   (fac_api_name,
    fac_api_filepath)
 VALUES
   ('HMAIL',
    'appl/api/api_hmail.asp');

-- Voeg een gebruiker toe om de 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',
          1, -- Onbekend
          prs_afdeling_key,
          'hMail API user',
          '_HMAIL',
          'qSCeJBnGcMHBOHryeWoCdAWeOBgkDnNW',
          4,
          NULL
     FROM prs_afdeling
    WHERE prs_afdeling_naam = 'Onbekend';

-- Configureer de emailsettings
INSERT INTO fac_email_setting (fac_email_setting_user,
                               fac_email_setting_from,
                               fac_email_setting_attachpath)
    VALUES ('maas',
            NULL,
            'd:\Apps\Facilitor\AAFM\CUST\AADS\import\Maas\');

-- Voeg de api toe om 
INSERT INTO fac_api (fac_api_name,
                     fac_api_omschrijving,
                     fac_api_filepath,
                     fac_api_loglevel,
                     fac_api_stylesheet,
                     fac_api_options_json)
    VALUES ('MAAS2OPDR',
            'Statuswijzigingen ontvangen van MAAS.',
            'appl/api/api_opdrsoap.asp',
            1,
            'cust/aaxx/import/Maas/MaasStatusResponse.xsl',
            '{"MLDremark":6}');

-- en de persoon
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)
    VALUES ('PRS',
            51801,
            121,
            'Maas koppeling',
            '_MAAS_KOPPELING',
            'CzFPTrcCHSHKqKcLNmPOaVXazUUWDOvz',
            4);

INSERT INTO fac_gebruikersgroep (prs_perslid_key, fac_groep_key)
   (SELECT prs_perslid_key, 162
      FROM prs_perslid
     WHERE prs_perslid_naam = 'Maas koppeling');

INSERT INTO fac_email_setting (fac_email_setting_user,
                               fac_email_setting_from,
                               fac_email_setting_attachpath)
    VALUES ('maas',
            NULL,
            'd:\Apps\Facilitor\AAFM\CUST\AADS\import\Maas\');

COMMIT;

BEGIN
   adm.systrackscriptid (
      '$Id$');
END;
/

SPOOL OFF
QUIT

