This should not be a warning but an info. Also I wonder if we really need to
show all these, after all a default fallback should exist in a properties file
Still OFBIZ-7754 needs to be solved...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763103 13f79535-47bb-0310-9956-ffa450edef68
Minor fix in the preparation of resources to be used in unit tests to be
accessed statically instead of dynamically.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762349 13f79535-47bb-0310-9956-ffa450edef68
code using it, that wraps most of the OFBiz integration with FreeMarker.
This is the list of the main modifications:
* simplified and cleaned up the public methods of FreeMarkerWorker, used to
retrieve and render Freemarker templates and changed client code accordingly to
use them
* removed unused methods in FreeMarkerWorker and made some others private
* improved the integration code in FreeMarkerWorker to better use the Freemarker
API and specifically to leverage the various TemplateLoaders and the Freemarker
caching mechanism; it is now possible to switch the OFBiz legacy template
caching mechanism to use the Freemarker one instead
* improved the implementation of Freemarker template rendering from strings
(used by DataResourceWorker): it now leverages the Freemarker's
StringTemplateLoader that provides the ability to cache the strings, retrieved
from DataResources records, based on the timestamp of the last modification
* moved freemarkerImports.properties from "widget" to "base" component, and
changed its content (and the content of the associated templates
AutoImportTemplate.ftl and HtmlTemplate.ftl) to remove the dependency from base
to widget&common; some resources of "widget" and "common" are still referenced
from AutoImportTemplate.ftl (that is in "base") but even if they are soft
dependencies: if they are missing the system will load properly without any
error or warning; before this change it was impossible to use, or unit test,
FreeMarkerWorker before the "widget" and "common" components were loaded by the
system, now it is possible
* created a new class for unit tests for FreeMarkerWorker, named
FreeMarkerWorkerTests: at the moment it contains just one simple unit test but
more should be implemented
* refactored WebToolsServices.entityImport(...) to leverage the
FreeMarkerWorker.renderTemplate(...) method to run the Freemarker template,
rather than dealing with the Freemarker API directly; this is now possible
thanks to the cleanups and improvements done in the FreeMarkerWorker class; this
same approach should be implemented for a few other similar integration points
(mostly in the "content" component); this is a TODO item
* moved the encodeDoubleQuotes(...) method from FreeMarkerWorker to
MacroFormRenderer and made it private since this is the only calss using it and
its logic is not related to FreeMarker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762227 13f79535-47bb-0310-9956-ffa450edef68
of the legacy implementation from Javolution; removed a bunch of unused or
deprecated methods; created some unit tests to test the EntitySaxReader in
isolation. Removed the dependency from Javolution since this was the last class
dependent on it.
(OFBIZ-5169)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762079 13f79535-47bb-0310-9956-ffa450edef68
the initialization of the ControlFilter.
These unit tests are experimental but interesting because they provide test
coverage in isolation for some aspect of the framework that were not covered
before or only covered by integration tests.
The tests for the ControlFilter are particularly interesting because they
leverage Mockito to run the test in isolation by mocking the FilterConfig
object.
Please review and run these tests in your local environment, provide your
feedback and report any issues you may find: this will help to define a pattern
for the definition of unit tests that could be applied more extensively.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761440 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-8202)
These are a non functional changes for the accounting component
I forgot to commit the change in EntityListIterator.java, hence a lot of confusion, sorry guys
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761047 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-8179)
Without functional changes, this design removes a cyclic dependency between the "entity" and "geronimo" components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760376 13f79535-47bb-0310-9956-ffa450edef68
No functional changes, simply use the try-with-resources statement everywhere it's possible, mostly to clean the finally statements and have consistent code
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759088 13f79535-47bb-0310-9956-ffa450edef68
At r1758927 I tried to fixe a bunch of closes missing, reported as warnings in Eclipse
Jacopo noticed and reported on dev ML http://markmail.org/message/b4hvzi7foftfq3j5 2 possible issues:
1) you are adding a close statement to code that already had the close statement in the "finally" block; your modification actually introduces a code pattern that is not correct (if an exception is thrown your close statement are not executed)
2) I suspect that you are closing the socket connection too early in PcChargeApi
1)The best option when closing resources (which implement AutoCloseable) is actually to use the try-with-resources statement. At least when there are no performance issues.
I have fixed the issue (only in DatabaseUtil.java) this way because
* there are not performance issues, we anyway create a Statement in both cases, we don't reuse one.
* The finally part is cleaner
I have also used the try-with-resources statement in other places where it fitted.
There is only 1 place where I was undecided: ScriptUtil.parseScript() which uses GroovyUtil.parseClass().
I put only a logError() there and returned null.
I did not throw an IOException because else it spreads everywhere in FlexibleStringExpander.
Here introducing Optional would be better, but I have no time or that today.
2) was not a problem
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758951 13f79535-47bb-0310-9956-ffa450edef68
Fixes a bunch of small leaks (closes missing, only warnings in Eclipse)
By-product: automatically sort few imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758927 13f79535-47bb-0310-9956-ffa450edef68
Notes:
* Also removes empty framework/base/lib/scripting and useless applications\content\lib\uno\README (miss doc in wiki)
* When jpim-0.1.jar will be (hopefully) replaced we can drop lib ref in framework/base/ofbiz-component.xml
* I wonder if we should let the geronimo component alone with only 2 classes, could we not put that in entity or entityext?
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755306 13f79535-47bb-0310-9956-ffa450edef68
This is the first of two steps in the above mentioned JIRA. This
first step changes the java source directory for every component
from /src to /src/main/java. The next step will be adding unit
tests to every component in /src/test/java
Thank you to Deepak Dixit for tips on how to use the SVN commands
to make the appropriate file moving.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752838 13f79535-47bb-0310-9956-ffa450edef68
This is the first patch that takes OFBiz to the point of no return
in terms of switching from Ant to Gradle build system. Specifically
this patch applies the following items:
- Delete all old Ant and Maven build scripts
- Delete 169 Jar libraries and replace them with remote ones in the
gradle build script
- update the gradle build scripts for the dependencies and other minor
changes needed for the script work correctly
All tests pass with the command ./gradlew cleanAll loadDefault testIntegration
Again, thank you for everyone who contributed valueble time and effort in this
process.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752033 13f79535-47bb-0310-9956-ffa450edef68
This feature has been contributed a long time ago as an experimental feature but never really matured into a production ready artifact: since it was contributed, no users asked about how to use it, or tested it, or reported bugs or enhancement requests.
More importantly, the feature has always been disabled in the OFBiz framework (i.e. the widget code and the entity engine code were not using it).
This removal should not impact our user base; however, after the removal, an entry to the Attic will be created to keep track of it and to make it easier, to interested users, to get this code, improve it (e.g. by making it dependent on a live external jar, for example MapDB instead of JDBM) and possibly contribute it back to the project.
The most compelling reason for its removal is that the feature was based on a snapshot, unreleased version of JDBM, which is now a mostly dead project: for licensing reasons we are no more allowed to bundle jars in our releases. Additionally, having code that relies an old jar from a no more active project represents a maintenance issue for the community.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751817 13f79535-47bb-0310-9956-ffa450edef68
This improvement add a control to not update or delete an EntityStatus by entity-auto (for help developer) and complete unit test
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751530 13f79535-47bb-0310-9956-ffa450edef68
===========================================
Error adding foreign key: ModelEntity was null for related entity name Tenant
===========================================
Thanks Nameet Jain for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751423 13f79535-47bb-0310-9956-ffa450edef68
I have uploaded a patch for the simple methods schema.
In general, the top level attributes are converted to simpleType, and attributeGroups to complexType.
Changed the following attribute name
1. ‘field’ to ‘fieldType’
2. ‘level’ to ‘levelType'
Denormalize the following attributeGroups
1. attlist.compare
2. attlist.compare-field
Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem.
jleroux: we also fixed an issue with
<xs:element name="field" type="fieldType"/>
to
<xs:element ref="field"/>
In the patch
And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml
- <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/>
+ <sm:log message="CompoundWidgetsFunc runs" level="info"/>
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750647 13f79535-47bb-0310-9956-ffa450edef68
Reverts the simple method to use the original schema without namespace. "Duplicates" simple-methods.xsd in simple-methods-ns.xsd as we did, to get the simple-method namespace for compound-widgets.
For myself: when we will do the 3rd more elegant option (no schema duplication), have been changed also:
minilang-catalog.xml
compound-widgets.xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749938 13f79535-47bb-0310-9956-ffa450edef68
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
Connection pooling does not seem to work. Connections are created fine but as the close() method is called (outside of transaction) or the transaction is committed the connections are closed to the db server and not returned to the pool.
I believe the issue is with org.apache.commons.dbcp2.PoolableConnectionFactory passivateObject method. This will call rollback() when rollbackOnReturn is set to true even if the transaction is committed. This is because any connection wrappers extending org.apache.commons.dbcp2.DelegatingConnection cache autoCommit status. At some point, this cached autoCommit is different from the underlying connection autoCommit. The rollback() method will throw an exception and the connection is destroyed rather than put back to the pool
Environment this has been tested on:
ofbiz: rev 1725574 and latest trunk (as of 2016-06-14)
db: postgresql 9.1
jdbc driver: postgresql-9.3-1101.jdbc4
os: linux and windows
jleroux: this issue doest not exist with Derby, it's a matter of driver (DBMS actually) see Derby vs Postgres
https://db.apache.org/derby/docs/10.9/devguide/cdevconcepts29416.htmlhttps://www.postgresql.org/docs/9.1/static/ecpg-sql-set-autocommit.html
Another solution would be to force Postgres to autocommit but I'd not do that, better not change this DBMS dependent behaviour.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748837 13f79535-47bb-0310-9956-ffa450edef68
Completes the work I did in r1748689. Actually I worked on different editors and mixed things so not all was committed previously, here they are
Removes now useless commented out line about DebugManagedDataSource (// Useful to debug the usage of connections in the pool). I put more information in the class head while fixing the type warnings
Fixes other type warnings I missed previously
Eventually removes the old comment
// Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748693 13f79535-47bb-0310-9956-ffa450edef68
The Connection Pool Status feature was introduced by OFBIZ-4864 hence 1st in R13.07 where it still work well (see demo), as the connection pooling. But has been broken since, with the pooling.
Fortunately, it's easy to fix and has no implications has long has you don't enable verbose logging (the DebugManagedDataSource only extends ManagedDataSource for verbose logging and to generate the info needed for the Connection Pool Status feature).
I fixed it by using directly the DebugManagedDataSource. It's not an issue as long as you don't set the logging level to verbose which is anyway not something you would do in production. In case you do so and don't want to be disturbed in the log (focusing on something else), it's still easy to comment out the line from DebugManagedDataSource. I also fixed some type warnings while at it.
I also removed this old comment
// Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748689 13f79535-47bb-0310-9956-ffa450edef68