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

2019-12-16 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 12/17/19 6:13 AM:
--

Hi Mathieu, I tried the test cases this weekend and they worked without any 
issue. As you suggested earlier, I will try replacing reflection code by next 
weekend.


was (Author: jayansh):
Hi Mathieu, I tried the test cases this weekend and they worked without an 
issue. As per your suggestion, I will replace reflection code and will provide 
new patch.

> 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: Jayansh Shinde
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966_27062019.patch, OFBiz-10966.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}
> 
> {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, 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
(v8.3.4#803005)


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

2019-08-29 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 8/29/19 9:33 AM:
-

Hi Mathieu,

Please review patch I uploaded. 

In this patch:[^OFBiz-10966.patch]

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 


was (Author: jayansh):
Hi Mathieu,

Please review patch I uploaded. 

In this patch:

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 

> 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: Mathieu Lirzin
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966_27062019.patch, OFBiz-10966.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}
> 
> {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, 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
(v8.3.2#803003)


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

2019-08-29 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 8/29/19 9:32 AM:
-

Hi Mathieu,

Please review patch I uploaded. 

In this 
patch:https://issues.apache.org/jira/secure/attachment/12978859/OFBiz-10966.patch

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 


was (Author: jayansh):
Hi Mathieu,

Please review patch I uploaded. 

In this patch:

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 

> 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: Mathieu Lirzin
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966.patch, OFBIZ-10966_27062019.patch, 
> OFBiz-10966.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}
> 
> {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, 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
(v8.3.2#803003)


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

2019-08-29 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 8/29/19 9:32 AM:
-

Hi Mathieu,

Please review patch I uploaded. 

In this patch:

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 


was (Author: jayansh):
Hi Mathieu,

Please review patch I uploaded. 

In this 
patch:https://issues.apache.org/jira/secure/attachment/12978859/OFBiz-10966.patch

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 

> 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: Mathieu Lirzin
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966.patch, OFBIZ-10966_27062019.patch, 
> OFBiz-10966.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}
> 
> {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, 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
(v8.3.2#803003)


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

2019-08-29 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 8/29/19 7:57 AM:
-

Hi Mathieu,

Please review patch I uploaded. 

In this patch:

Simplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 


was (Author: jayansh):
Hi Mathieu,

Please review patch I uploaded. 

In this patch:

Supplified source code for easy understanding.

Added test cases as requested.

Added missing java doc.

Please let me know if you see anything missing.

Thanks,

Jay

 

 

> 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: Mathieu Lirzin
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966.patch, OFBIZ-10966_27062019.patch, 
> OFBiz-10966.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}
> 
> {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, 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
(v8.3.2#803003)


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

2019-08-22 Thread Jayansh Shinde (Jira)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 8/22/19 9:10 AM:
-

Hi, I will start soon on pending things, and will try to provide you necessary 
stuff by this month end. 


was (Author: jayansh):
Hi Matheiu, I will start back on same, and will try to provide you necessary 
stuff by this weekend. 

> 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: Mathieu Lirzin
>Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10966.patch, 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}
> 
> {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, 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
(v8.3.2#803003)


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

2019-07-06 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 7/6/19 12:38 PM:
--

I found one more bug, created one more ticket here:

OFBIZ-11125 


was (Author: jayansh):
I found one more bug, created one more ticket here:

https://issues.apache.org/jira/browse/OFBIZ-11125 

> 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: Mathieu Lirzin
>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}
> 
> {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, 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)


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

2019-07-06 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 7/6/19 12:38 PM:
--

Hi Jacques

I created ticket for xml issue as per your suggestion. I have fixed same with 
json, I will upload patch by this week for xml as well.

OFBIZ-11124


was (Author: jayansh):
Hi Jacques

I created ticket for xml issue as per your suggestion. I have fixed same with 
json, I will upload patch by this week for xml as well.

https://issues.apache.org/jira/browse/OFBIZ-11124

> 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: Mathieu Lirzin
>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}
> 
> {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, 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)


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

2019-06-28 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 6/28/19 11:48 AM:
--

Hi Jacques/Mathieu,

Thank you for pointing this out, I will change it to jackson, and remove
 the dependency. This is a mistake, as library is there already I should have 
implemented same. This is what we practice, but don't know how I missed it. 

 


was (Author: jayansh):
Hi Jacques/Mathieu,

Thank you for pointing this out, I will change it to jackson, and remove
the dependency. I will keep posted.


On Fri, Jun 28, 2019 at 3:00 PM Jacques Le Roux (JIRA) 



> 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: Mathieu Lirzin
>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}
> 
> {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, 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)


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

2019-06-28 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/28/19 9:29 AM:
--

You don't need to apologise Mathieu. Actually I [somehow knew 
it|https://markmail.org/message/4cm5vjuqr4zeym7p] (tend to forget things with 
age :P) but was lazy (hè it was 36°c yesterday, and we wait for 45°c today - 
higher temp ever in France ;)). I'm happy you spotted it, opportunities for 
youth :D. 


was (Author: jacques.le.roux):
You don't need to apologise Mathieu. Actually I [somehow knew 
it|https://markmail.org/message/4cm5vjuqr4zeym7p] (tend to forget things with 
age :P) but was lazy (hè it was 36°c yesterday, and we wait for 45°c today ;)). 
I'm happy you spotted it, opportunities for youth :D. 

> 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: Mathieu Lirzin
>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}
> 
> {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, 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)


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

2019-06-27 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/27/19 9:33 PM:
--

I agree Mathieu, I thought about it. I let you take over :)

Please assign yourself...


was (Author: jacques.le.roux):
I agree Mathieu, I thought about it. I let you take over :)

> 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}
> 
> {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, 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)


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

2019-06-24 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/24/19 5:28 PM:
--

Hi Jacques,

I am attaching new patch, this includes Import from Directory and Export All 
entities as well. 

But there is know bug in parsing, I working on same. This is regarding 
special/escape charters in JSON, entities like ElectronicText has html text and 
it has character like new line, tab, quote etc, which are giving me issue 
during import. 

I also removed bigger image and put smaller one ;).

I will open new Jira ticket tomorrow.

Thanks again!! 

[^OFBIZ-10966_24062019.patch]


was (Author: jayansh):
Hi Jacques,

I am attaching new patch, this includes Import from Directory and Export All 
entities as well. 

But there is know bug in parsing, I working on same. This is regarding 
special/escape charters in JSON, entities like ElectronicText has html text and 
it has character like new line, tab, quote etc, which are giving me issue 
during import. 

I also removed bigger image and put smaller one ;).

I will open new Jira ticket tomorrow.

Thanks again!! 

[^OFBIZ-10966_24062019.patch]

 

 

 

> 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: Jayansh Shinde
>Priority: Minor
> Attachments: OFBIZ-10966.patch, OFBIZ-10966_24062019.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}
> 
> {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, 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)


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

2019-06-24 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 6/24/19 1:42 PM:
-

Hi Jacques,

I am attaching new patch, this includes Import from Directory and Export All 
entities as well. 

But there is know bug in parsing, I working on same. This is regarding 
special/escape charters in JSON, entities like ElectronicText has html text and 
it has character like new line, tab, quote etc, which are giving me issue 
during import. 

I also removed bigger image and put smaller one ;).

I will open new Jira ticket tomorrow.

Thanks again!! 

[^OFBIZ-10966_24062019.patch]

 

 

 


was (Author: jayansh):
Hi Jacques,

I am attaching new patch, this also include Import from Directory and Export 
All entities as well. 

But there is know bug in parsing, I working on same. This is regarding 
special/escape charters in JSON, entities like ElectronicText has html text and 
it has character like new line, tab, quote etc, which are giving me issue 
during import.

I also removed bigger image and put smaller one ;).

I will open new Jira ticket tomorrow.

Thanks again!! 

[^OFBIZ-10966_24062019.patch]

 

 

 

> 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: Jayansh Shinde
>Priority: Minor
> Attachments: OFBIZ-10966.patch, OFBIZ-10966_24062019.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}
> 
> {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, 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)


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

2019-06-24 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/24/19 10:41 AM:
---

Hi Jacques,

This is my mistake, I should have uploaded screenshots, what's included in this 
patch, currently we have only 2 pages Import Json and Export Json as we have 
for xml, I will try to complete "JSON Data Export All" and "JSON Data Import 
Dir" by this week. what else is missing, do you thing its worth adding "JSON 
Data Import Readers".

I am on ubuntu, I will check this on windows today. There we can use 
File.separator instead of slach or antislash to avoid platform specific issues.


was (Author: jayansh):
Hi Jacques,

This is my mistake, I should have uploaded screenshots, what's included in this 
patch, currently we have only 2 pages Import Json and Export Json as we have 
for xml, I will try to complete "JSON Data Export All" and "JSON Data Import 
Dir" by this week. what else is missing, do you thing its worth adding "JSON 
Data Import Readers".

I am on ubuntu, I will check this on windows today. There we can use 
File.separator instead of "/" or "\\" to avoid platform specific issues.

> 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: Jayansh Shinde
>Priority: Minor
> Attachments: OFBIZ-10966.patch, 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}
> 
> {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, 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)


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

2019-06-24 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/24/19 10:38 AM:
---

Hi Jacques,

This is my mistake, I should have uploaded screenshots, what's included in this 
patch, currently we have only 2 pages Import Json and Export Json as we have 
for xml, I will try to complete "JSON Data Export All" and "JSON Data Import 
Dir" by this week. what else is missing, do you thing its worth adding "JSON 
Data Import Readers".

I am on ubuntu, I will check this on windows today. There we can use 
File.separator instead of "/" or "\\" to avoid platform specific issues.


was (Author: jayansh):
Hi Jacques,

This is my mistake, I should have uploaded screenshots, what's included in this 
patch, currently we have only 2 pages Import Json and Export Json as we have 
for xml, I will try to complete "JSON Data Export All" and "JSON Data Import 
Dir" by this week. what else is missing, do you thing its worth adding "JSON 
Data Import Readers".

I am on ubuntu, I will check this on windows today. There we can use 
File.separator instead of "/" or "\\" to avoid platform specific issues. 
!importJson.png!

 

!exportJson.png!

> 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: Jayansh Shinde
>Priority: Minor
> Attachments: OFBIZ-10966.patch, 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}
> 
> {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, 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)


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

2019-06-23 Thread Jacques Le Roux (JIRA)


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

Jacques Le Roux edited comment on OFBIZ-10966 at 6/23/19 7:20 AM:
--

Hi Jayansh,

I did not really review, only glanced through the patch. It applies and sounds 
good at 1st glance. I noticed we miss entries in webtools main page. I guess a 
"Entity Json Tools" with related entries would fit. With "Import/Export" menu I 
can see the 2 Json export and import sub-menus. I wonder if we should not have 
the same options than for XML. Maybe not all, "export all", "import dir", 
others?

I only tried to export all entities. I'm on Windows 7. I'm not sure why I got 
refused access, even on my own directories {{(c:\users\...)}} and in admin mode 
in root {{(c:\ )}}. Anyway I get the same with XML export. I was OK last time I 
tried, certainly a local issue. Not a problem with your patch because using the 
"Out to browser" option works.

So it needs more reviews but it sounds a good start to me.


was (Author: jacques.le.roux):
Hi Jayansh,

I did not really review, only glanced through the patch. It applies and sounds 
good at 1st glance. I noticed we miss entries in webtools main page. I guess a 
"Entity Json Tools" with related entries would fit. With "Import/Export" menu I 
can see the 2 Json export and import sub-menus. I wonder if we should not have 
the same options than for XML. Maybe not all, "export all", "import dir", 
others?

I only tried to export all entities. I'm on Windows 7. I'm not sure why I got 
refused access, even on my own directories (user\...) and in admin mode in root 
(c:):(. Anyway I get the same with XML export. I was OK last time I tried, 
certainly a local issue. Not a problem with your patch because using the "Out 
to browser" option works.

So it needs more reviews but it sounds a good start to me.

> 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: Jayansh Shinde
>Priority: Minor
> Attachments: OFBIZ-10966.patch
>
>
> 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}
> 
> {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, 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)


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

2019-04-30 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 5/1/19 4:42 AM:


Thanks Nicolas!

I think just adding tags create/create-update/create-replace/delete as root 
element, absent of this root tags will be treated as "create-update" 
by-default. Handling would be similar to current implementation.

 
{code:java}
 {"create-replace": {“Party”: 
{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
,{"Product": {"productId": "10001", "productName":"Round Hat", "InternalName": 
"RoundHat" }}}
{code}
Please help me out if you have any better idea!


was (Author: jayansh):
Thanks Nicolas!

I think just adding tags create/create-update/create-replace/delete as root 
element, absent of this root tags will be treated as "create" by-default. 
Handling would be similar to current implementation.

 {code}
 {"create-replace": {“Party”: 
{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
,{"Product": {"productId": "10001", "productName":"Round Hat", "InternalName": 
"RoundHat" }}}
{code}
 Please help me out if you have any better idea!

> 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
>
> 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}
> 
> {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, 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)


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

2019-04-30 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 5/1/19 4:42 AM:


Thanks Nicolas!

I think just adding tags create/create-update/create-replace/delete as root 
element, absent of this root tags will be treated as "create-update" 
by-default. Handling would be similar to current implementation.

 
{code:java}
 {"create-replace": {“Party”: 
{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
,{"Product": {"productId": "10001", "productName":"Round Hat", "InternalName": 
"RoundHat" }}}
{code}
Please help me out if you have any better idea!

Reference: 
[https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data]


was (Author: jayansh):
Thanks Nicolas!

I think just adding tags create/create-update/create-replace/delete as root 
element, absent of this root tags will be treated as "create-update" 
by-default. Handling would be similar to current implementation.

 
{code:java}
 {"create-replace": {“Party”: 
{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
,{"Product": {"productId": "10001", "productName":"Round Hat", "InternalName": 
"RoundHat" }}}
{code}
Please help me out if you have any better idea!

> 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
>
> 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}
> 
> {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, 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)


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

2019-04-27 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 4/27/19 1:17 PM:
-

Reference [https://www.jsonschemavalidator.net/] for json validation against 
json schema.

Tried data:


{"Party": 
{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED"},
"Product": {"productId":"654321", "productName": "Round Hat"}} 




was (Author: jayansh):
Reference [https://www.jsonschemavalidator.net/] for json validation against 
json schema

> 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:#00}_{“Party”: 
> \{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}_{color}
>  
> {color:#00}*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:#00}Our suggestion that Json data must be validated via a json 
> schema during upload.{color}{color:#00}R{color}{color:#00}efer 
> {color}{color:#00}[https://json-schema.org/] {color}{color:#00}for 
> more information on json schema.{color}_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


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

2019-04-27 Thread Jayansh Shinde (JIRA)


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

Jayansh Shinde edited comment on OFBIZ-10966 at 4/27/19 1:15 PM:
-

Reference [https://www.jsonschemavalidator.net/] for json validation against 
json schema


was (Author: jayansh):
Reference [https://jsonschema.net/] for json validation against json schema

> 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:#00}_{“Party”: 
> \{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}_{color}
>  
> {color:#00}*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:#00}Our suggestion that Json data must be validated via a json 
> schema during upload.{color}{color:#00}R{color}{color:#00}efer 
> {color}{color:#00}[https://json-schema.org/] {color}{color:#00}for 
> more information on json schema.{color}_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


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

2019-04-27 Thread Jayansh Shinde (JIRA)


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

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

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 and write it to DB. Similar to:


private void writeValues(List 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#writeXmlText 


was (Author: jayansh):
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 and write it to DB. Similar to:


private void writeValues(List 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:#00}_{“Party”: 
> \{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}_{color}
>  
> {color:#00}*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:#00}Our suggestion that Json data must be validated via a json 
> schema during upload.{color}{color:#00}R{color}{color:#00}efer 
> {color}{color:#00}[https://json-schema.org/] {color}{color:#00}for 
> more information on json schema.{color}_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


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

2019-04-27 Thread Jayansh Shinde (JIRA)


[ 
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:#00}entityImport[WebtoolsServices.java]{color}

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

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

 

{color:#00}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:#00}Similarly
 export is done by {color}{color:#00}*entityExportAll* 
{color}{color:#00}*service.*{color} ** 
{color:#00}_org.apache.ofbiz.entity.GenericEntity#writeXmlText_{color}{color:#00}
 is ultimately responsible for converting entity data to xml data. 
{color}{color}{color:#008000}{color:#00}Please refer service definition 
file for more 
details:{color}{color:#00}../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:#00}_{“Party”: 
> \{"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}_{color}
>  
> {color:#00}*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:#00}Our suggestion that Json data must be validated via a json 
> schema during upload.{color}{color:#00}R{color}{color:#00}efer 
> {color}{color:#00}[https://json-schema.org/] {color}{color:#00}for 
> more information on json schema.{color}_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)