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

Jayansh Shinde edited comment on OFBIZ-10966 at 4/27/19 10:30 AM:
------------------------------------------------------------------

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

entityImport[WebtoolsServices.java]
entityImportDir[WebtoolsServices.java]
parseEntityXmlFile[WebtoolsServices.java]


Above services are responsible for importing parsing and validating xml data 
using SAX XML parser class org.apache.ofbiz.entity.util.EntitySaxReader

Similarly export is done by entityExportAll service. 
org.apache.ofbiz.entity.GenericEntity#writeXmlText is ultimately responsible 
for converting entity data to xml data. 

Please refer service definition file for more 
details:../framework/webtools/servicedef/services.xml


was (Author: jayansh):
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)

Reply via email to