Commit Graph
4365 Commits
Author SHA1 Message Date
Taher A. Alkhateeb 29ef12a634 Fix and improve the library dependencies in Gradle - OFBIZ-7534
- Convert many compile dependencies to runtime dependencies in Gradle
- Move dependencies from framework to specialpurpose 
  (only one in example component)
- put a comment above dependencies which we think should be removed
  completely subject to further testing and confirmation from the
  community.

After investigating the libs we realized that most of the dependencies
in OFBiz are runtime rather than compile time. Furthermore, we also
suspect that many of the runtime dependencies are not needed, however
further testing is needed before we can confirm and remove them from
build.gradle


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1754640 13f79535-47bb-0310-9956-ffa450edef68
2016-07-31 08:54:26 +00:00
Jacques Le Roux d45dbb11b2 Removes system generated fields - POS - https://issues.apache.org/jira/browse/OFBIZ-7908
Thanks to Suraj Khurana and Scott for suggestion about POS to webPos

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1754611 13f79535-47bb-0310-9956-ffa450edef68
2016-07-30 09:37:22 +00:00
Jacques Le Roux 0ef717189f After removing the POS at r1754402, I tried the webPos and found that it missed the terminal data. As I suspected it was due to POS data and data model which were used by the webPos. For now I decided to add them all in webpos. We will see later which parts we can safely remove.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1754432 13f79535-47bb-0310-9956-ffa450edef68
2016-07-28 16:36:25 +00:00
Jacques Le Roux ddbea4ce13 This removes the pos component. OFBIZ-7804 "Check if we should fix or remove the POS (hence WebPos?)"
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/specialpurpose@1754402 13f79535-47bb-0310-9956-ffa450edef68
2016-07-28 12:27:20 +00:00
Jacques Le Roux d088cda009 No functional changes, set the svn;properties of all *.gradle files
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1754254 13f79535-47bb-0310-9956-ffa450edef68
2016-07-27 12:08:53 +00:00
Jacques Le Roux 8e3d7dfaef A patch from Florian Montalbano for "Scrum find Total Backlog Item is not working in non-English language" https://issues.apache.org/jira/browse/OFBIZ-7929
The Find form for Product Backlog Item does not work in language other than English when no "statusId" or "custRequestTypeId" are selected.

Step to reproduce :
- Go to the Scrum component and select a product
- Go to the "Total Backlog" tab
or use this link : https://localhost:8443/scrum/control/ViewTotalBacklog?productId=DEMO-PRODUCT-1

- Hit the search button, the find action is performed and return a non-empty list.
- Set your language preference to a non english language (french for example). 
- Click again on the "Total Backlog" tab, and hit the  "Rechercher" button.
- No results are found.

Where does the problem come from ?
The results displayed are from a list named "backlogList" which is built in the following script : FindProductBacklogItem.groovy .
In this script, there were a check on the parameter "custRequestTypeId" and on the parameter "statusId".
But the value was hardcoded :

if("Any".equals(parameters.custRequestTypeId))
and
if(!"Any".equals(parameters.statusId))

Obviously, when the form is in another language than English, those conditions aren't valid anymore (for example, "Any" is "Don't" in French")

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1754051 13f79535-47bb-0310-9956-ffa450edef68
2016-07-25 21:38:11 +00:00
Taher A. Alkhateeb fe0eb600ee replace the single library in LDAP component with remote - OFBIZ-7534
Another library replaced with remote. I was not able to get the exact
same version so instead of 3.3 I bumped it into 3.3.5. However, code
compiles and all tests pass


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753944 13f79535-47bb-0310-9956-ffa450edef68
2016-07-24 16:02:00 +00:00
Taher A. Alkhateeb 110db33ecb simplify the dependencies for the Solr component - OFBIZ-7534
It is not needed to declare all the dependencies explicitly becuase
all of them are automatically downloaded with the package:
'org.apache.solr:solr-core:5.3.1'
Hence, this makes the build script much shorter and cleaner


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753887 13f79535-47bb-0310-9956-ffa450edef68
2016-07-24 08:08:42 +00:00
Taher A. Alkhateeb c83d87086d Migrate the BIRT component fully to remote libs - OFBIZ-7534
This commit fully moves BIRT to remote libs. After a lot of
investigation we realized there were two offending dependencies
that prevented BIRT from working (Derby, and a PDF dependency).
Once these two dependencies were excluded BIRT successfully
compiled and all tests ran. I did some further manual testing
of BIRT and all HTML and PDF reports seem to render correctly.

This resolves what I consider the most difficult component
to migrate to remote libs.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753886 13f79535-47bb-0310-9956-ffa450edef68
2016-07-24 07:25:13 +00:00
Nicolas Malin c2bd2a7f11 Create demo PartyStatus data for existing parties for special purpose component, thanks to Suraj Khurana for the submission through OFBIZ-7672
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753795 13f79535-47bb-0310-9956-ffa450edef68
2016-07-22 14:10:14 +00:00
Jacques Le Roux 4ef1921019 Creates a (short term) Gradle "cleanAnt" task to remove old build dirs - https://issues.apache.org/jira/browse/OFBIZ-7898
Completes r1753424 where I removed (almost) all svn:ignore for concerned components build dirs. Once again I missed to update my svn client (external to Eclipse where I made the change) so I missed the specialpurpose and tools dirs. changes added after

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753499 13f79535-47bb-0310-9956-ffa450edef68
2016-07-20 13:05:27 +00:00
Jacques Le Roux cd920ff2e4 Creates a (short term) Gradle "cleanAnt" task to remove old build dirs - https://issues.apache.org/jira/browse/OFBIZ-7898
Completes the task by removing all svn:ignore for concerned components build dirs

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1753424 13f79535-47bb-0310-9956-ffa450edef68
2016-07-19 21:23:14 +00:00
Pranay Pandey c3631771ed [OFBIZ-7865] No functional change. Corrected formatting of Example component ftl files for improved readability.
Thanks Vaibhav Jain for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752964 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 14:02:45 +00:00
Pranay Pandey 9ee0ae93c9 [OFBIZ-7712] Fixed broken screen on 'Go Back' from edit contact mech screen of scrum component.
Thanks Aditi Patidar for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752956 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 13:16:43 +00:00
Deepak Dixit 8f3141cd46 (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Mridul Pathak 3801095538 [OFBIZ-7829] hhfacility: remove unused imports from Groovy files. Thanks Ankit Joshi for contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752905 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 07:14:07 +00:00
Deepak Dixit 3ac62d9fe8 (OFBIZ-1319) Replace selectall.js occurance with OfbizUtil.js.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752900 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 06:46:24 +00:00
Mridul Pathak efe3862baf [OFBIZ-7525] UiLabels missing on Examples PDF. Thanks Ankit Joshi for contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752896 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 06:37:45 +00:00
Mridul Pathak f60bfad7a3 [OFBIZ-7700] Fixed file not found exception in export to ebay. Thanks Ankit Joshi for contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752892 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 06:09:40 +00:00
Jacques Le Roux 9dae6c0a9f A patch from Pierre Smits for "Move SeoConfig.xml to e-commerce" https://issues.apache.org/jira/browse/OFBIZ-6125
Currently the configuration file (SeoConfig.xml) is incorporated in the product component. However this is more related to how the e-commerce operates than to the functions in the backend catalog and warehousing applications. 
The file should therefore be moved to its appropriate place.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752863 13f79535-47bb-0310-9956-ffa450edef68
2016-07-15 18:26:44 +00:00
Jacques Le Roux 943c973f0c A patch from Pierre Smits for "Rename search.properties in special purpose/lucene to lucene.properties" https://issues.apache.org/jira/browse/OFBIZ-6224
Currently many properties files in various components are named after the component, i.e. the bi component has bi.properties.
In order to have consistency from component to component the search.properties file in the special purpose/lucene component must be renamed to lucene.properties and all references in components should reflect the change.

jleroux: I had to handle the src path change

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752842 13f79535-47bb-0310-9956-ffa450edef68
2016-07-15 15:31:14 +00:00
Taher A. Alkhateeb 2963cd7188 Migrate ALL java files from /src to /src/main/java - OFBIZ-7790
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/specialpurpose@1752838 13f79535-47bb-0310-9956-ffa450edef68
2016-07-15 14:17:14 +00:00
Gil Portenseigne 9008b981b5 OFBIZ-7763 :
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 &quot; syntax to simple quote.
Remove all found bsh references

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1752231 13f79535-47bb-0310-9956-ffa450edef68
2016-07-11 23:04:54 +00:00
Taher A. Alkhateeb 25ffc93eb5 Another major patch for OFBIZ-7534 replacing Ant with Gradle
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/specialpurpose@1752033 13f79535-47bb-0310-9956-ffa450edef68
2016-07-09 18:10:19 +00:00
Jacopo Cappellato e920bb300e OFBIZ-7765 converted Minilang code that was using the deprecated "call-bsh" element to use the "script" element with Groovy. Thanks to Deepak Dixit for the work and the patch and to Nicolas Malin for the review and imporvement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751945 13f79535-47bb-0310-9956-ffa450edef68
2016-07-08 17:37:36 +00:00
Jacopo Cappellato aa27456e41 OFBIZ-7760 Removed from UtilCache the ability to persist entries in the file system.
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/specialpurpose@1751817 13f79535-47bb-0310-9956-ffa450edef68
2016-07-07 17:00:05 +00:00
Pranay Pandey 6e8df9ac07 [OFBIZ-7679] No functional change. Asset Maintenance FTL reformatting for better readability.
Thanks Vaibhav Jain for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751466 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 13:27:14 +00:00
Pranay Pandey f52a12fe51 [OFBIZ-7678] No functional change. BI component FTL reformatting for better readability.
Thanks Vaibhav Jain for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751464 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 13:20:07 +00:00
Deepak Dixit c22ec34684 (OFBIZ-7652) Applied patch jira issue.
===========================================
"Tasks" menu is showing selected when click in scrum component
===========================================

Thanks  Pawan Verma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751408 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 08:29:41 +00:00
Deepak Dixit f321a4e954 (OFBIZ-7703) Applied patch jira issue.
===========================================
Unable to set thru date for List survey screen of project component if more than one survey in available.
===========================================

Thanks  Pawan Verma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751405 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 08:10:03 +00:00
Jacopo Cappellato 33c1a1a2b9 The googlecheckout component has been removed in rev. 1751262. - OFBIZ-7705
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751395 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 04:46:55 +00:00
Ashish Vijaywargiya 923342c1fc Applied patch from jira issue - OFBIZ-7705 - Remove Google Checkout component from specialpurpose as it was discontinued.
Thanks Ravi for removing the reference of Google Checkout from everywhere.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751393 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 04:24:53 +00:00
Divesh Dutta 43b4addf95 [OFBIZ-7669] ebayStore: Checkbox and Radio buttons should get selected on clicking upon their labels.Thanks Mohammad Kathwala for your patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751350 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 17:15:43 +00:00
Divesh Dutta ffd42630aa [OFBIZ-7668] ebay: Checkbox and Radio buttons should get selected on clicking upon their labels. Thanks Jagpreet for your patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751349 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 17:12:59 +00:00
Ashish Vijaywargiya 4da862b072 Removing the folder now. It seems that my previous commit skipped the root folder.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751266 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 12:45:46 +00:00
Ashish Vijaywargiya 5645eba192 Applied patch from jira issue OFBIZ-7727 - Remove Google Base component from specialpurpose as it is discontinued.
Thanks Ravi for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751263 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 12:35:22 +00:00
Ashish Vijaywargiya 8b6a9a545e Applied patch from jira issue - OFBIZ-7705 - Remove Google Checkout component from specialpurpose as it was discontinued.
Thanks Ravi for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751262 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 12:32:42 +00:00
Arun Patidar edae307d33 Applied patch from jira issue - OFBIZ-7551 - Enforce noninstantiability to SSLUtil class. Thanks Rishi solanki and Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751040 13f79535-47bb-0310-9956-ffa450edef68
2016-07-02 08:50:31 +00:00
Arun Patidar 798210fd15 Applied patch from jira issue - OFBIZ-7421 - Required client side validation on sending BIRT report by mail. Thanks Anurag Chandak for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751037 13f79535-47bb-0310-9956-ffa450edef68
2016-07-02 08:38:37 +00:00
Arun Patidar d1de049cec Applied patch from jira issue - OFBIZ-7305 - Small UI issue at project overview. Thanks Anurag Chandak for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751036 13f79535-47bb-0310-9956-ffa450edef68
2016-07-02 08:30:55 +00:00
Arun Patidar ae87367a8f Applied patch from jira issue - OFBIZ-7562 - Enforce noninstantiability to UtilDateTime class. Thanks Rishi Solanki and Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751028 13f79535-47bb-0310-9956-ffa450edef68
2016-07-02 06:16:52 +00:00
Arun Patidar f8cb0bb6ac Applied patch from jira issue - OFBIZ-7589 - Enforce noninstantiability to UtilHttp class. Thanks Rishi Solanki and Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1751026 13f79535-47bb-0310-9956-ffa450edef68
2016-07-02 05:56:47 +00:00
Arun Patidar 6e4f80488d Applied patch from jira issue - OFBIZ-7316 - Product Demand Report is not working. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750964 13f79535-47bb-0310-9956-ffa450edef68
2016-07-01 15:21:12 +00:00
Arun Patidar 7e9823c747 Applied patch from jira issue - OFBIZ-7315 - Order Discount Code Report is not working. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750959 13f79535-47bb-0310-9956-ffa450edef68
2016-07-01 15:08:06 +00:00
Arun Patidar 1ff37b0df2 Applied patch from jira issue - OFBIZ-7515 - Balance Sheet PDF export fails. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750940 13f79535-47bb-0310-9956-ffa450edef68
2016-07-01 14:06:51 +00:00
Arun Patidar 867e4095cf Applied patch from jira issue - OFBIZ-7514 - Income Statement PDF export fails. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750925 13f79535-47bb-0310-9956-ffa450edef68
2016-07-01 13:28:42 +00:00
Arun Patidar 5483ec0916 Applied patch from jira issue - OFBIZ-6638 -TrialBalance PDF export fails. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750922 13f79535-47bb-0310-9956-ffa450edef68
2016-07-01 13:03:32 +00:00
Arun Patidar b3c2be0225 Applied patch from jira issue - OFBIZ-7262 - Error on closing and re-opening of project. Thanks Anurag Chandak for your patch and Montalbano Florian for verifying patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750651 13f79535-47bb-0310-9956-ffa450edef68
2016-06-29 14:29:19 +00:00
Jacques Le Roux 54917e8bbd A last slightly modified patch from James Yong for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
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/specialpurpose@1750647 13f79535-47bb-0310-9956-ffa450edef68
2016-06-29 14:06:29 +00:00
Jacques Le Roux ee836db2ea A patch from Amardeep Singh Jhajj for "Add websocket support in OFBiz" https://issues.apache.org/jira/browse/OFBIZ-7073
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/specialpurpose@1750557 13f79535-47bb-0310-9956-ffa450edef68
2016-06-28 18:50:04 +00:00