OFBiz reads properties from either a properties file or the entity:SystemProperty. The way it worked previously is that OFBiz reads from the entity:SystemProperty first and if there is no value associated with the target propertyname, it would then locate the value from the relevant properties file.
In other words, if there is a database entry for a property, the database entry should override the associated properties file.
The issue is that if a database entry exist but the value is empty, it would look for a value from the properties file. It should not do so. If a database entry exists for the propertyname of interest, the value should be taken from the database even if it holds an empty value.
"isExistInDb" is first defined in Map<String, String> getSystemPropertyValue(String, String, Delegator). This method is call by many other methods. "isExistInDb" is used to indicate whether the method is returning an empty value for the property that 'exists' in the database rather than as a result of an absent database entry for the property.
The other methods...
boolean propertyValueEqualsIgnoreCase(String, String, String, Delegator)
String getPropertyValue(String, String, String, Delegator)
String getPropertyValue(String, String, Delegator)
String getMessage(String, String, Locale, Delegator)
uses the above method and needs to decide whether to use the empty value returned (ie. empty value from an existing property entry in database) or decide if it needs to read from the property file (ie. property entry does not exist in database)
jleroux: this also add systemPropertyValue data in CommonSystemPropertyData.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748560 13f79535-47bb-0310-9956-ffa450edef68
When ofbiz starts and checks the database, it will leave open connections and they will not get reused.
If you run Check/Update database from webtools, you can see a new connection is created for your selected group
As far as I can tell, the problem lies in DatabaseUtil.getDatabaseMetaData. If the parameter connection is null, a new connection object is created but not closed (like any resource should be!)
jleroux: I was unable to "see a new connection is created for your selected group" when running "Check/Update database from webtools". But I tested with Postgres while and after discussing with Gareth about this.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748543 13f79535-47bb-0310-9956-ffa450edef68
I kept things as simple as possible. I only changed the following Ant targets
start
start-secure
start-batch
start-batch-secure
run-test
I also changed the startofbiz.bat file. The other start*.bat are for the POS and it's not expected to run on a server.
I put a mention when using "java -jar ofbiz.jar -u" (start)
I will add a mention in "Technical+Production+Setup+Guide" wiki page about using "java -jar ofbiz.jar"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748173 13f79535-47bb-0310-9956-ffa450edef68
(resource == null || resource.length() <= 0)
From Java spec. a String, Collection, Map or CharSequence can't have a negative length, so the pattern above can be reduced to
(resource == null || resource.length() == 0)
which can be replaced using
UtilValidate.isEmpty()
I checked, there are several other occurrences of this pattern (some very old, I guess most were routinely copied from an initial occurrence). I decided to replace all of them, here they are.
I did that already long ago for the
(resource == null || resource.length() == 0)
pattern. It remains 4 of them. Three are justified (because of the dependency on base component or because using isEmpty() on Object is disputable for performance reasons). I took care of the remaining one right aways (in SplashScreen.java)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747976 13f79535-47bb-0310-9956-ffa450edef68
===================================
Override allow-html attribute do not work in service implementing any interface
===================================
Thanks Nameet Jain for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747959 13f79535-47bb-0310-9956-ffa450edef68
I removed duplicate paths were componentname was uselessly repeated after component://componentname/script/org/ofbiz (projectmngr was the only one using there project instead)
I had few typos, easily fixed thanks to the tests. There could be still typos but they are unexpected and anyway no-brainer to fix
I'm still wondering about specialpurpose/example/minilang/README.txt.
I changed its content to
"The minilang directory is for static resources that are interpreted at run time rather than being compiled. This goes on the classpath, but does not get built or put into a JAR file."
not sure it makes any sense, I don't see how this relates to the classpath.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747712 13f79535-47bb-0310-9956-ffa450edef68
A thank you is due to Jacques Le Roux, whom substantially improved
the refactoring of the start component with his QA work, and also
credit is due to Jacopo Capellato and Gil Portenseigne for their help
This commit is the last commit on OFBIZ-6783 and applies the following:
- convert the startup loaders from ArrayList to List. Given that
only two loaders existed in the system since the beginning of
OFBiz means that it is really unnecessary to use the
loaders.trimToSize() method. It's simply too much specificity for
no apparent performance value. this leads to changing many method
signatures from ArrayList to list across different classes
- More simplification of Config.java by simplifying timezone setting
logic
- remove the throws StartupException from main. This was confusing
confused me a lot and lead to a regression from my refactoring
in OFBIZ-7167 because some exceptions bubble up all the way to
main but then the system does not terminate because other
threads are running. It took me and Jacques a long while to
dig it out and figure the root cause.
- Introduce a function called fullyTerminateSystem(StartupException e).
This function replaces the exception bubble issue that is
described above. Consequently, the methods init, status and
shutdown no longer throw an exception but instead terminate
the system (which is the right thing to do).
- finetune adaptStartupCommandsToLoaderArgs(...) and other
places in StartupControlPanel
- separate the Classpath creation from NativeLibClassLoader
creation. This makes it cleaner and easier to refactor
in the future
- break the StartupControlPanel.start(...) method into
smaller more readable methods. It is easier now to understand
the startup sequence for ofbiz in english words (the method names).
It also allows for cleaner refactoring in the future.
- add JavaDoc to a lot of methods all over the start component
- rename AdminPortThread to AdminServer and create a new class called
AdminClient. Now everything relating to controlling OFBiz directly
happens through StartupControlPanel such as start, stop or init
for the server, and everything which happens indirectly through
the network (by an admin client) is done through the AdminClient
which talks to AdminServer
- more refactoring of AdminServer to simplify the code and break it
down into multiple methods and refactor some messy old code
Assuming this commit is stable, and after waiting for a sufficient time
I will close the JIRA and move on with the refactoring exercise.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747288 13f79535-47bb-0310-9956-ffa450edef68
This issue was due to the declaration of map with list syntax. It was introduced when we moved from Javolution collections to java collections.
One more issue found after fixing map syntax, that is missing block elements error. Added checks to handle that error as well.
Thanks Amardeep Singh Jhajj for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747202 13f79535-47bb-0310-9956-ffa450edef68
Thanks to an excellent investigation by Jacques Le Roux we realized
that if not all tests are successful (on java -jar ofbiz -jar --tests)
then the system hangs and does not print HTML reports.
After investigating this issue, I realized that the old logic before
refactoring used to call System.exit(99) which executes all the shutdown
hooks and releases the system resources. In the new code, however, the
resources are not released as the exception simply bubbles up to the main
method and thrown out, while the other threads are still running. So
the resources are not released and build.xml cannot continue processing
the HTML results with <junitreport ...>
The fix is simple, but the investigation was hard. Big thank you to Jacques.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746737 13f79535-47bb-0310-9956-ffa450edef68
1. The following xsd are duplicated to use namespaces
site-conf.xsd -> site-conf-ns.xsd
widget-form.xsd -> widget-form-ns.xsd
widget-screen.xsd -> widget-screen-ns.xsd
widget-menu.xsd -> widget-menu-ns.xsd
simple-methods.xsd-> simple-methods-ns.xsd
For example, in site-conf-ns.xsd, we have the following document level attribute
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://ofbiz.apache.org/Site-Conf" targetNamespace="http://ofbiz.apache.org/Site-Conf">
instead of
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
2. The above schema are used into compound-widgets.xsd so that compound widgets use only one consolidated schema.
3. Update ExampleCompoundWidgets.xml to use the new compound-widgets.xsd. For example
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sc="http://ofbiz.apache.org/Site-Conf"
xmlns:sm="http://ofbiz.apache.org/Simple-Method"
xmlns:wf="http://ofbiz.apache.org/Widget-Form"
xmlns:wt="http://ofbiz.apache.org/Widget-Tree"
xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">
<sc:site-conf>
<sc:request-map uri="CompoundWidgets1">
<sc:security https="true" auth="true"/>
<sc:event type="simple" invoke="CompoundWidgetsFunc" path="component://example/widget/example/ExampleCompoundWidgets.xml"/>
<sc:response name="success" type="view" value="CompoundWidgets1"/>
</sc:request-map>
<sc:request-map uri="CompoundWidgets2"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="CompoundWidgets2"/></sc:request-map>
<sc:view-map name="CompoundWidgets1" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets1"/>
<sc:view-map name="CompoundWidgets2" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets2"/>
</sc:site-conf>
...... the rest
4. Change java code to support reading xml with namespace (i.e. xml for compound widgets)
jleroux: I simply replaced tabs by spaces in Java files and removed this commented out line
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/compound-widgets.xsd">
in ExampleCompoundWidgets.xml
We decided to duplicate the simple-methods.xsd rather than updating all concerned files. Else we would have to update the attributes at document level for rest of the controllers, menus, forms, simple methods and screens. For example, in controller.xml, we would have to change
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd”
to
xmlns="http://ofbiz.apache.org/sc” xsi:schemaLocation="http://ofbiz.apache.org/dtds/site-conf-ns.xsd”>
But especially we would have to use the same syntax with namespaces prefixes than in ExampleCompoundWidgets.xml (see example above). This can be discussed because with auto-completion it's not a big deal, but could be overwhelming for existing custom projects...
James mentionned that "the schema location at compound-widgets.xsd is relative to the project...". I don't see any problems with that. We can keep as is as long as we maintain the relation (ie if the main XSDs are moved). Moreover with the previous addition of compound-widgets.xsd in widget-catalog.xml it seems all things work correctly (eg w/o the new *-ns.xsd yet committed, the auto-completion works well in ExampleCompoundWidgets.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746302 13f79535-47bb-0310-9956-ffa450edef68
The tests did not pass because of xmlrpc. Simply adding it in http.request-map.list in url.properties and like for SOAPService request setting <security https="false"/> does it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746254 13f79535-47bb-0310-9956-ffa450edef68
The patch that I provided only emptied the files when they should be
deleted. This removes them completely
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746239 13f79535-47bb-0310-9956-ffa450edef68
I just realised that the main change (the one in ConfigXMLReader.java, exposed in a comment in OFBIZ-6849) was not committed in r1745525. I guess it was because of tests I did for OFBIZ-4090, I certainly removed these changes then and forgot to put them back.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746159 13f79535-47bb-0310-9956-ffa450edef68
This error occurs due to the code used for dependent drop down for country and state. At party email address update page, no dependent drop down used, so js code triggering the request with empty countryGeoId and generating console error. Added check in code that if drop down field is not present on page then no need to observe it for the change.
Thanks Amardeep Singh Jhajj for reporting the issue and providing patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746130 13f79535-47bb-0310-9956-ffa450edef68
In addition, add an export example button on FindExample screen and add complete macro ftl renderer unit test. Issue OFBIZ-6931 proposed by Leila Mekika. Thanks to her, jacques and pierre for theirs remarks.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746045 13f79535-47bb-0310-9956-ffa450edef68
See CVE-2016-2175: Apache PDFBox XML External Entity vulnerability
I did not try to update to version 2.0.1.
I only tested by using https://localhost:8443/example/control/ExampleReportPdfOptions?exampleId=EX01 but I got nothing, so I tried with R15.12 before backporting with the same issue so I guess it's unrelated with this update moreover with both branches I get an error in log for the barcode PDF I will open a Jira
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1745751 13f79535-47bb-0310-9956-ffa450edef68
Quoting Deepak on dev ML
Hi Jacques,
I think in fop.xconf file we have to keep http url, as FOP does not support
https baseUrl for external graphics due to certificate issue (not remember
exact reason).
{code}
<!-- Base URL for resolving relative URLs -->
- <base>http://localhost:8080</base>
+ <base>https://localhost:8443</base>
{code}
If we set the https as <base> than images will not be rendered. Please
refer
http://demo-trunk-ofbiz.apache.org/ordermgr/control/order.pdf?orderId=DEMO10091
and we get following error on console:
{code}
[java] 2016-05-27 13:51:48,308 |http-nio-8443-exec-3 |FOUserAgent
|E| Image not found. URI: /images/ofbiz_logo.gif. (No context
info available)
{code}
If we set the http url than its working fine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1745732 13f79535-47bb-0310-9956-ffa450edef68
This is another major refactoring exercise of the start
component in ofbiz. There are too many details in this commit
that may be summarized as follows:
- refactor Start.java to make it about 140 lines long and focused
only on high level function calls. Also minimized the number of
class fields (state) to only two (ServerState and Config)
- Separate the AdminPortThread into a new class with some refactoring
done to ensure interoperability with other classes
- delete CommonsDaemonStart as jsvc is not yet fully implemented in ofbiz
and it stands in the way of a proper refactoring of ofbiz
- refactor everything so that all dependencies between classes are explicit
through function calls (no hidden state or declarations)
- Move all the server processing logic (status, shutdown, start ...) to a
new class called StartupControlPanel. All methods in this class are static
with side effects only limited to the arguments passed to them.
- Add a few missing apache copyright headers
- Refactoring some method, variable and enum names to make them clearer
- Refactor Config.java and make it much cleaner and simpler by breaking
things down into private methods. Also changed the portoffset to be
a normal int instead of a boxed int (Integer)
- redefine most classes to be package protected (not public) to offer
more isolation from the rest of the framework
- redefine most classes to be final
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1745351 13f79535-47bb-0310-9956-ffa450edef68
as suggested by Jacques, the commons-cli screen is widened to be
80 characters instead of the default 74 characters. Also the test
command for java -jar ofbiz.jar is improved in terms of documentation
so that it does not break off into a newline which was confusing
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1744537 13f79535-47bb-0310-9956-ffa450edef68
Box the error messages with "=======" strings to highlight
the error the to user when calling java -jar ofbiz.jar --somewrongcommand
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1744525 13f79535-47bb-0310-9956-ffa450edef68