details: https://code.openbravo.com/erp/devel/pi/rev/91b8f104a301 changeset: 35656:91b8f104a301 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Fri Apr 05 13:52:48 2019 +0200 summary: [hb5.4] Upgrade libraries
details: https://code.openbravo.com/erp/devel/pi/rev/03b85a6389fc changeset: 35657:03b85a6389fc user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Fri Apr 05 13:57:34 2019 +0200 summary: [hb5.4] Remove unneeded warning suppression details: https://code.openbravo.com/erp/devel/pi/rev/fdd7ca7cc1a1 changeset: 35658:fdd7ca7cc1a1 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Mon Apr 08 11:35:06 2019 +0200 summary: [hb5.4] Fix typo details: https://code.openbravo.com/erp/devel/pi/rev/98bd8a9f9102 changeset: 35659:98bd8a9f9102 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Apr 09 17:45:40 2019 +0200 summary: [hb5.4] Return type is not supported in native queries Due to a bug[1] in Hibernate it is not supported to specify the return type when building a NativeQuery. [1] https://hibernate.atlassian.net/browse/HHH-12779 details: https://code.openbravo.com/erp/devel/pi/rev/a08c14f0a314 changeset: 35660:a08c14f0a314 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Apr 09 18:05:20 2019 +0200 summary: [hb5.4] Explicit close of hibernate pool is no longer needed Reverting fix for issue[1]. It is no longer needed to explicitly close the hibernate pool because its validation thread is now a daemon thread[2]. [1] https://issues.openbravo.com/view.php?id=39128 [2] https://hibernate.atlassian.net/browse/HHH-12921 details: https://code.openbravo.com/erp/devel/pi/rev/6fea6863e397 changeset: 35661:6fea6863e397 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Apr 09 18:29:02 2019 +0200 summary: [hb5.4] DBSM changes Reverting hibernate pool explicit closing in ExportDatabase because is no longer needed. details: https://code.openbravo.com/erp/devel/pi/rev/9bcfc98c7b98 changeset: 35662:9bcfc98c7b98 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Wed Apr 10 17:13:54 2019 +0200 summary: [hb5.4] Merge with pi details: https://code.openbravo.com/erp/devel/pi/rev/df5da5dd85fe changeset: 35663:df5da5dd85fe user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 09:58:39 2019 +0200 summary: [hb5.4] Support method chaining in OBQuery details: https://code.openbravo.com/erp/devel/pi/rev/e8300439001b changeset: 35664:e8300439001b user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 10:00:09 2019 +0200 summary: [hb5.4] Put assert arguments in the correct order: expected value, actual value details: https://code.openbravo.com/erp/devel/pi/rev/fdc2bee3c6be changeset: 35665:fdc2bee3c6be user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 10:03:33 2019 +0200 summary: [hb5.4] Minor code improvements - Remove unnecessary cast to "E" - Use single-quotes to make use of the faster "indexOf(char)" method details: https://code.openbravo.com/erp/devel/pi/rev/bc21bf8d5a1b changeset: 35666:bc21bf8d5a1b user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 10:53:00 2019 +0200 summary: [hb5.4] Support method chaining in OBCriteria details: https://code.openbravo.com/erp/devel/pi/rev/c0e82250de16 changeset: 35667:c0e82250de16 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 11:06:52 2019 +0200 summary: [hb5.4] Minor code improvements - Use diamond operator - Use single-quotes to make use of the faster "indexOf(char)" method details: https://code.openbravo.com/erp/devel/pi/rev/114568479408 changeset: 35668:114568479408 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Apr 11 11:11:29 2019 +0200 summary: [hb5.4] Minor code improvements - Use diamond operator - Immediately return expression instead of assigning it to the temporary variable "connection" - Define a constant instead of duplicating "activeFilter" 3 times. details: https://code.openbravo.com/erp/devel/pi/rev/5a4356e8ddff changeset: 35669:5a4356e8ddff user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Apr 16 11:02:42 2019 +0200 summary: [hb5.4] Update legal information details: https://code.openbravo.com/erp/devel/pi/rev/bdd63e1a8341 changeset: 35670:bdd63e1a8341 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Tue Apr 16 18:32:16 2019 +0200 summary: fixes issue 40552: upgrade hibernate to version 5.4 diffstat: .classpath.template | 1 - legal/CPL-1.0.txt | 3 + legal/Licensing.txt | 29 +- lib/runtime/FastInfoset-1.2.15.jar | Bin lib/runtime/byte-buddy-1.8.12.jar | Bin lib/runtime/byte-buddy-1.9.10.jar | Bin lib/runtime/dom4j-1.6.1.jar | Bin lib/runtime/dom4j-2.1.1.jar | Bin lib/runtime/hibernate-commons-annotations-5.0.4.Final.jar | Bin lib/runtime/hibernate-commons-annotations-5.1.0.Final.jar | Bin lib/runtime/hibernate-core-5.3.2.Final.jar | Bin lib/runtime/hibernate-core-5.4.2.Final.jar | Bin lib/runtime/istack-commons-runtime-3.0.7.jar | Bin lib/runtime/javassist-3.22.0-GA.jar | Bin lib/runtime/javassist-3.24.0-GA.jar | Bin lib/runtime/jaxb-api-2.2.12.jar | Bin lib/runtime/jaxb-api-2.3.1.jar | Bin lib/runtime/jaxb-impl-2.2.6.jar | Bin lib/runtime/jaxb-runtime-2.3.1.jar | Bin lib/runtime/stax-ex-1.8.jar | Bin lib/runtime/txw2-2.3.1.jar | Bin lib/runtime/wsdl4j-1.5.1.jar | Bin lib/runtime/wsdl4j-1.6.3.jar | Bin modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java | 61 ++- modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java | 58 ++- modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java | 61 +-- modules/org.openbravo.client.myob/src/org/openbravo/client/myob/MyOpenbravoActionHandler.java | 5 +- modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java | 7 +- modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java | 3 +- modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorFieldPropertyCallout.java | 7 +- src-db/database/lib/dbsourcemanager.jar | Bin src-test/src/org/openbravo/test/AllAntTaskTests.java | 2 + src-test/src/org/openbravo/test/dal/DalComplexQueryTestOrderLine.java | 18 +- src-test/src/org/openbravo/test/dal/DalPerformanceExampleTest.java | 11 +- src-test/src/org/openbravo/test/dal/DalTest.java | 156 +++++---- src-test/src/org/openbravo/test/model/DBModifiedTest.java | 4 +- src-test/src/org/openbravo/test/system/OldCallouts.java | 116 +++++++ src/org/openbravo/common/actionhandler/CashflowForecastReportActionHandler.java | 2 +- src/org/openbravo/costing/CostAdjustmentProcess.java | 2 +- src/org/openbravo/costing/LandedCostProcess.java | 2 +- src/org/openbravo/dal/service/OBCriteria.java | 73 ++++- src/org/openbravo/dal/service/OBDal.java | 27 +- src/org/openbravo/dal/service/OBQuery.java | 61 +++- src/org/openbravo/dal/xml/XMLEntityConverter.java | 7 +- src/org/openbravo/erpCommon/ad_callouts/HttpServletCalloutInformationProvider.java | 134 ++++++-- src/org/openbravo/erpCommon/ad_forms/ModuleManagementInstalled.html | 4 +- src/org/openbravo/erpCommon/ad_help/HelpWindow.java | 5 +- src/org/openbravo/erpCommon/ad_process/ApplyModules.html | 8 +- src/org/openbravo/erpCommon/modules/ApplyModuleTask.java | 13 +- src/org/openbravo/erpCommon/utility/Utility.java | 55 ++- src/org/openbravo/erpCommon/utility/WindowTree.html | 5 +- src/org/openbravo/erpCommon/utility/poc/EmailManager.java | 14 +- src/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html | 9 +- src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java | 75 ++-- web/js/jscalendar/calendar.php | 119 ------- web/js/jscalendar/test.php | 116 ------- 56 files changed, 666 insertions(+), 607 deletions(-) diffs (truncated from 2682 to 300 lines): diff -r ff01c2b4f10e -r bdd63e1a8341 .classpath.template --- a/.classpath.template Wed Mar 27 13:49:32 2019 +0100 +++ b/.classpath.template Tue Apr 16 18:32:16 2019 +0200 @@ -26,6 +26,5 @@ <classpathentry including="**/*.java" kind="src" path="build/javasqlc/src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="lib/build/servlet-api.jar"/> - <classpathentry kind="lib" path="lib/build/js.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> diff -r ff01c2b4f10e -r bdd63e1a8341 legal/CPL-1.0.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/legal/CPL-1.0.txt Tue Apr 16 18:32:16 2019 +0200 @@ -0,0 +1,3 @@ +Common Public License Version 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff -r ff01c2b4f10e -r bdd63e1a8341 legal/Licensing.txt --- a/legal/Licensing.txt Wed Mar 27 13:49:32 2019 +0100 +++ b/legal/Licensing.txt Tue Apr 16 18:32:16 2019 +0200 @@ -64,8 +64,7 @@ Eclipse Public License 1.0 (license available at http://www.eclipse.org/legal/epl-v10.html) or in the file EPL-1.0.txt in this folder -# Eclipse icons -# wsdl4j-1.5.1.jar +# Eclipse icons Icons and files under the Eclipse Public License (license available at http://www.eclipse.org/legal/epl-v10.html) @@ -157,28 +156,26 @@ # poi-3.10.1.jar Under the Apache 2.0 license (included as Apache_poi_license.txt in this folder) -# hibernate-core-5.3.2.Final.jar -# hibernate-commons-annotations-5.0.4.Final.jar +# hibernate-core-5.4.2.Final.jar +# hibernate-commons-annotations-5.1.0.Final.jar All files under the LGPL 2.1 (available at www.gnu.org/licenses/lgpl.html) -# dom4j-1.6.1.jar -Under a BSD style license (available at http://www.dom4j.org/license.html) - # antlr-2.7.7.jar Under the ANTLR license (available at http://www.antlr.org/license.html) # junit-4.12.jar Under the Eclipse Public License - v 1.0 (available at https://www.eclipse.org/legal/epl-v10.html) +# dom4j-2.1.1.jar # hamcrest-all-1.3.jar -Under the BSD 3-Clause license (avaliable at http://opensource.org/licenses/BSD-3-Clause) +Under the BSD 3-Clause license (available at http://opensource.org/licenses/BSD-3-Clause) # js.jar # ob-rhino-1.6R7.jar Under MPL/GPL License (available at https://developer.mozilla.org/en/Rhino_License) ob-rhino-1.6R7.jar is the same code as js.jar repackaged to be available under org.openbravo -# javassist-3.22.0-GA.jar +# javassist-3.24.0-GA.jar Under MPL License (included as MPL-1.1.txt in this folder) # slf4j-api-1.7.25.jar @@ -243,12 +240,13 @@ # tomcat-jdbc.jar # classmate-1.3.4.jar # jandex-2.0.5.Final.jar +# FastInfoset-1.2.15.jar Under the Apache 2.0 license (included as Apache_license-2.0.txt in this folder) # reflections-0.9.11.jar Under the WTFPL license (included as WTFPL_license.txt in this folder) -# byte-buddy-1.8.12.jar +# byte-buddy-1.9.10.jar Under the Apache 2.0 license (included as Apache_license-2.0.txt in this folder), note that Byte Buddy depends on the ASM library which is distributed under a BSD license (included as ASM_BSD_license.txt in this folder) @@ -256,20 +254,27 @@ Under the New BSD license (available at http://www.opensource.org/licenses/bsd-license.php) # javax.xml.soap-api-1.3.7.jar +# jaxb-runtime-2.3.1.jar # jboss-interceptors-api_1.2_spec-1.0.0.Final.jar # jboss-transaction-api_1.2_spec-1.1.1.Final.jar +# txw2-2.3.1.jar Under the CDDL license version 1.0 (license available at https://spdx.org/licenses/CDDL-1.0.html or in the file CDDL-1.0.txt in this folder) +# istack-commons-runtime-3.0.7.jar # javax.activation-1.2.0.jar -# jaxb-api-2.2.12.jar -# jaxb-impl-2.2.6.jar +# jaxb-api-2.3.1.jar # javax.mail-1.6.1.jar # jboss-annotations-api_1.3_spec-1.0.0.Final.jar # jboss-el-api_3.0_spec-1.0.13.Final.jar +# stax-ex-1.8.jar Under the CDDL license version 1.1 (license available at https://spdx.org/licenses/CDDL-1.1.html or in the file CDDL-1.1.txt in this folder) +# wsdl4j-1.6.3.jar +Under the CPL license version 1.0 (license available at https://spdx.org/licenses/CPL-1.0.html +or in the file CPL-1.0.txt in this folder) + # CSSMinimizer.java CSSMin Copyright License Agreement (BSD License), Copyright (c) 2011, Barry van Oudtshoorn The full license text is embedded within the CSSMinimizer.java file itself diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/FastInfoset-1.2.15.jar Binary file lib/runtime/FastInfoset-1.2.15.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/byte-buddy-1.8.12.jar Binary file lib/runtime/byte-buddy-1.8.12.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/byte-buddy-1.9.10.jar Binary file lib/runtime/byte-buddy-1.9.10.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/dom4j-1.6.1.jar Binary file lib/runtime/dom4j-1.6.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/dom4j-2.1.1.jar Binary file lib/runtime/dom4j-2.1.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/hibernate-commons-annotations-5.0.4.Final.jar Binary file lib/runtime/hibernate-commons-annotations-5.0.4.Final.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/hibernate-commons-annotations-5.1.0.Final.jar Binary file lib/runtime/hibernate-commons-annotations-5.1.0.Final.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/hibernate-core-5.3.2.Final.jar Binary file lib/runtime/hibernate-core-5.3.2.Final.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/hibernate-core-5.4.2.Final.jar Binary file lib/runtime/hibernate-core-5.4.2.Final.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/istack-commons-runtime-3.0.7.jar Binary file lib/runtime/istack-commons-runtime-3.0.7.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/javassist-3.22.0-GA.jar Binary file lib/runtime/javassist-3.22.0-GA.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/javassist-3.24.0-GA.jar Binary file lib/runtime/javassist-3.24.0-GA.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/jaxb-api-2.2.12.jar Binary file lib/runtime/jaxb-api-2.2.12.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/jaxb-api-2.3.1.jar Binary file lib/runtime/jaxb-api-2.3.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/jaxb-impl-2.2.6.jar Binary file lib/runtime/jaxb-impl-2.2.6.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/jaxb-runtime-2.3.1.jar Binary file lib/runtime/jaxb-runtime-2.3.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/stax-ex-1.8.jar Binary file lib/runtime/stax-ex-1.8.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/txw2-2.3.1.jar Binary file lib/runtime/txw2-2.3.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/wsdl4j-1.5.1.jar Binary file lib/runtime/wsdl4j-1.5.1.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 lib/runtime/wsdl4j-1.6.3.jar Binary file lib/runtime/wsdl4j-1.6.3.jar has changed diff -r ff01c2b4f10e -r bdd63e1a8341 modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java Wed Mar 27 13:49:32 2019 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java Tue Apr 16 18:32:16 2019 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2015-2018 Openbravo SLU + * All portions are Copyright (C) 2015-2019 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -95,20 +95,29 @@ private List<String> getAlertIds(String alertStatus) { // Get alert rules visible for context's the role/user. - final String sql = "SELECT ad_alertrule_id, filterclause" + " FROM ad_alertrule arule" // - + " WHERE EXISTS (SELECT 1" // + // @formatter:off + final String sql = + "SELECT ad_alertrule_id, filterclause" + + " FROM ad_alertrule arule" + + " WHERE EXISTS (SELECT 1" + " FROM ad_alertrecipient arecipient" + " WHERE arule.ad_alertrule_id = arecipient.ad_alertrule_id" + " AND (ad_user_id = :userId" + " OR (ad_user_id is null AND ad_role_id = :roleId)))" - + " AND ad_client_id " + OBDal.getInstance().getReadableClientsInClause() - + " AND ad_org_id " + OBDal.getInstance().getReadableOrganizationsInClause() + + " AND ad_client_id in :clients" + + " AND ad_org_id in :orgs" + " AND isactive='Y'"; + // @formatter:on @SuppressWarnings("rawtypes") - final NativeQuery alertRules = OBDal.getInstance().getSession().createNativeQuery(sql); - alertRules.setParameter("userId", OBContext.getOBContext().getUser().getId()); - alertRules.setParameter("roleId", OBContext.getOBContext().getRole().getId()); + final NativeQuery alertRules = OBDal.getInstance() + .getSession() + .createNativeQuery(sql) + .setParameter("userId", OBContext.getOBContext().getUser().getId()) + .setParameter("roleId", OBContext.getOBContext().getRole().getId()) + .setParameterList("clients", OBContext.getOBContext().getReadableClients()) + .setParameterList("orgs", OBContext.getOBContext().getReadableOrganizations()); + return getAlertIdsFromAlertRules(getAlertRulesGroupedByFilterClause(alertRules), alertStatus); } @@ -142,7 +151,7 @@ private List<String> getAlertIdsFromAlertRules( Map<String, List<String>> alertRulesGroupByFilterClause, String alertStatus) { - List<String> alertIds = new ArrayList<String>(); + List<String> alertIds = new ArrayList<>(); for (Entry<String, List<String>> alertRuleList : alertRulesGroupByFilterClause.entrySet()) { String filterClause; try { @@ -151,14 +160,28 @@ } catch (ServletException e) { throw new IllegalStateException(e); } - final String sql = "SELECT ad_alert_id FROM ad_alert WHERE isactive='Y'" - + " AND ad_client_id " + OBDal.getInstance().getReadableClientsInClause() - + " AND ad_org_id " + OBDal.getInstance().getReadableOrganizationsInClause() - + " AND ad_alertrule_id IN (" + commaSeparated(alertRuleList.getValue()) + ")" - + filterClause + " AND coalesce(to_char(status), 'NEW') = :status"; + + // @formatter:off + final String sql = + "SELECT ad_alert_id " + + " FROM ad_alert " + + "WHERE isactive='Y'" + + " AND ad_client_id in :clients" + + " AND ad_org_id in :orgs" + + " AND ad_alertrule_id in :rules " + + " AND coalesce(to_char(status), 'NEW') = :status " + + filterClause; + // @formatter:on + @SuppressWarnings("rawtypes") - final NativeQuery sqlQuery = OBDal.getInstance().getSession().createNativeQuery(sql); - sqlQuery.setParameter("status", alertStatus); + final NativeQuery sqlQuery = OBDal.getInstance() + .getSession() + .createNativeQuery(sql) + .setParameter("status", alertStatus) + .setParameterList("clients", OBContext.getOBContext().getReadableClients()) + .setParameterList("orgs", OBContext.getOBContext().getReadableOrganizations()) + .setParameterList("rules", alertRuleList.getValue()); + try { @SuppressWarnings("unchecked") List<String> alertsFound = sqlQuery.list(); @@ -183,9 +206,8 @@ List<String> alertList = getAlertIds(alertStatus); int chunkSize = 1000; String whereClause = ""; - ArrayList<String> alertListToRemove; - if (alertList.size() == 0) { + if (alertList.isEmpty()) { return "1 = 2"; } @@ -195,9 +217,8 @@ // There are more than 1000 alerts to include in the where clause, Oracle doesn't // support it, so let's split them in chunks with <=1000 elements each - alertListToRemove = new ArrayList<String>(); while (alertList.size() > chunkSize) { - alertListToRemove = new ArrayList<String>(alertList.subList(0, chunkSize - 1)); + ArrayList<String> alertListToRemove = new ArrayList<>(alertList.subList(0, chunkSize - 1)); if (StringUtils.isEmpty(whereClause)) { whereClause = "(e.id in (" + commaSeparated(alertListToRemove) + ")"; } else { diff -r ff01c2b4f10e -r bdd63e1a8341 modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java Wed Mar 27 13:49:32 2019 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java Tue Apr 16 18:32:16 2019 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2009-2018 Openbravo SLU + * All portions are Copyright (C) 2009-2019 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -20,11 +20,8 @@ import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.toList; -import static org.openbravo.erpCommon.utility.StringCollectionUtils.commaSeparated; import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -113,47 +110,60 @@ return 0L; } - final String hql = "select distinct(e.alertRule)" + " from ADAlertRecipient" - + " e where e.alertRule.active = true and (e.userContact.id= :userId " - + " or (e.userContact.id = null and e.role.id = :roleId))" + // @formatter:off + final String hql = + "select distinct(e.alertRule)" + + " from ADAlertRecipient e " _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits