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
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
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
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
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
Actually this is due to both compound-widgets.xsd and ExampleCompoundWidgets.xml errors. Both have not visible effects but in logs
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741022 13f79535-47bb-0310-9956-ffa450edef68
Adrian: This adds the ability to include screen widgets, form widgets, menu widgets, and simple methods in a single XML file. This approach could be used in situations where the widgets share a logical grouping - so they can be kept in one place.
James: An example to test out Compound Screen Widget
jlerouxc: here are the changes and tests globally
# As James mentionned we no longer need *-v2.xsd files, I removed them from Adrian's patch
# I created a compound-widgets.xsd based on Adrian's and James Yong's previous work. From Paul Foxworthy's comment in OFBIZ-4090, I decided to name the root compound-widgets (hence the file name). I arranged its elements in another way, see below with ExampleCompoundWidgets.xml
# I slightly modified James Yong's ExampleCompoundScreenWidget.xml file and renamed it ExampleCompoundWidgets.xml. I added an "s" because there are several OFBiz widgets gathered in one place. For the modifications: I simply changed the names and arranged the elements in another way which I find better suited. I'm used to 1st create the query, then the menus, the screens and their forms. We rarely use widget-trees but it's there also. Finally the simple-method at end if any. The order is not enforced though, so everybody can use her/his own :)
# I added a French label
# I completed the widget-catalog.xml with this new entry and tested locally in Eclipse by reloading the XML catalog entries.
I hope I did not miss nor mixed things, the local instance I used is a bit overcrowded with pending changes...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738958 13f79535-47bb-0310-9956-ffa450edef68
Actually this worked perfectly well, I just used size instead of height in the hyperlink definition. Better to not set anything and use default value which are committed uncommented here
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1712411 13f79535-47bb-0310-9956-ffa450edef68
Instead of a quiet S/R action, this was an unexpected pain in the ass. A considerable number of forms:
EmployeeForms.xml
EmploymentForms.xml
EmplPositionForms.xml
GlobalHRSettingForms.xml
RecruitmentForms.xml
QuoteForms.xml
PartyForms.xml
StoreForms.xml
ContactForms.xml
FixedAssetForms.xml
TaskForms.xml
scrumForms.xml
TaskForms.xml
contained a large number of fields with
tooltip="${uiLabelMap.CommonRequired}"
but no
required-field="true"
Of course display and display-entity should not be concerned, I spotted a number of them in the lot.
I also removed a bunch of harcoded * at end of labels (those followed by required-field="true"* and spotted a number of others }*" who still need to be carefully reviewed to see if required=true is not missing there :/
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1709882 13f79535-47bb-0310-9956-ffa450edef68
jleroux: after a cursory review, I simply did the chunk related to exampleName by hand, it needed more work. I also removed some trailing blanks.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1709872 13f79535-47bb-0310-9956-ffa450edef68
1. Add zxing-core-3.2.0.jar to framework/base/lib and .classpath.
2. Add services_qrcode.xml and QRCodeService.java in framework/common/.
3. Add qrcode request in common-controller.xml and QRCodeEvents.java under framework/common/.
4. Add qrcode.properties and QRCodeUiLabels.xml under framework/common/.
5. Add a barcode example page in specialpurpose/example, entry is on page: /example/control/EditExample?exampleId=EX01, the example can be seen on page: /example/control/ExampleReportPdfBarcode?exampleId=EX01
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1696921 13f79535-47bb-0310-9956-ffa450edef68
With these elements, example component have a new FindExample search screen to select the display list type with a example of :
* include-form : list examples with their features
* include-screen : list examples with their items
* include-grid : list examples with their status history
The element include-menu is present on FindUtilCache screen. Also a new CommonInlineBarMenu menu type to display menu with specific purpose (in-line) is now present and with this logic adding in-line-bar css class on themes thomawak and flatgrey.
This patch is combinate Issues :
* OFBIZ-6502 Add support for form/grid embedding within grids
* OFBIZ-6501 Add support for screen embedding inside grids
* OFBIZ-6404 Allow form/grid widget hyperlinks to be grouped into a single column
sub-tasks of master issue OFBIZ-6314 Widget Refactoring - Placeholder issue
Thanks to Christian and Adrian for their time
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1686116 13f79535-47bb-0310-9956-ffa450edef68
Or on a form of type list or multi, it is not possible to completely ignore a field via use-when attribute. Instead it hides the title and the column header became shifted from the table content.
For example I want to hide the description column from my form when exampleName is choosen as sort-field.
This also modifies
example/widget/example/ExampleForms.xml#ListExamples
to illustrate this functionality
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1680865 13f79535-47bb-0310-9956-ffa450edef68
With NotoSans by default, no need to specify the NotoSans "font-family" to write special characters in examples PDF (including content called from example).
This already worked in reports because of "fop.font.family=NotoSans" in fop.properties. It's also the way to use for custom reports.
I also added <auto-embed/> like we have <auto-detect/> but I'm unsure of what it does exactly (I suppose it embeds the fonts glyphs in the PDF) because the FOP documentation is unclear about it (to say the least). If someone knows better please chime in!
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1675061 13f79535-47bb-0310-9956-ffa450edef68
<<passing the id in the other field does not work yet with autocompletion, WIP...>>
This works now, just tested on trunk demo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1666474 13f79535-47bb-0310-9956-ffa450edef68
It actually does more than that. It follows Adrian's proposition of improving the GeoPoint data model.
I did not applies all of Adrian's proposition (see our conversation in the Jira issue). Feel free to apply it completely if you are inclined so.
I will also add an entry in wiki page "Revisions Requiring Data Migration (upgrade ofbiz)" at https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=7045166
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1557447 13f79535-47bb-0310-9956-ffa450edef68