If found this in console logs:
XmlFileLoader: File file:/home/ofbizDemo/trunk/framework/common/widget/CommonScreens.xml process error. Line: 491. Error message: cvc-complex-type.2.4.d: Invalid content was found starting with element 'xls'. No child element is expected at this point.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751055 13f79535-47bb-0310-9956-ffa450edef68
To automatically filter on fromDate thruDate attribute with value now, init a condition map like
<set field="conditionDates.default" value="Y"/>
To use specific attribute date with value now
<set field="conditionDates.fromDateName" value="startDate"/>
<set field="conditionDates.thruDateName" value="endDate"/>
To use an other value than now
<set field="conditionDates.filterByDateValue" from-field="invoice.invoiceDate"/>
or
<set field="conditionDates.filterByDateValue" value="2016-01-01 00:00:00" type="Timestamp"/>
You can also set only low border date
<set field="conditionDates.fromDateName" value="fromDate"/>
Or you can also set only high border date
<set field="conditionDates.thruDateName" value="endDate"/>
Thanks to Kongrath Suankaewmanee for the proposition follow on issue OFBIZ-7266
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750856 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
It also contains a slightly modified patch from Amardeep Singh Jhajj for "WebSocket Example - Push Notifications" - https://issues.apache.org/jira/browse/OFBIZ-7467 - It's adding working example (in example application) of WebSocket support
I tried to use websockets in OFBiz. I simply added tomcat-embed-websocket.jar in catalina lib and created one webapp for websocket and also added server endpoint class.
It didn't work. After that, I tried the same thing with plain j2ee application with embedded tomcat. It worked there.
I researched on above issue in OFBiz and got the reason. Websockets implementation need jar scanning enabled and it is currently disabled in OFBiz. Below is the code snippet of disabling jar scan from CatalinaContainer.java:
JarScanner jarScanner = context.getJarScanner();
if (jarScanner instanceof StandardJarScanner) {
StandardJarScanner standardJarScanner = (StandardJarScanner) jarScanner;
standardJarScanner.setScanClassPath(false);
}
Jar scanning enabling increase OFBiz server startup time upto couples of minutes (in my case, it took approx 8 minutes), so we don't want this much of startup time for OFBiz.
I got the following document where I found the reason why websocket is not working if scanning disabled.
https://wiki.apache.org/tomcat/HowTo/FasterStartUp
Here tips are given to decrease the startup time. This tips also include disabling of jar scanning.
We can say disabling jar scanning is right approach because if we enable it then scanner will scan all the jars loaded in OFBiz startup that we don't want.
But, If we want websockets working then we have to enable jar scanning.
For enabling jar scanning, we need below code:
standardJarScanner.setScanClassPath(true); // Will increase server startup time.
Solution: We can add filter on jar scanning. It will allow only some kind of jars only. For example: jars having websockets endpoints. I am attaching patch for the same here.
I added filter like if jar name string contains "discoverable" word then only it will be considered for jar scan. We can change jar name of our jars using build.xml to make it discoverable for jar scanning.
For example: I have added my websocket endpoint class in "specialpurpose/ecommerce/src" and changed the "name" property in build.xml of ecommerce component from "ofbiz-ecommerce"
to "ofbiz-ecommerce-discoverable". Here is the code snippet from build.xml:
<property name="name" value="ofbiz-ecommerce-discoverable"/>
This change will create the jar with name "ofbiz-ecommerce-discoverable.jar" in "ecommerce/build/lib/".
Now created jar will be scanned in jar scanner as its name contains "discoverable" word in it.
This change will not increase server start up time more than couple of seconds (in my case, it just two seconds). So scanning time totally depends on the list of jars scanned.
Conclusion: We can use websocket support with the help of jar filters.
The very basic working example of sending push notifications to all connected clients using WebSocket added by Amardeep Singh Jhajj works as follow:
1. Adds support to show push notifications over every screen of an example application using WebSocket when any example created or updated.
2. As it's an example, so for now push notifications will only for example creation and update using SECA's.
3. Push notification will be shown on screen for 5 seconds only, we can close it before 5 seconds using close button if needed.
The UI of notification pop-up can be changed. I kept it simple (No fancy work) to just demonstrate the WebSocket usage.
To see it in action, Please follow the steps given in OFBIZ-7073 and apply patch given here.
jleroux: I committed the 2 patches at the same time because the changes in .classpath and the LICENSE files were in the example patch for OFBIZ-7467.
I also slightly modified the example patch in order to provide an example where no sync issues are possible by using a Collections.synchronizedSet for the javax.websocket.Session Set. I also used synchronized loops as it's requested for synchronizedSet where it's used. I know it rather symbolic in the example component but it will remember developers about the possible sync issue.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750557 13f79535-47bb-0310-9956-ffa450edef68
===========================================
Manage filters in lookup auto completion
===========================================
Thanks Charles STELTZLEN for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750555 13f79535-47bb-0310-9956-ffa450edef68
As per updated code now-
INFO will be shown in Green color
WARNING will be in bold Blue color
ERROR will be in Red color along with border
DEBUG will be in Grey color
Thanks Swapnil M Mane for reporting the issue and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750336 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
When executing the print pdf function in https://demo-trunk-ofbiz.apache.org/facility/control/ViewFacilityInventoryByProduct
the following error is thrown:
Unable to transform FO file: org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: null:80:115: "fo:table-cell" is missing child elements. Required content model: marker* (%block;)+ (See position 80:115) javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: null:80:115: "fo:table-cell" is missing child elements. Required content model: marker* (%block;)+ (See position 80:115)
The issue was due to missing child element which is failing on validation. Earlier we were using fop-1.1.jar and now it is updated to fop-2.0.jar which by default validates the markup. It is same as OFBIZ-7090
I have added the missing child elements in the macro which were causing the validation to fail and providing the updated patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748628 13f79535-47bb-0310-9956-ffa450edef68