Commit Graph
1427 Commits
Author SHA1 Message Date
Suraj Khurana 8b1e0dbd85 Improved: Corrected all checkstyle formatting issues: 'typecast' is not followed by whitespace in framework component.
(OFBIZ-11887)
2020-07-18 12:26:42 +05:30
holivier 91fe7bf4cc Documented: Framework, delete all docbook files related to migration to
asciidoc
(OFBIZ-11587)

- common-sending-email: include in email
- datafile: move as a include at the end of entity-engine section
- entity-engine: list of link to OFBiz wiki about entity configuration
- service-engine: a link to OFBiz wiki Service Engine Guide
- webtools: help for main screen
- mini-lang: include a link to OFBiz wiki mini-lang-reference at the
beginning of minilang-to-groovy-manual
           move minilang-to-groovy-manual to Development environment
section
- unit-test: include as Junit test, and use README to list gradle
command available (so add a tag in REAME.adoc)
- base: add a link to OFBiz wiki Configuration Guide, in deployment
section
- SingleSignOn with LDAP: move to plugin LDAP and include in deployment
section
2020-07-14 17:04:36 +02:00
holivier b0f445b123 Documented: Framework, migration all docbook files to asciidoc
(OFBIZ-11587)

- common-sending-email: include in email
- datafile: move as a include at the end of entity-engine section
- entity-engine: list of link to OFBiz wiki about entity configuration
- service-engine: a link to OFBiz wiki Service Engine Guide
- webtools: help for main screen
- mini-lang: include a link to OFBiz wiki mini-lang-reference at the
beginning of minilang-to-groovy-manual
           move minilang-to-groovy-manual to Development environment
section
- unit-test: include as Junit test, and use README to list gradle
command available (so add a tag in REAME.adoc)
- base: add a link to OFBiz wiki Configuration Guide, in deployment
section
- SingleSignOn with LDAP: move to plugin LDAP and include in deployment
section

developer-manual is updated with some include lines or with directly a
sentence.
2020-07-14 16:56:05 +02:00
Suraj Khurana 0c37e80036 Improved: Corrected all checkstyle formatting issues: Line has trailing spaces in framework component.
(OFBIZ-11880)
Thanks Jacques for review.
2020-07-13 14:18:24 +05:30
Suraj Khurana dd4da77d76 Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for framework component.
(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.
'{' is not followed by whitespace.
'}' is not followed by whitespace.
'}' is not preceded with whitespace.
'typecast' is not followed by whitespace.
'try' is not followed by whitespace.
';' is preceded with whitespace.
2020-07-11 14:33:47 +05:30
Pawan Verma 5c27d7ad5b Improved: Introduce support for having condition in EntityQuery#queryList method(OFBIZ-11846)
Thanks, Nitish and Suraj for review.
2020-07-11 09:36:13 +05:30
Suraj Khurana 3bb22302c7 Improved: Corrected all checkstyle issues related to succeeding space for comma in framework directory.
(OFBIZ-11805)
Thanks Jacques and Ritesh Kumar for review.
2020-07-09 12:07:29 +05:30
Suraj Khurana fc6b8a6ca3 Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
2020-07-07 15:08:17 +05:30
Suraj Khurana bbfb390fb8 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 2020-07-06 15:31:59 +05:30
Suraj Khurana 4f53828bea Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
Thanks Jacques Le Roux and Ritesh Kumar for review.
2020-07-06 15:29:58 +05:30
Pawan Verma 71ac32c89b Implemented: EntityBatchIterator which pages through large resultsets (500 at a time by default) and added support for EntityBatchIterator to EntityQuery via 'queryBatchIterator'(OFBIZ-11789) (#191)
Modified GenericDao#makeOffsetString to have OFFSET/FETCH style by default
Modified entityengine's mysql and postgres datasources to have LIMIT/OFFSET style, rest can work with default OFFSET/FETCH style

Thanks: Scott for the help.
2020-07-04 23:02:47 +05:30
Pawan Verma 031592cc32 Fixed: EntityQuery queryCount is throwing error with distinct method (OFBIZ-11294)
Added missing support for selectFields in queryCount and all the subsequent methods.

Thanks: Deepak Dixit for the review.
2020-06-28 01:40:58 +05:30
Pawan Verma 3da16a182c Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830) 2020-06-28 01:21:23 +05:30
Pawan Verma e19b12eae9 Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is already done in the declared type.
2020-06-28 01:04:51 +05:30
Pawan Verma f0af2894e5 Improved: Merge identical catch blocks in single catch block(OFBIZ-11827)
In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.

Thanks: Jacques for the review.
2020-06-27 11:23:12 +05:30
Pawan Verma 4275825b4a Improved: Replace anonymous types with lambda expressions(OFBIZ-11833) 2020-06-24 14:11:05 +05:30
Pawan Verma 18f5dadd93 Improved: Replace single method call lambda with method reference(OFBIZ-11835)
Thanks: Jacques for the review.
2020-06-22 20:59:44 +05:30
Jacques Le Roux 50fa929b83 Improved: Clean code according to SpotBugs and Eclipse (OFBIZ-11824)
Handles 2 possible NPR reported by SpotBugs
Removes the unused createPrimaryKeyFetcher method as reported by Eclipse
Reformats modified code to stay into 150 chars by line and other style issues
Sets tasks.checkstyleMain.maxErrors to 26759 (-1)
2020-06-17 10:07:00 +02:00
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Pawan Verma 12ef22228d Improved: Add support for Limit and offset in EntityQuery
(OFBIZ-11670)

Thanks: Jacques and Suraj for the review.
2020-05-10 14:03:55 +05:30
Jacques Le Roux ddb8f4273a Improved: replaces module by MODULE everywhere 2020-04-05 19:46:34 +02:00
Nicolas Malin 13ee4cc263 Fixed: Unable to view entity row record in webtools if PK contains timestamp field
(OFBIZ-11426)

This problem came from when the GenericEntity try to store fields value on the map,
If the java type didn't match with the current value type, the function failed and
didn't try to convert it on the wanted type.

Thanks to Pawan Verma and Pierre Smits to raise this issue
2020-03-19 14:44:07 +01:00
Jacques Le Roux 4697bf5faa Fixed: DatabaseUtil.getColumnInfo(...) does not retrieve primary keys due to
connection-locks
(OFBIZ-11312)

The method DatabaseUtil.getColumnInfo(...) uses an elaborate algorithm using a
List<Future<AbstractCountingCallable>> object. This does not work properly as it
runs into connection-locks. When debugging the error does not occur. I assume
that the slower pace of debugging prevents the error.

Thanks: Benjamin Jugl
2020-02-26 08:38:26 +01:00
Michael Brohl b55279101b Merge pull request #29 from PierreSmits/OFBIZ-10955-FieldType
Improved: field type Integer is missing in definitions.

(OFBIZ-10955)

Thanks Pierre Smits for the contribution.
2020-02-25 21:55:18 +01:00
Michael Brohl 8afb711ef3 Fixed: Fluent API Bug in getFieldList().
(OFBIZ-10298)

Thanks Benjamin Jugl for reporting and providing the patch.
2020-02-25 21:15:37 +01:00
Pierre Smits 75ed0c48ee Fixed: Field Type definitions
(OFBIZ-10955)

Adding missing field type definition for Apache Derby, MySQL, PostgreSQL
2020-02-25 12:59:58 +01:00
Jacques Le Roux fec0e19de0 Improved: no functional change
Fixed Javadoc creation issue reported at INFRA-19807

Thanks: Chris Lambertus
2020-02-04 09:45:55 +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
Mathieu Lirzin aae1c8a8f5 Reverted: "Improved: Use ‘depends-on’ attribute instead of “component-load.xml”"
(OFBIZ-11296)

This reverts commit eeabe69813.
2019-12-18 12:09:20 +01:00
Mathieu Lirzin eeabe69813 Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)
We currently have two ways to define component loading order. Either
by using ‘depends-on’ attribute in “component-config.xml” or by adding
a “component-load.xml” file at the root of a component directory.

“depends-on” is more flexible because it handles partial ordering when
“component-load.xml” defines a total order which is not necessarily
meaningful, so it is better to rely only “depends-on”.

This removes the usage of “component-load.xml” to use ‘depends-on’
instead. The dependency declarations correspond to the total ordering
previously defined but will need to be refined in the future to relax
unnecessary dependency declarations.

Only “framework/base/config/component-load.xml” which defines the
top-level directories order (framework, applications, themes and
plugins) is kept.
2019-11-25 15:28:54 +01:00
Mathieu Lirzin 59efa181d2 Improved: Lint unit tests
This makes no behavioral changes, only coding style fixes.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869037 13f79535-47bb-0310-9956-ffa450edef68
2019-10-27 12:51:08 +00:00
Mathieu Lirzin 8f9fa569e0 Improved: Do not use deprecated ‘Proxyclass#getConstructor’
(OFBIZ-11262)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869007 13f79535-47bb-0310-9956-ffa450edef68
2019-10-26 16:18:24 +00:00
Jacques Le Roux 6db4ffdbcd Improved: Remove unused methods related to properties in UtilProperties and
EntityUtilProperties
(OFBIZ-11254)

While removing the POS I forgot to remove specific methods I added in 
UtilProperties: setPropertyValue(*,*,*) and setPropertyValueInMemory. 
I finally found that setPropertyValueInMemory is used in one test and so maybe
usefull. setPropertyValue(*,*,*) is unused and can be safemy removed. It's also 
called from EntityUtilProperties so should also be removed there.

This removes it, and also slightly formats 
EntityUtilProperties::setPropertyValueInMemory 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868589 13f79535-47bb-0310-9956-ffa450edef68
2019-10-18 11:44:29 +00: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 cfff42cdc4 Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Last ones :)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866958 13f79535-47bb-0310-9956-ffa450edef68
2019-09-15 07:48:09 +00:00
Jacques Le Roux 28dfdf5c2e Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use 3 try-with-ressource blocks and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866957 13f79535-47bb-0310-9956-ffa450edef68
2019-09-15 06:32:42 +00:00
Jacques Le Roux 73ebcfb095 Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use a try-with-ressource block and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866952 13f79535-47bb-0310-9956-ffa450edef68
2019-09-14 17:11:59 +00:00
Nicolas Malin 8cc48ec568 Implemented: Add a mechanism to prevent the usage of EntitySyncRemove
(OFBIZ-10008)

Complete the previous commit on revision 1835296 [1] to add mechanism to prevent
 the usage of EntitySyncRemove also on function Delegator.removeByPrimaryKey

[1] https://svn.apache.org/viewvc?view=revision&revision=1835296

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866480 13f79535-47bb-0310-9956-ffa450edef68
2019-09-05 16:46:31 +00:00
Jacques Le Roux 180ca716cc Improved: Change current view-link requirement to allow use of
entity-condition only in view-entities
(OFBIZ-11179)



To explain the subject, i will give an example encountered recently:

We used, for a customer project, a view with Agreement, Virtual and Variant 
product entities and where the agreement can be attached to a virtual OR a 
variant product.
So to make a view returning Variant Product, Virtual Product AND Agreement 
informations, i could not create a view, as the key-map link is mandatory and 
made it impossible.

I can not have an alternative relation to the same entity so we have to 
duplicate member-entity and an alternative relation path. 
The result is a complicated and ugly entity-view

I think this can have been much simpler if i could have done it directly 
through the entity-condition (see the AGPA/PDTA view link in attached file 
ExampleWithoutKeyMap.xml)

So the purpose is to add the possibility to create a view-link without key map,  
if there is an entity-condition.

You can test by applying the given patch and add the entity view from attached 
file ExampleWithoutKeyMap.xml

Thanks: Leila Mekika

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866439 13f79535-47bb-0310-9956-ffa450edef68
2019-09-05 07:13:10 +00:00
Mathieu Lirzin 1b34cf7982 Improved: Inline ‘UtilValidate#areEqual’
(OFBIZ-11172)

‘Objects#equals’ is already providing the same functionality of ‘null’
safe equality check.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865843 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 12:52:12 +00:00
Mathieu Lirzin cf79277608 Improved: Remove redundant "dtd" directory from classpath
(OFBIZ-11161)

the "dtd" directories are already present as resources distributed
inside OFBiz jar, so there is no need to augment the classpath to find
the XML schema inside those directories.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865796 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 00:29:41 +00:00
Mathieu Lirzin 4c70084b76 Improved: Separate resources from Java source files
(OFBIZ-11161)

This moves the resource files in a dedicated "src/main/resources"
directory.  This convention follows the Maven standard directory
layout which is the convention used by default in Gradle.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865717 13f79535-47bb-0310-9956-ffa450edef68
2019-08-22 20:38:01 +00:00
Jacques Le Roux 985471e542 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11151)

Forgot this in previous commit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1864980 13f79535-47bb-0310-9956-ffa450edef68
2019-08-12 19:46:07 +00:00
Jacques Le Roux 7d5cea96bc Improved: no functional change
Adds missing ASL2 header

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863956 13f79535-47bb-0310-9956-ffa450edef68
2019-07-29 16:50:00 +00:00
Nicolas Malin 46414241e6 Fixed: EntityCondition(EntityOperator, fields...) raise exception with a null value
(OFBIZ-11143)

When you write an entity condition like
  rawProdcuts = from(Product).where(
    EntityCondition.makeCondition(EntityOperator.AND,
       'productTypeId', 'RAW_MATERIAL',
       'quantityUomId', null)
    ).queryList()

the function

  public static EntityFieldMap makeCondition(EntityJoinOperator joinOp, Object... keysValues) 

raise a IllegalArgumentException

The problem came from EntityUtil.makeFields(V... args) (EntityUtil.java:65) who check if a value is an insteance of Comparable and Serializable but didn't take the case tat where have a null value.

Thanks to Pawan Verma for the review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863685 13f79535-47bb-0310-9956-ffa450edef68
2019-07-24 06:56:44 +00:00
Mathieu Lirzin 7999e3adc1 Improved: Remove useless imports
(OFBIZ-11142)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863507 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 18:45:21 +00:00
Mathieu Lirzin fc6f9023d2 Improved: Use ‘StandardCharsets.UTF_8’
(OFBIZ-11142)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863505 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 18:41:37 +00:00
Mathieu Lirzin 2c2340db0a Improved: Use ‘java.util.Base64’
(OFBIZ-11142)

Since Java 8 a standard Base64 encoder/decoder is available. As a
consequence we can remove our embedded implementation and use it
instead.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863504 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 18:39:57 +00:00
Mathieu Lirzin 54f210a866 Improved: Inline ‘UtilGenerics#checkCollection(Object)’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863502 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:36:12 +00:00
Mathieu Lirzin e9a56a78e5 Improved: Inline ‘UtilGenerics#checkList’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863501 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:35:13 +00:00