Feature #257

Feature #328: Enduro/X Version 6.0 master task

Implemented tpexport() and tpimport() functions

Added by Madars Vitolins about 1 year ago. Updated about 2 months ago.

Status:ClosedStart date:12/07/2017
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:-

Description

tpexport() and tpimport() shall be implemented. The common storage format could be JSON string.

History

#1 Updated by Madars Vitolins about 1 year ago

Also needs support for tpenvelope().

#2 Updated by Madars Vitolins about 1 year ago

Example formats:

{
    buftype:"STRING|CARRAY|UBF|VIEW",
        /* sub-type only for views */
    subtype:"view1",
    version:"1.0",
    /* for string */
    data: "test string" 
    /* for carray, base64*/
    data: "dGVzdCBzdHJpbmcNCg==" 
    /* for UBF, for internals see ubf2exjson.c */
    data:
    {
        FIELD1:"VAL",
        FIELD2:"VAL" 
    }
    /* For view, internals: view2exjson.c */
    data:
    {
        transaction:
        {
            view1:{
                field1:"hello",
                field2:"world" 
            }
        }
    }

}

#3 Updated by Madars Vitolins 7 months ago

The core of the function shall be: tpexportex() and tpimportex() which takes additional argument:

struct ndrx_expbufctl
{
    char buftype[XATMI_TYPE_LEN+1];
    short buftype_ind;

    char subtype[XATMI_SUBTYPE_LEN+1];
    short subtype_ind;

    char version[MAXTIDENT+1];
    short version_ind;

    char svcnm[XATMI_SERVICE_NAME_LENGTH+1];
    short svcnm_ind;

    int rval;
    short rval_ind;

   long rcode;
   short rcode_ind;

   int tperror;
   short tperror_ind;

   char tpstrerror[MAX_TP_ERROR_LEN+1];
   short tpstrerror_ind;
};
typedef struct ndrx_expbufctl_t ndrx_expbufctl;

int tpexportex(ndrx_expbufctl_t *ctl, char *ibuf, long ilen, char *ostr, long *olen,  long flags)

int tpimportex(ndrx_expbufctl_t *ctl, char *istr, long ilen, char **obuf, long *olen,  long flags)

In case of "tpexportex", if any indicator is set in the ctl structure, then export it as is. For buffer type and sub-type, if fields are set, that should be cross checked with real buffer type provided by tptypes, if does not compare, then reject with TPEINVAL and corresponding message.

For tpimportex, read all header data as is and put the any field found in the ctl data and set the indicator. tpimportex shall perform memset 0 on ctl struct.

Header data should be as follows:

{
    buftype:"STRING|CARRAY|UBF|VIEW",
        /* sub-type only for views */
    subtype:"view1",
    version:"1.0",
    svcnm:"HELLOSVC",
    irval:0,
    rcode:123,
    tperror:6,
    tpstrerror:"No service entry" 
}

#4 Updated by Madars Vitolins 6 months ago

  • Parent task set to #328

#5 Updated by Madars Vitolins 5 months ago

  • Status changed from New to In Progress

#6 Updated by Oskars P 3 months ago

  • % Done changed from 0 to 80

#7 Updated by Madars Vitolins about 2 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

#8 Updated by Madars Vitolins about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF