(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
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
(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
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
(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
(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
(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
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
(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
(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
(OFBIZ-11100)
Since there is no global container configuration file anymore this
method should not be used. It has been superseded by an overload
which do not require to pass the file name of the configuration file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863020 13f79535-47bb-0310-9956-ffa450edef68
(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-11078)
When you tried to decrypt a field present on embedded entity-view, key use is the view name and not the final entity who contains this field.
You currently have the problem on PartyContactMechDetail where if you want to displaying the ftpPassword for a FtpAddress, the view failed and tried to use ContactMechDetail to decrypt instead of FtpAddress
To solve it, we iterate on the entity contains the field in the view while is an entity-view :
PartyContactMechDetail.ftpPassword
-> ContactMechDetail.ftpPassword
-> FtpAddress.ftpPassword
-> key found FtpAddress
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860365 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11040)
When you delete some entities through removeByAnd or removeByCondition, eeca aren't enable and the remove is quite as regard implemented rules.
With
<eca entity="GoodIndentification" operation="create-store-remove" event="return">
<action service="indexProductKeywords" mode="sync"/>
</eca>
And
delegator.removeByAnd('GoodIdentification', [productId: 'WG-1111'])
The service indexProductKeywords wasn't call for the productId WG-1111
To solve this situation, the idea would be delegator.removeValue for each element to delete when an eeca is present otherwise call the standard helper.removeByCondition.
Thanks to Leila Mekika for raise and fix this issue, Jacques Leroux and Mathieu Lirzin for the review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859887 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11041)
When you create a DynamicView with 'group by' agreggate function and you perform a delegator.findCountByCondition() with selected fields, the result is different from the count of each element returned by delegator.findList().
The problem come from when the 'group by' closure is populated with all grouped by fields from on the DV and not only those from selected fields.
Thanks to Leila Mekika to raise and solve this issue.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859438 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10939)
The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.
Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.
Thanks Jacques Le Roux and Swapnil M Mane for acknowledging the commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858295 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10937)
Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is done in the
declared type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10935)
Use ‘PoolableConnectionFactory#setAutoCommitOnReturn’ instead of
‘PoolableConnectionFactory#setEnableAutoCommitOnReturn’ from
‘org.apache.commons.dbcp2’ package.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857898 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9855)
Uses try with resources for File IO objects like ObjectInputStream and other
objects. File classes have the AutoCloseable interface.
jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...
All tests pass
Thanks: Pradhan Yash Sharma
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857099 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10771)
The ObjectType class contains utilities that extends the Java reflection API by
defining methods which accepts string representation of Java types and classes.
It appears that this class contains unneeded code which is either dead or is
redundant with the services already defined in the reflection API
Removes the useless isOrSubOf, instanceOf and interfaceOf methods.
Additionally it removes the getInstance method which is not used anywhere in
the framework or in the plugins.
Also includes similar changes in
AbstractConverter.java
Converters.java
DateTimeConverters.java
GenericEntity.java
IfInstanceOf.java
Thanks: Mathieu
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851701 13f79535-47bb-0310-9956-ffa450edef68