You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jayansh Shinde (JIRA)" <ji...@apache.org> on 2019/04/27 10:26:00 UTC

[jira] [Commented] (OFBIZ-10966) JSON entity data import and export utility

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

Jayansh Shinde commented on OFBIZ-10966:
----------------------------------------

Lets have a look at main services used during Xml data import:

 

{color:#000000}entityImport[WebtoolsServices.java]{color}

{color:#000000}entityImportDir[WebtoolsServices.java] {color}

{color:#333333}parseEntityXmlFile[WebtoolsServices.java]{color}

 

{color:#000000}Above services are responsible for importing parsing and validating xml data using SAX XML parser class org.apache.ofbiz.entity.util.EntitySaxReader{color}{color:#008000}{color:#000000}Similarly export is done by {color}{color:#000000}*entityExportAll* {color}{color:#000000}*service.*{color} ** {color:#000000}_org.apache.ofbiz.entity.GenericEntity#writeXmlText_{color}{color:#000000} is ultimately responsible for converting entity data to xml data. {color}{color}{color:#008000}{color:#000000}Please refer service definition file for more details:{color}{color:#000000}../framework/webtools/servicedef/services.xml{color}{color}

 

 

> 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
(v7.6.3#76005)