Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
English

Description

Thai

ลักษณะ

  • org.joget.apps.datalist.service.DataListService
  • Under wflow-core module
  • Service class to manage data lists

...

Code Block
languagejava
linenumberstrue
import org.joget.apps.app.dao.DatalistDefinitionDao;
import org.joget.apps.app.model.AppDefinition;
import org.joget.apps.app.model.DatalistDefinition;
import org.joget.apps.app.service.AppService;
import org.joget.apps.app.service.AppUtil;
import org.joget.apps.datalist.model.DataList;
import org.joget.apps.datalist.service.DataListService;
 
AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
DataListService dataListService = (DataListService) AppUtil.getApplicationContext().getBean("dataListService");
DatalistDefinitionDao datalistDefinitionDao = (DatalistDefinitionDao) AppUtil.getApplicationContext().getBean("datalistDefinitionDao");
 
String id = "crm_account";
String appId = "crm";
Long appVersion = appService.getPublishedVersion(appId);
 
AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
DatalistDefinition datalistDefinition = datalistDefinitionDao.loadById(id, appDef);
 
if (datalistDefinition != null) {
    //retrieve the datalist object
    DataList list = dataListService.fromJson(datalistDefinition.getJson());
}

Methods

Thai

กระบวนการ

fromJson
public org.joget.apps.datalist.model.DataList fromJson(String json)

...