Commit Graph
30 Commits
Author SHA1 Message Date
Pawan Verma 91673f1b41 Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.(OFBIZ-5426) (#44)
* Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.
(OFBIZ-5426)

The problem is in the entity model. An email address should not be used in the primary key - mainly because an email address is case-insensitive. A better design would be to use the email address contact mechanism ID in the primary key.

Done Following:
1. Changed Entity Name from ProductPromoCodeEmail to ProductPromoCodeContMech
2. Related Changes for the entity name change
3. Migration service to migrate old data

Thanks, Leon for the report and Adrian Crum, Jacques Le Roux, Ingo Wolfmayr, Deepak Dixit, Pierre Smits and Gil Portenseigne for the discussion and review.

* Improved: Added new line in service definition file and lincence in MigrationServices file.
(OFBIZ-5426)

Thanks, Jacopo for the review.
2020-03-23 17:08:58 +05:30
Michael Brohl 74db8bde12 Improved: Performance optimization for entities in xml data export.
(OFBIZ-10157)

Thanks Kyra Pritzel-Hentley for reporting and providing the patch.
2020-02-25 20:31:53 +01:00
Pawan Verma f25c7d33dc Improved: Enhance the Programmable Export feature for EntityQuery support
(OFBIZ-11158)

EntityQuery usage to perform data fetching is increasing, we should also add support for EntityQuery in ProgramExport feature.

Thanks: Devanshu Vyas for report and patch and Suraj Khurana, Nicolas Malin for the review.
2020-02-22 11:22:34 +05:30
Nicolas Malin 0da10ea897 Fixed: FindGeneric failed to generate forms
(OFBIZ-11335)

The commit 1941a05a34 introduce the visualTheme
to generate a form with FactoryForm and forms present on FindGeneric has been forget

Thanks to Sebastian Berg for raise this issue
2020-02-20 19:34:01 +01:00
Nicolas Malin 91fa4a958c Fixed: Clean unecessary code and convert to groovy syntax
No functional change

The code present on ViewGeneric.groovy has been migrated from bsh script
without deep rewrite.

I removed all unecessary or redund code to lighten the reading
2020-01-29 10:50:30 +01:00
Nicolas Malin 1ee1ec76d6 Fixed: Change 'restMethod' by '_method' in request parameters
(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
2020-01-29 10:50:30 +01:00
Nicolas Malin 6e1c7b5958 Implemented: REST, adding segmented URI support for webtools/entitymaint
(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.
2020-01-09 17:51:12 +01:00
Nicolas Malin 2c58133e50 Improved: Improve webtools/control/FindGeneric
(OFBIZ-11253)
Update the script to generate xml form to introduce new following features :

   * set equals as operator by default on pk instead of contains, when you use a pk on FindGeneric it's in general to resolve it on completed key.
   * add on tooltip the raw field name
   * add possibility to filter on internal field
   * add sort on column

During this work I also view that the ModelFormField contains an 'IF forest' to analyze each field. I rewrote it to consolidate the analyze by type.
2019-11-10 20:14:34 +01:00
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 ac288a4e7d Fixed: Export XML data, ,o proper error message displayed if user misses to
select entities 
(OFBIZ-11125)

No Proper error message is displayed if user misses to select entities from the 
list, and throw error message

Thanks: Jayansh Shinde

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862207 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 12:03:21 +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 a60ebb4de2 Fixed: Allow to create single file if both directory and filename is
provided by user
(OFBIZ-11124)

In framework/webtools XML Data Export I reported an issue, Jayansh fixed it:

If user provided file name and output directory in that case the entity xml 
files are generated at both locations, i.e. at root we have test.xml and in user 
provided output directory we have multiple files with [entityname].xml. 

The expected change would be if user provided both output directory and filename 
then file should be created in given directory with given filename.

Thanks: Jayansh Shinde for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862045 13f79535-47bb-0310-9956-ffa450edef68
2019-06-25 09:36:03 +00:00
Jacques Le Roux 28e119027c Improved: Use Groovy Truth instead of UtilValidate Class in Groovy
(OFBIZ-11064)

As we all know, Groovy is a powerful language with great built-in functions. 
Groovy Truth[1] is one of them, which is not used properly in our code base. 
We have used UtilValidate Class to validate arguments for Empty or NotEmpty, 
which can easily be done in groovy with built-in functionality[1].
 
Current Code: if (UtilValidate.isNotEmpty(locations)) { ... }
Groovy Built-in Code: if (locations) { ... }
 
[1] - http://groovy-lang.org/semantics.html#Groovy-Truth
 
We need to careful for some points while we change this:
Like:
maxRetry = 0
if (!maxRetry)
{  // Not set, use a default  maxRetry = -1 }

Because groovy evaluates zero to be false, it wouldn't be possible to set
maxRetry to zero.  So it's best not to use groovy truth for null-checks on
numbers in some cases. 
 
Thanks: Pawan Verma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860051 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 10:36:16 +00:00
Suraj Khurana 90e70dd2f2 Fixed: Enable entity timestamp fields.
(OFBIZ-10959)
While working on a Production environment, it is found that for some reason entity timestamp fields are disabled at Search Results screen in Trunk and the previous release branch.

Thanks Pawan Verma for reporting the issue and providing the patch, Jacques, Gil, Mathieu for reviewing it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859915 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 08:26:33 +00:00
Deepak Dixit ae496e98c1 Improved: Show title information on Entity Data Maintenance page (OFBIZ-10207)
Thanks Aditya Sharma for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824659 13f79535-47bb-0310-9956-ffa450edef68
2018-02-18 10:23:12 +00:00
Deepak Dixit 0a652486ff Fixed: Fixed typo done at r#1818003
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818606 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 18:38:54 +00:00
Deepak Dixit 7e19de9966 Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818003 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:03:17 +00:00
Deepak Dixit 63258e90f8 Reverted r#1817989, workign fine locally, reverted for now will check and commit again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817998 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 10:42:32 +00:00
Deepak Dixit d1f85a7e5d Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817989 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 09:21:33 +00:00
Deepak Dixit bbd6590816 Fixed: Used entityName instead of null while using FormFactory.readFormDocument method, as this parameter is used to prepare formLocationCache, and its causing issue to view different entity from webtools. Now form will be cached based on enittyName#formName so it will working fine for all possible scenaraio
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817693 13f79535-47bb-0310-9956-ffa450edef68
2017-12-10 11:07:07 +00:00
Deepak Dixit 1cc65c1d2b Fixed: Fixed typo in FindGeneric.groovy, also removed the visualThemeSetId for common theme. Now common theme will be display on backend visual theme popup. (OFBIZ-9138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806216 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 19:04:11 +00:00
Nicolas Malin 10af80b1a8 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step these step break all the UI
#2 The MacroScreenRenderer class now resolve the macro ftl library location from the model theme
The widget.properties lost all definition now managed by the theme definition

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806140 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 09:36:04 +00:00
Deepak Dixit 7bacf44bd4 Improved: Inconsistent String Comparisons, Applied framework groovy patch from jira issue. (OFBIZ-9254)
I found an inconsistency in the code for string comparison statusId.equals("PRUN_COMPLETED") whereas it should be written as "PRUN_COMPLETED".equals(statusId) cause the former can throw NullPointerException if the variable found to be NULL.

Thanks Devanshu Vyas for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1795342 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 17:20:24 +00:00
Jacques Le Roux 8108bf3c8c Improved: When searched from FindGeneric page it looses entityName from the url
(OFBIZ-9341)

Steps to generate:
1. Go to webtools (https://localhost:8443/webtools/control/main)
2. Click on "Entity Engine" (https://localhost:8443/webtools/control/entitymaint)
3. Click on any entity to view (https://localhost:8443/webtools/control/FindGeneric?entityName=AccommodationClass)
4. Click on "search" button (https://localhost:8443/webtools/control/FindGeneric)

When the search is hit, it looses the entityName from the url as it used to 
happen in previous releases and according to the pattern on other search pages.

Thanks: Aditya Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1793254 13f79535-47bb-0310-9956-ffa450edef68
2017-04-30 09:54:58 +00:00
Nicolas Malin 5be9a2f2ad Improved: Improve FindGeneric entity screen with xml form (OFBIZ-9217)
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
2017-02-17 17:00:31 +00:00
Arun Patidar 2bfc816e9b Improved: Removed semicolon from all Groovy files of all components.
(OFBIZ-8652)

Thanks: Rohit Koushal, Jacques Le Roux and Rishi Solanki for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1767764 13f79535-47bb-0310-9956-ffa450edef68
2016-11-02 19:09:13 +00:00
Nicolas Malin 177c83ec1d Performance tests screen has been broken by a bad UtilCache call. Thanks to Pawan Verma for this correction throw OFBIZ-7989.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1757955 13f79535-47bb-0310-9956-ffa450edef68
2016-08-27 07:07:33 +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
Arun Patidar a91b9edae9 Applied patch from ticket - OFBIZ-7339 - Replace EntityUtilProperties getPropertyValue method with correct method calls. Thanks Rahul Singh Kushwah and Rishi Solanki for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749882 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 13:10:51 +00:00
Deepak Dixit 543dd8e488 (OFBIZ-7221) Relocate .groovy files in the framework/webtools component
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747755 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 17:16:22 +00:00