(OFBIZ-8336)
When going for example to EditProductContent (Product --> Content)
the following error message appears:
2016-09-27 20:02:40,822 |http-nio-8444-exec-7 |UtilProperties |I| null
java.util.MissingResourceException: Can't find resource for bundle
org.apache.ofbiz.base.util.UtilProperties$UtilResourceBundle,
key FieldDescription.sequenceNum
jleroux: this has not been handled right from start and in several changes
later. Rather than throwing an exception in UtilProperties.getMessage() it's
better to check if the bundle contains the key and else to log info
Thanks: Ingo Wolfmayr for report and Rohit Koushal for research
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763085 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
working because of an issue in the OFBiz custom TemplateLoader for Freemarker
templates.
(OFBIZ-8292)
The OFBiz custom TemplateLoader now returns null if the resource is missing as
required by the TemplateLoader specification.
Additional cleanups for unused methods in the FreeMarkerWorker class and some
minor fine tuning; improved the way errors are rendered: now the full stack
trace is not shown in the screen but only in the logs.
Thanks: Jacques Le Roux for the report.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761586 13f79535-47bb-0310-9956-ffa450edef68
In reference to the below discussion thread, this commit removes a task
which generates the above mentioned jar file which holds a service
definition. The fix is replace the gradle task which automatically
generates service with a flat directiory (META-INF) that defines the
service provides. All tests pass.
Thread: http://markmail.org/message/wzmw2qbacg4hup7r
Thanks: Jacques Le Roux for reporting this issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761421 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-8224)
This commit removes the support for the Bean Scripting Framework (BSF) from the OFBiz framework:
no application code was using this since several years and there are better and more modern tools at the present time.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760384 13f79535-47bb-0310-9956-ffa450edef68
Hopefully, now that Gradle provides the tools to build effective unit tests (thanks to the great work by Taher), the test coverage of the framework will improve: contributions are welcome!
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759071 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
To resolve this issue we can convert the current use for import/export vcard by an other api ez-vcard (https://github.com/mangstadt/ez-vcard) under bsd licence and present on jcenter.
The refactoring raise some problem on existant code, we will try with Gil to improve the import/export to grow data conversion to functional framework.
Some improve on import :
* check if more than one email is present before check the prefered else take the one
* check if more than one phone is present before check the prefered else take the one
* check if more than one address is present before check the prefered else take the one
* When you load a party by vcard, initialize a reference by fn attribute on PartyIndentification to escape the second loading
Will need continue improve the import like correct Organization loading, update process, add service to detect already party present
I also improve the screen result to display all parties loaded by the import and all already present.
The solution isn't perfect but it's work and compile, first purpose to delete jpim.jar is done :)
Related issue OFBIZ-7961
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1756949 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
* https://localhost:8443/webtools/control/LogView
* https://localhost:8443/webtools/control/FetchLogs
Each method use the same line rendering and the difference is : LogView display only runtime/logs/ofbiz.log (or you can surcharge it vith debug.properties) and FecthLogs list all file name ofbiz* present on runtime/logs/ofbiz.log and offert the possibility to search only line that macth a string.
I review the code to use only one script (remove LogView.groovy) and improve following points :
* Optimise the FetchLog.groovy to display with same velocity a file with or without string chain filtering
* Add a property to change the root log directory. Under linux we use /var/log/ofbiz/
* Add a regExp to match the file name of file present in the directory. Helpful when you want to see error.log
* Complete debug.properties with comment for describe example for new properties
And last point, add refresh button on the end page to reload the log without lost your state on the page.
Related issue OFBIZ-7944
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755302 13f79535-47bb-0310-9956-ffa450edef68
Most is done already. Test pass but testFopMacroLibrary but I don't see how it could be related to these changes, could be a quirk on Windows, BuilBot will tell us. Anyway, I will later double-check to be sure, also to see if I did not miss anything else.
I have voluntarily left 2 or 3 moot points
I was unable to remove possible POS references in <property key="FieldDescription.ProductStore.isImmediatelyFulfilled"> for certain language I'm unable to read.
I have to check if we should keep or not this code snippet
<!-- if inventory info is not available for all of the products, then don't do the issuance, ie there has to be at least SOME inventory info in the database to facilitate inventory-less POS terminals -->
<entity-count entity-name="InventoryItem" count-field="iiCount">
<condition-expr field-name="facilityId" operator="equals" from-field="orderHeader.originFacilityId"/>
</entity-count>
I simply commented out twice this snippet in InvoiceServices.java, because I wonder if it would not be useful when the webPos will be able to issue money change
// if (null == adj.get("amount")) { // JLR 17/4/7 : fix a bug coming from POS in case of use of a discount (on item(s) or sale, sale here) and a cash amount higher than total (hence issuing change)
// continue;
// }
While at it, since I modified OPTIONAL_LIBRARIES, I also changed these svn:properties: svn:eol-style = native & svn:mime-type = text/plain
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1754402 13f79535-47bb-0310-9956-ffa450edef68
We had already the org.apache logger. IIRW, it's because we use Apache libs (eg Tomcat) and we want to be warned when issues appear at this level.
By adding the org.apache.ofbiz info logger we should keep warnings a the org.apache level and get info at the org.apache.ofbiz level
I'm though unsure why we needed
<logger name="org.apache.ofbiz.base.converter.Converters" level="warn"/>
which seems contradictory. I Googled for an explanation but I'm still short of it. I'll check with http://logging.apache.org/log4j/2.x/manual/configuration.html.
For now it works, so I apply the patch because it's already a relief and will help to resolve the harder problem of instable tests results.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1753029 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
Remove all bsh libraries and bsh remaining fonctionnalities.
Bsh interpreter is replaced by GroovyShell evaluation.
To avoid groovyShell undefined var exception, the evaluated expression is analysed, detecting variables used and setting its to null if undefined in context.
Today only alphabetic variable with '_' are detected (i.e. my_variable==null).
Add in example a test replacement of " syntax to simple quote.
Remove all found bsh references
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752231 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
* removed the code that implemented the deprecated "call-bsh" operation in Minilang
* removed the BeanShellContainer (it has been disabled a long time ago)
* removed the BeanShell service engine, no more used
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751947 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