ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jayansh Shinde (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-10966) JSON entity data import and export utility
Date Sat, 27 Apr 2019 10:28:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-10966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16827552#comment-16827552

Jayansh Shinde commented on OFBIZ-10966:

The import service will read the json data and validate it and then convert same to ofbiz’s
entity data(GenericEntity) and commit to database using some handler class. e.g. JsonDataHandler
convert given json data to List<GenericValue> and write it to DB. Similar to:

private void writeValues(List<GenericValue> valuesToWrite) throws GenericEntityException
    if (this.checkDataOnly) {
        EntityDataAssert.checkValueList(valuesToWrite, delegator, this.getMessageList());
    } else {
        delegator.storeAll(valuesToWrite, new EntityStoreOptions(createDummyFks));

Export service may require new method (org.apache.ofbiz.entity.GenericEntity#writeJsonText)
similar to existing org.apache.ofbiz.entity.GenericEntity#writeXmlTex

> JSON entity data import and export utility
> ------------------------------------------
>                 Key: OFBIZ-10966
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10966
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>            Reporter: Jayansh Shinde
>            Priority: Minor
> *Entity data import/export in JSON format*
> Currently, we have support to import/export entity data in XML format. We are required
to have support for JSON format which looks quite similar to XML support. We are summarizing
how current data looks and how its done in current system and proposing how it should be done.
> Just an example the existing xml data may look like:
> {color:#008080}<{color}{color:#3f7f7f}Party{color} {color:#7f007f}partyId{color}{color:#3c3c3c}={color}{color:#2a00ff}_"_{color}{color:#2a00ff}_123456_{color}{color:#2a00ff}_"_{color}
{color:#7f007f}partyTypeId{color}{color:#3c3c3c}={color}{color:#2a00ff}_"PERSON"_{color} {color:#7f007f}statusId{color}{color:#3c3c3c}={color}{color:#2a00ff}_"PARTY_ENABLED"_{color}{color:#008080}/>{color}
> same proposed JSON data will look like:
> {color:#000000}_{“Party”: \{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}_{color}
> {color:#000000}*Proposal:*{color}
> _Services can be *entityImportJson* and *entityImportDirJson* for importing json from
screen and directory respectively. And *entityExportAllJson* for exporting entity data in
JSON, similar to existing services for xml. {color:#000000}Our suggestion that Json data
must be validated via a json schema during upload.{color}{color:#000000}R{color}{color:#000000}efer
{color}{color:#000000}[https://json-schema.org/] {color}{color:#000000}for more information
on json schema.{color}_

This message was sent by Atlassian JIRA

View raw message