(OFBIZ-11007)
Some issue has been introduce on the previous commit 6e1c7b5 [1], corrected by this one :
* the view link on ListGeneric failed
* the paginate on ListGeneric failed
I also simplify the url writing with delegate the entity path generation and translation
to two function on EntityUtil : entityToPath and getPkValuesMapFromPath
thanks to Pawan Verma to spot the pagination problem
[1] https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=6e1c7b5
(OFBIZ-11007)
After implemeted Rest mechanism on rev. 1868963 by Mathieu Lirzin,
I reviewed the rest url implemented by Artemiy Rozovyk for entitymaint in webtools.
With discussion with Mathieu and Leila, I selected this pattern :
entity/[cover]/{entityName}/{pkValues: .*}
and implemented like this :
entity/list -> list all entities
entity/find/Party -> search
entity/find/Party/Company -> displaying form for Party with id Company
entity/create/Party -> creation form for a Party
entity/edit/Party/Company/Company -> edit form for Party with id Company
entity/change/Party/Company -> call crud following given http method
entity/relations/Party -> View relation for Party
The old uris were currently kept and the oldest GenericWebEvent.updateGeneric() were updated to support rest method information.
Thanks Mathieu, Artemiy and Leila for their help to complete this improvement.
(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
(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
Replace the current groovy and ftl form rendering by a dynamic call to screen xml with build the xml form by analyse the entity
The find operation is now realize by the perfomFind service
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1783427 13f79535-47bb-0310-9956-ffa450edef68
============================================================
relocate .ftl files in the framework/webtools component
============================================================
Thanks Pierre Smits for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738581 13f79535-47bb-0310-9956-ffa450edef68