aiM18 Developer Center aiM18 Developer Center
DOC Home
  • Platform

    • Overview
    • Frontend Framework
    • Backend Framework
    • EBI Development
    • JSF Components
    • BPM Extension Interface
    • Telescope Extension Interface
    • Mobile App Setup
  • ERP

    • ERP EJB Interfaces
    • ERP XML Config Files
    • ERP Decorators (Frontend Interfaces)
  • Tutorial

    • Setup Development Environment
    • Sample App
  • Platform

    • Authentication
    • Common JSON Objects
    • Core Services
    • EBI Services
  • Enterprise Resource Planning
  • Human Capital Management
  • Business Process Management
  • Schedule Management
  • Document Management
  • Tutorial

    • Interacting with aiM18 via webservices
Tutorial
GitHub (opens new window)
DOC Home
  • Platform

    • Overview
    • Frontend Framework
    • Backend Framework
    • EBI Development
    • JSF Components
    • BPM Extension Interface
    • Telescope Extension Interface
    • Mobile App Setup
  • ERP

    • ERP EJB Interfaces
    • ERP XML Config Files
    • ERP Decorators (Frontend Interfaces)
  • Tutorial

    • Setup Development Environment
    • Sample App
  • Platform

    • Authentication
    • Common JSON Objects
    • Core Services
    • EBI Services
  • Enterprise Resource Planning
  • Human Capital Management
  • Business Process Management
  • Schedule Management
  • Document Management
  • Tutorial

    • Interacting with aiM18 via webservices
Tutorial
GitHub (opens new window)
  • base

    • Authentication
    • Common JSON Objects
      • SqlTable
      • SqlEntity
      • CheckMsg
      • Other Useful Class
    • Core Services
    • Enduser-driven Business Intelligence
    • Error Code Description
  • Business Process Management

    • Business Process Management
  • Schedule Management

    • Schedule Management
  • Document Management System

    • Document Management System
  • Enterprise Resource Planning

    • README for ERP
    • Master Data
    • Sales
    • Purchase
    • Stock
    • Consignment
    • Subcontract
    • Production
    • Retail
    • Retail Stored Value
    • Warehouse Management Solution
    • Retail and Third-Party Logistics
    • Trading and Finance
    • Accounting
    • Accounting EBI
  • Human Capital Management

    • README for HCM
    • Attendance Management
    • Hong Kong Labour Law Compliance
    • Leave Management
    • Organization And Personnel Management
    • Payroll Management
    • PRC Labour Law Compliance
    • Appraisal Management
    • Attendance
    • Casual Labour
    • Personnel
    • Leave
    • Medical Claim Management
    • Payroll
    • Recruitment
    • Training & Sponsorship
  • Web Services
  • base
Multiable
2024-02-23
目录

Common JSON Objects

Version: 1.0 | Release Date: 30/6/2023

This section introduces common JSON objects accepted or returned by aiM18 in various web service requests.

# SqlTable

SqlTable is a Java Class widely used by aiM18. You can see its detailed source code in Github (opens new window).

If your programming language is Java, you can use the class definitions obtained on github to convert JSON directly into Java classes for subsequent operations. Its JSON format is shown below:

The SqlTable JSON:

{
  "name":"test",		//SqlTable name
  "size":2, 			//The row count
  "fields":[			//The fields info of the table 
		{
          "name":"id",							// Field name
          "fieldClassName":"Long", 				// Class name of the field
          "fieldClass":"java.lang.Long",		// Field class
          "classType":10
        },
    	{
          "name":"code",
          "fieldClassName":"String",
          "fieldClass":"java.lang.String",
          "classType":0
        },
    	{ 
          "name":"lastModifyDate",
          "fieldClassName":"Date",
           "fieldClass":"java.util.Date",
           "classType":21
        }],
 "values":[			//The values of the field
       {
         "id":3,
         "code":"AS0221",
         "lastModifyDate":"2017-10-25 12:06:34"
       },					
       {
         "id":2,
         "code":"DS22",
         "lastModifyDate":"2017-10-19 09:37:10"
       }]
}

The parameters of SqlTable:

Name Type Description
name String SqlTable name (as stated in data dictionary)
size int The row count
fields JSON Array The fields info of the table
values JSON Array The values of the field

# SqlEntity

SqlEntity is a JSON object representing data of a record in a module in aiM18. Notice that a SqlEntity can contain many SqlTables.

The SqlEntity JSON:

{
	"moduleType":"employee",			//Module name
	"mainTableName":"employee",			//The main table of the module
	"subTableNames":"employeepic;employee_attach", // Sub table name list,separate by ";"
	"employee": a sqlTable to json string ,		//The json can refer to the above sqltable
    "employeepic": a sqlTable to json string ,
	"employee_attach" : a sqlTable to json string 
}

The parameters of SqlEntity:

Name Type Description
moduleType String Module type (as stated in Data Dictionary)
mainTableName String The main table of the module
subTableNames String Sub table name list, separated by semicolon ;
the name of mainTable SqlTable json string The SqlTable JSON
the name of subTable1 SqlTable json string The SqlTable JSON
the name of subTable2 SqlTable json string The SqlTable JSON
... ... ...

# CheckMsg

CheckMsg is a JSON object representing the result info/ messages of various web services in aiM18.

The CheckMsg JSON:

{
    "id":101905,
   	"key":"core_101905",
  	"pass":false,	//When the operation is success, it will be yes;
 	"type":"Error",	//It can be "Error","Info","Warning"
    "info":"required. field(module.required)",		//Info show to ap
    "info_desc":"Required field is empty.",			//Info show to user
  	"exception":"",			//If an exception occurs,exception message will write here.
    "htmlMessage":false,	
    "jsonStr":"",
    "locators":[			//You can find which table and column are wrong with these infos;
            {				
             "colName":"desc",
             "id":0,
             "locatorKey":"employee.desc",
             "row":0,			//Row is only for footer table,for headerTable the row should 0
             "tableName":"employee",
             "type":"Field"
            },
    		{
              "colName":"dept",
              "id":0,
              "locatorKey":"employee.dept",
              "row":0,
              "tableName":"employee",
              "type":"Field"
            }],
   
    "trace":"[ModuleChecker.checkFieldDataDictSetting_458]-[CheckerLib.runChecker_225]-[CawEntityCurdAction.updateEntity_107]-[CawEntityInterceptor.logCall_42]-[view24.updateEntity_-1]"	//You can trace the error in java code with this info.
    
}

The parameters of CheckMsg:

Name Type Description
id long Unique in one app
key String Unique in one app
pass boolean When the operation is success, it will be yes
type String Message type
info String The JSON can refer to the above SqlTable
info_desc String The JSON can refer to the above SqlTable
exception String Exception message
htmlMessage boolean If the message use html code, it will be true
jsonStr json String some special value
locators json Array You can find which table and column are wrong with these infos
trace String The info of java code which returns the error

# Other Useful Class

aiM18 provides other common POJO class definitions and Util methods on Github (opens new window). If your programming language is Java, include these classes in your path.

  1. CheckResult
  2. EntityResult
  3. LocatorType
  4. MsgLocator
  5. MsgType
  6. SqlClassType
  7. SqlTableField
  8. SqlTableIterator
  9. Util
Last Updated: 2025/05/13, 07:58:58
Authentication
Core Services

← Authentication Core Services→

Theme by Vdoing | Copyright © 1990-2025 Multiable | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式