 
/*------------------------------------------------------------------------
   File        : queryHandler
   Purpose     : 
   Syntax      : 
   Description : 
   Author(s)   : walter.riechsteiner
   Created     : Wed Jul 10 18:09:37 CEST 2024
   Notes       : 
 ----------------------------------------------------------------------*/

USING Progress.Json.ObjectModel.JsonObject FROM PROPATH.
USING System.Reflection.Emit.Label FROM ASSEMBLY.


CLASS utilities.webhookHandler: 

    DEFINE VARIABLE i1        AS INTEGER   NO-UNDO.
    DEFINE VARIABLE i2        AS INTEGER   NO-UNDO.
    DEFINE VARIABLE cProgramm AS CHARACTER NO-UNDO.

    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC LOGICAL readInputDatenFromJson(
        INPUT oJsonObject       AS JsonObject,
        INPUT hbttInput         AS HANDLE,
        INPUT-OUTPUT hbttTemp   AS HANDLE
        ):
        
        DEFINE VARIABLE lcJsonString AS LONGCHAR   NO-UNDO.
        DEFINE VARIABLE lcOriginal   AS LONGCHAR   NO-UNDO.
        
        DEFINE VARIABLE jsonttTemp   AS jsonObject NO-UNDO.
        
        DEFINE VARIABLE lRetVal      AS LOGICAL    NO-UNDO INIT FALSE.
        DEFINE VARIABLE cString      AS CHARACTER  NO-UNDO.
        
        jsonttTemp = NEW JsonObject().
        jsonttTemp = oJsonObject:GetJsonObject('ttTemp').
        lRetVal    = hbttTemp:READ-JSON ('JsonObject', jsonttTemp).
        hbttTemp:FIND-FIRST ().
        
        hbttTemp:WRITE-JSON('longchar', lcJsonString, FALSE).
        MESSAGE 'Daten zweiter Buffer -> ' STRING(lcJsonString). 

        lRetVal = TRUE.
        RETURN lRetVal.
        
    END METHOD.

    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/
    DESTRUCTOR PUBLIC webhookHandler ( ):
        MESSAGE 'Destructor webhookHandler '.
    /*        DELETE OBJECT hQuery NO-ERROR.    */
    /*        DELETE OBJECT hBuffer NO-ERROR.   */
    END DESTRUCTOR.

END CLASS.