{auditing/include/_aud-utils.i}
RUN policies-dataset-read-xml IN hAuditUtils (INPUT pcxmlFileName, INPUT-OUTPUT DATASET-HANDLE hAuditDset BY-REFERENCE, OUTPUT pcList, OUTPUT pcErrorMsg). /* Either display error message or confirmation that the policies were imported */ IF errorMsg <> "":U THEN MESSAGE errorMsg VIEW-AS ALERT-BOX ERROR. ELSE DO: /* check if XML file has policies which already exist */ IF cDupList <> "" THEN DO: MESSAGE "The following policies already exist:" SKIP REPLACE(cDupList,",",CHR(10)) SKIP "Do you want to override them?" SKIP "(If Yes, the listed policies will be deleted and re-imported)" VIEW-AS ALERT-BOX QUESTION BUTTON YES-NO UPDATE lChoice AS LOGICAL. IF lChoice THEN DO: /* User confirmed that he wants to override existing policies, so let's pick up from where we left off. Keep the changes. */ RUN setcursor ("WAIT":U). RUN override-policies-from-xml (INPUT-OUTPUT DATASET-HANDLE hAuditDset BY-REFERENCE, OUTPUT pcErrorMsg). RUN setcursor ("":U). IF errorMsg <> "" THEN MESSAGE errorMsg VIEW-AS ALERT-BOX ERROR. END. /* lChoice */ ELSE DO: /* User doesn't want to override policies, to cancel the previous request */ RUN cancel-import-from-xml IN hAuditUtils. MESSAGE "Import canceled" VIEW-AS ALERT-BOX INFO. END. END. END. /* errorMsg = "" */ |