use of com.axelor.data.xml.XMLBindJson in project axelor-open-suite by axelor.
the class AppLoaderExportServiceImpl method createJsonModelInput.
protected XMLInput createJsonModelInput(AppDataLoader dataLoader, boolean relationalInput) {
XMLInput xmlInput = createXmlInput(dataLoader);
Map<String, Object> jsonFieldMap = MetaStore.findJsonFields(dataLoader.getModelName());
fixTargetName(jsonFieldMap);
String nodeName = getBindNodeName(xmlInput.getRoot());
XMLBindJson xmlBindJson = new XMLBindJson();
xmlBindJson.setNode(nodeName);
xmlBindJson.setJsonModel(dataLoader.getModelName());
if (!CollectionUtils.isEmpty(dataLoader.getSearchJsonFieldSet())) {
xmlBindJson.setSearch(getJsonSearchFields(dataLoader, jsonFieldMap));
xmlBindJson.setUpdate(true);
}
if (relationalInput) {
xmlBindJson.setCreate(false);
}
xmlBindJson.setBindings(geJsonFieldBinding(jsonFieldMap, dataLoader, relationalInput));
List<XMLBind> rootBindings = new ArrayList<XMLBind>();
rootBindings.add(xmlBindJson);
xmlInput.setBindings(rootBindings);
return xmlInput;
}
Aggregations