Commit Graph
28 Commits
Author SHA1 Message Date
Mathieu Lirzin daa1e6160e Reverted: JSON entity data import and export utility
(OFBIZ-10966)

Implementation was not matching OFBiz code quality requirements.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867342 13f79535-47bb-0310-9956-ffa450edef68
2019-09-22 12:29:54 +00:00
Jacques Le Roux b16285dd64 Implemented: JSON entity data import and export utility
(OFBIZ-10966)

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
<Party partyId="123456" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
{“Party”: {"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}

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
 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.

jleroux: I fixed 2 trivials things and at my request in last patch Jayansh added 
"JSON Data Export All" and "JSON Data Import Dir

Thanks: Jayansh Shinde 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862206 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 11:49:22 +00:00
Jacques Le Roux 030b6b59de Fixed: EntitySaxReader mostly-insert (store after create-error) Fix
(OFBIZ-1032)

Karl:
Avoids rollback on create error to be able to store the entity instead 
(previous mostly-inserts feature).

Matin:
I think, the data load with "mostly inserts" activated should fail on a 
create-failure (what it does indeed already), so I see no need for a working 
solution of a fallback store attempt. Consistently the Feature should be renamed 
in the frontend from "mostly inserts" to "only inserts".

Kyra:
Additional trivial refactoring in the patch: I reduced the full qualified 
classname of org.xml.sax.SAXException in method signatures to the simple name.

This incorperates the changes that Martin has mentioned above. 
The unnecessary call to store() is removed, simplifying the process of creating 
and deleting entities. (These changes were already in Martins old patch but had 
the wrong format.) This means that the flag "mostly Inserts?" is not accurately 
worded since as long as there is only create fail, all operations are rolled 
back. So the second patch renames the flag and all appropriate parameters to 
"onlyInserts". 

jleroux: I made few no functional changes, apart not swallowing an exception

Thanks: Thanks Karl for the 1st patch, Martin to get further, and Kyra to 
complete the whole with a final touch and help to quickly test

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822310 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 15:13:42 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Jacques Le Roux 6455c9382c A sightly modified patch from Wai for "ofbizsetup create product store cause exception, remove use of temp file to load entity data" - https://issues.apache.org/jira/browse/OFBIZ-5949
The exception is caused by foreign key constraint violation between ShipmentCostEstimate and  CarrierShipmentMethod entities.
Currently, when creating a new product store using ofbizsetup component default data associated with the product store is loaded into the database using the following steps.
1. read default data from entity xml file and replace specific items in the read data and write to temp file.
2. use service=parseEntityXmlFile to load the processed file into database.
The issue with this method is that the temp file can present a problem when ofbiz is operating in multitenant mode.
The solution is to modify the relevant services so that no temp file needs generated.

jleroux: I simply used an UtilValidate.isNotEmpty() method in  EntitySaxReader class

I was initially reluctant to these changes because you can no longer load the content of the GlAccountData.xml and ProductStoreData.xml files, or the files themselves, using the import XML feature of webtools. But those files are specific to the setup component, so they should not be missed, they are supposed to be used in this context only.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1740008 13f79535-47bb-0310-9956-ffa450edef68
2016-04-19 21:09:14 +00:00
Jacopo Cappellato e2a23a25a8 Removed from "parseEntityXmlFile" the useless require-new-transaction="true" because in this service definition we have use-transaction="false"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1609149 13f79535-47bb-0310-9956-ffa450edef68
2014-07-09 13:51:04 +00:00
Hans Bakker 7952083abd In 'data export all' be able to select a fromdate , tabs to spaces in a birt file from last commit. Contribution from Chattree
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1294048 13f79535-47bb-0310-9956-ffa450edef68
2012-02-27 07:33:05 +00:00
Adrian Crum 02705185ea Refactored the Webtools Label Manager - due to a multitude of problems. Most notably:
1. Not thread safe.
2. Server files were being read/written without multi-user synchronization
3. Reads all UI labels into memory, then stores them in static memory, PLUS
4. Finds all references of those labels in project files and store those references in static memory (!!!)
5. Doesn't follow best practices for UI layout

It's amazing the original code worked. Even more amazing is the fact that this code made it into the project.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@776988 13f79535-47bb-0310-9956-ffa450edef68
2009-05-21 07:26:22 +00:00
Jacques Le Roux b9c3ddef08 2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty)
Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg)

Of course this effort to remove trailing spaces has no functional implications.

Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135
In the meantime I did some refactoring also in *.java and *.groovy files :
){ => ) {
if( => if (
while( => while (
}else => } else
else{ => else {
switch( => switch (
try{ => try {
}catch => } catch
catch( => catch (
}finally{ => } finally {

So these changes are also in this commit, should not be a problem anyway.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 10:54:51 +00:00
Jacques Le Roux ccadfbacbb LabelReferences4.patch from Marco "New tool to get labels information" https://issues.apache.org/jira/browse/OFBIZ-2070 OFBIZ-2070
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@748732 13f79535-47bb-0310-9956-ffa450edef68
2009-02-27 23:01:41 +00:00
Jacques Le Roux d5dc2d53ab Marco's LabelReferences2.patch from "New tool to get labels information" https://issues.apache.org/jira/browse/OFBIZ-2070 - OFBIZ-2070
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@744635 13f79535-47bb-0310-9956-ffa450edef68
2009-02-15 08:42:06 +00:00
David E. Jones ba3a806edf Changed a couple of services to allow any html (ie not filter for HTML) as they are for incoming XML; related to issue #OFBIZ-2189
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@744177 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 17:03:35 +00:00
Jacques Le Roux 5abb9596cb LabelsInfo14.patch from Marco "New tool to get labels information" (https://issues.apache.org/jira/browse/OFBIZ-2070) - OFBIZ-2070
+ some correct changes done with this update of Labels Manager (I updated some wrong ones by hand to keep going forward...)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@739955 13f79535-47bb-0310-9956-ffa450edef68
2009-02-02 10:17:34 +00:00
Jacques Le Roux 93d458ba1f LabelsInfo13.patch by Marco from "New tool to get labels information" (https://issues.apache.org/jira/browse/OFBIZ-2070) - OFBIZ-2070
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@737491 13f79535-47bb-0310-9956-ffa450edef68
2009-01-25 08:41:44 +00:00
Jacques Le Roux 8bfaac2648 A modified patch from Marco Risaliti "New tool to get labels information" (https://issues.apache.org/jira/browse/OFBIZ-2070) - OFBIZ-2070
I have already commited merged changes in labels files. I commented out for now the lines in SaveLabelsToXmlFile.java which write the XML changes.
We have, at least, known 2 issued related to SaveLabelsToXmlFile :
. adding the ASL header
. taking care of labels sorting in a case described here https://issues.apache.org/jira/browse/OFBIZ-2070?focusedCommentId=12660632#action_12660632

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@731370 13f79535-47bb-0310-9956-ffa450edef68
2009-01-04 21:44:14 +00:00
Jacques Le Roux 101fe6961c A slightly modified patch from Bruno Busco "Updating Webtool JobList to use PerformFind and FindScreenDecorator" '(https://issues.apache.org/jira/browse/OFBIZ-2103) - OFBIZ-2103
with some i18n and French l10n


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@730990 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 14:33:01 +00:00
Jacopo Cappellato 7c53cb34bf Misc enhancements to the 'find job' screen.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@638063 13f79535-47bb-0310-9956-ffa450edef68
2008-03-17 21:01:52 +00:00
David E. Jones be576cbf0c A bunch of fixes and refinements, completed first pass of successful full load for all entities/services, and an export of eomodeld forand service and an export for one service
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@633402 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 09:28:48 +00:00
David E. Jones e8d61ef0b7 Added initial implementation of entity EOModelBundle export, including various utility methods and refactoring and such
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@630279 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 18:17:21 +00:00
Adrian Crum cdd0e8517c Improved Webtools job management screen. Patch submitted by Anil Soni - https://issues.apache.org/jira/browse/OFBIZ-1553 - with additional modifications by me.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@607446 13f79535-47bb-0310-9956-ffa450edef68
2007-12-29 17:13:35 +00:00
Adrian Crum cc6e7576e9 More Webtools Entity Reference screen work. Also converted Webtools services to use a permission service. Converted EntityRefMain.bsh to a service - so that the entity reference data can be obtained through a service call.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@593644 13f79535-47bb-0310-9956-ffa450edef68
2007-11-09 20:38:03 +00:00
David E. Jones f64294339b Implemented a new feature to do a check on data files with no changes to the database instead of loading the data; this includes some refactoring of other classes that do this and a few improvements as well based on some testing
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@564565 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 11:47:37 +00:00
David E. Jones 7d70c41c12 Did a big search/replace to change all xsd file refs from www.ofbiz.org to ofbiz.apache.org
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@539504 13f79535-47bb-0310-9956-ffa450edef68
2007-05-18 15:47:14 +00:00
David E. Jones 2c2d161929 Added page for importing from readers; this is especially helpful when updating a server and you need to refresh the seed data, but of course there are many other uses
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@509764 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 21:41:15 +00:00
Jacques Le Roux dad67935f7 A (large) patch from Scott Gray "Update ASL header" (https://issues.apache.org/jira/browse/OFBIZ-637).
I put also some svn:ignore for shark build and lib diretories and assetmaint/build 

I did some by hand lately, too much to remember. They were files with old header but without copyright. A 1st attempt I suppose, will have to check this after this commit.

I add some problems to commit this patch in one piece because it's so huge (specially with Eclipse I had to turn to Tortoise) !

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@499486 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 17:15:54 +00:00
Si Chen e0a3335a1d Turned off transactions for webtools import services because the service transactions were setting timeouts to 60 seconds, regardless of what the import code was doing, at least with PostgreSQL
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@433334 13f79535-47bb-0310-9956-ffa450edef68
2006-08-21 19:26:56 +00:00
Jacopo Cappellato 5d2d106881 License change from MIT to ASL2.0 for the files of the webtools component.
Thanks to Scott Gray for the patch (Apache OFBIZ-87).

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@423823 13f79535-47bb-0310-9956-ffa450edef68
2006-07-20 08:30:37 +00:00
David E. Jones 94fe6d1cda Initial OFBiz import from revision 7923 of the old svn.ofbiz.org SVN repository.
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@418498 13f79535-47bb-0310-9956-ffa450edef68
2006-07-01 19:05:20 +00:00