This section describes recommended naming rules for all objects and names connected to API programing in DC1.
Name of object is related to its functionality. All programs implementing the functions of the existing applications and called from manager programs should have names in accordance with back end naming convention (for DC1 e.g. DI*, DM*, DS*… for DIS, GDM* for GEN….). Unlike the standard applications, program manager names and related files should start with three-character prefix MGR. For customer modifications the name of program should start with Z* (example: Z1MGRR001)
For example for DC1 distribution (DIS) it will be:
NOTE: Object names started with IA* are reserver for Aperio.
APIBNDDIR - This binding directory must be added to program during compilation. This is only for “manager” programs. It means programs which get JSON parameters and build JSON response. The default compilation options should be changed for these programs. See example bellow:
DFTACTGRP(*NO) ACTGRP(*CALLER) BNDDIR(ASWBNDDIR IBSBNDDIR APIBNDDIR) OPTION(*NODEBUGIO) DBGVIEW(*ALL) CVTOPT(*DATETIME) SRTSEQ(*JOBRUN)
There is one service program IAFS0001 in Iptor API Framework. This service program contains set of communication tools, JSON Parser and JSON builder.
There are two common objects:
There is general rule how the methods should be named. First it should stick to JAVA naming rules for variables:
There are some recommendations. We recommend to use long method names with dot “.” in between. The first part of method it should describe the “object”. For example “salesOrderLine” or “itemBatch” etc… The second part (after dot) should represent verb or rather action name. For example “.get” or “.update” etc… The main recommendation is to use “lower camel case” standard for coding method names.
Examples:
NOTE: The method name is case sensitive! The method name is limited to 60 characters.
All fields in JSON string should be “long” (self-descriptive). We propose to use alias defined for field name in field reference. List of parameters assigned to API method is defined in “API metadata”. The main recommendation is to use “lower camel case” standard for coding method names.
To avoid situation when warning/error messages generated by standard DMUR/DMR… programs refers to ‘short’ FRF names, for each long field parameter is possible to define list of linked short FRF fields. That list is used to translate ‘short’ FRF names in error/warning messages received from standard programs, to ‘long’ aliases used in API messages.
The recommendation is to not use reserved field names which are described in JSON structure. Although the structure of JSON allows to use the same field names. Each field is read in context. For JSON structure both: request and response see document “Iptor API Framework - JSON structure.docx”.
JSON: http://www.json.org/