You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2019/06/27 11:52:00 UTC
[jira] [Closed] (OFBIZ-10966) JSON entity data import and export
utility
[ https://issues.apache.org/jira/browse/OFBIZ-10966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux closed OFBIZ-10966.
-----------------------------------
Resolution: Implemented
Assignee: Jacques Le Roux (was: Jayansh Shinde)
Fix Version/s: Upcoming Branch
Thanks Jayansh,
Your slightly modified patch is in trunk at revision: 1862206
While testing, I have noticed 2 trivial things I fixed
# The web page title of EntityImportJson was "Web Tools: XML Data Import"
# You added commons-text:1.6 in build.gradle, it's already there
You also added org.json:json:20140107, not the latest version. I understand that this is for legal reason (license: http://www.apache.org/legal/resolved.html#json), and it's OK
> 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
> Assignee: Jacques Le Roux
> Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966_27062019.patch, OFBiz-Web-Tools-JSON-Data-Export-All.png, OFBiz-Web-Tools-JSON-Data-Import-Dir.png, exportJson.png, importJson.png
>
>
> Currently, we support import/export entity data in XML format.
> Nowadays JSON is widely used in industry, we can have support for JSON format which looks quite similar to XML support.
> Here is example of XML data and it's JSON version
> {code:java}
> <Party partyId="123456" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
> {code}
> {code:java}
> {“Party”: {"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
> {code}
>
> *Design Proposal*
> We can write *entityImportJson* and *entityImportDirJson* services for importing JSON from screen and directory respectively.
> And the *entityExportAllJson* service for exporting entity data in JSON.
>
> *Import Design*
> The import service will perform following operations:
> 1.) Validate the input JSON data (I am in process of exploring the way for this)
> 2.) On successful validation, convert JSON to OFBiz's entity model (GenericValue)
> 3.) The GenericValue will be inserted in database by some handler class for e.g we can write JsonDataHandler, it will convert given JSON to List<GenericValue>, and finally write it to database (Similar pattern is used in XML import).
>
> *Export Design*
> Based on existing XML pattern the writeXmlText method of GenericEntity class write the exported data in XML format.
> In the similar way, we can implement writeJsonText to export data in JSON format.
> Please free feel to share your thought.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)