Commit Graph
1071 Commits
Author SHA1 Message Date
Adrian Crum da478e9144 Fix JS bug caused by recent screen widget refactoring - https://issues.apache.org/jira/browse/OFBIZ-5856.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1637050 13f79535-47bb-0310-9956-ffa450edef68
2014-11-06 08:24:53 +00:00
Adrian Crum f25e674873 Extract rendering code from ModelForm.java to rendering classes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636437 13f79535-47bb-0310-9956-ffa450edef68
2014-11-03 20:46:34 +00:00
Adrian Crum 46fb78ef34 Remove unused methods from ModelForm.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636383 13f79535-47bb-0310-9956-ffa450edef68
2014-11-03 16:29:40 +00:00
Adrian Crum 087c291998 Cleaned up ModelScreen.java transaction handling - https://issues.apache.org/jira/browse/OFBIZ-4278.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636374 13f79535-47bb-0310-9956-ffa450edef68
2014-11-03 15:32:11 +00:00
Adrian Crum 8e57e863f0 Major overhaul of ModelForm.java:
1. Class and its nested classes were not thread-safe.
2. Bugs caused by C&P errors.
3. The "extends" feature had problems:
  3.1 Only a few class members were inherited from the parent form.
  3.2 Child forms modified the state of the parent form.
4. Bad null/empty checking.
5. Inefficient code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636339 13f79535-47bb-0310-9956-ffa450edef68
2014-11-03 12:42:03 +00:00
Adrian Crum 833f3b4dad Bug fix and code cleanup in form widget:
1. Cache keys must include delegator name. Multiple forms based on the same entity name might be completely different due to the delegator being used.

2. Do not hold references to ModelReader and DispatchContext after construction.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636158 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 17:48:20 +00:00
Adrian Crum 25a4a9997f Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636139 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 14:22:29 +00:00
Adrian Crum 9275221812 Delegate most tree widget actions to ModelWidgetAction. Tree nodes will support an <actions> element like other widgets, but that is still a WIP.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636137 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 14:03:02 +00:00
Adrian Crum 2ac5f3cb46 Delegate most menu widget actions to ModelWidgetAction.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636102 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 12:03:09 +00:00
Adrian Crum 21e094915a Delegate most form widget actions to ModelWidgetAction.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636096 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 09:08:21 +00:00
Adrian Crum 4a62dd6107 Move form widget artifact info code to a separate class. This eliminates a lot of duplicate code and it should speed up artifact info gathering. Also converted form widget to reuse some of the screen widget action models.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636077 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 01:21:39 +00:00
Adrian Crum d389cdc2a9 Revert rev 1636071. I broke something.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636073 13f79535-47bb-0310-9956-ffa450edef68
2014-11-02 00:06:34 +00:00
Adrian Crum 89ad95e8d7 Move form widget artifact info code to a separate class. This eliminates a lot of duplicate code and it should speed up artifact info gathering. Also converted form widget to reuse screen widget action models.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636071 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 23:47:47 +00:00
Adrian Crum 46f16abccd Add a form field visitor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636070 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 23:43:06 +00:00
Adrian Crum f69d5fbe73 Move screen widget artifact info code to a separate class. This eliminates a lot of duplicate code and it should speed up artifact info gathering.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636031 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 20:15:27 +00:00
Adrian Crum d96c82438c Add a screen widget action visitor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636030 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 20:13:41 +00:00
Adrian Crum de2bae353a Add a screen widget model visitor. This will enable us to externalize a lot of unrelated code that has been included in the models, as well as provide a cleaner API for the renderers.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635990 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 16:57:07 +00:00
Adrian Crum 0b0aedacc6 Continue working on making widget models thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635984 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 16:11:46 +00:00
Adrian Crum 9b9ef5eea4 Remove unused rawString method from screen widgets. I will be committing a widget visitor soon, so if anyone really wants to generate screen widget XML they can create a visitor implementation for it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635964 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 15:13:12 +00:00
Adrian Crum 21c0969f4f Continue working on making widget models thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635961 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 14:56:07 +00:00
Adrian Crum a35f9e3b4e Continue working on making widget models thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635957 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 14:28:41 +00:00
Adrian Crum 6976bd1fa6 Begin working on making widget models thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635917 13f79535-47bb-0310-9956-ffa450edef68
2014-11-01 10:49:29 +00:00
Adrian Crum b887db4aef Remove Javolution from the widgets component.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635878 13f79535-47bb-0310-9956-ffa450edef68
2014-10-31 23:13:03 +00:00
Scott Gray 44e2c4fda1 Regex search/replace for delegator.findOne() to EntityQuery.queryOne()
Apologies for the large commit.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635383 13f79535-47bb-0310-9956-ffa450edef68
2014-10-30 04:18:05 +00:00
Ashish Vijaywargiya 63349b6a5f Applied patch from jira issue - OFBIZ-3382 - inter-app hyperlink generates incorrect url.
Thanks Pranay for the contribution and thanks Nathan for reporting the issue. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1632803 13f79535-47bb-0310-9956-ffa450edef68
2014-10-18 15:02:12 +00:00
Jacopo Cappellato 5e106b124d Upgraded to the latest, now official, release of Freemarker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1631299 13f79535-47bb-0310-9956-ffa450edef68
2014-10-13 06:45:42 +00:00
Jacopo Cappellato a67d04c2ee Removed deprecated methods in the widget API; cleaned up a bunch of old commented out code; fixed formatting issues; some minor code improvements (no functional changes).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1628361 13f79535-47bb-0310-9956-ffa450edef68
2014-09-30 06:20:29 +00:00
Jacopo Cappellato 75fe5a9107 Removed the old UtilJ2eeCompat util class that was probably created for compatibility with some old application servers.
UtilJ2eeCompat was used to figure out, by checking the servlet container implementation, if the response should be sent using a Writer or a OutputStream; a Writer was used for Tomcat, Websphere, Jetty, Orion, Jrun, Tradecity and an OutputStream was used for all the other servlet containers.

However accordingly to the Servlet api:

ServletResponse.getWriter():
         Returns a PrintWriter object that can send character text to the client.
ServletResponse.getOutputStream():
         Returns a ServletOutputStream suitable for writing binary data in the response.

Based on this getWriter() should always be used (for html pages) in all the containers, not just Tomcat, Websphere, Jetty, Orion, Jrun, Tradecity.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622976 13f79535-47bb-0310-9956-ffa450edef68
2014-09-07 06:32:25 +00:00
Jacopo Cappellato e4e0710c18 Removed old and unused experimental class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621810 13f79535-47bb-0310-9956-ffa450edef68
2014-09-01 14:44:19 +00:00
Jacopo Cappellato 6545122723 Removed unused/obsolete request/screen context fields.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621801 13f79535-47bb-0310-9956-ffa450edef68
2014-09-01 14:11:32 +00:00
Jacopo Cappellato 066d782950 Misc minor cleanups to log messages.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1616744 13f79535-47bb-0310-9956-ffa450edef68
2014-08-08 13:16:46 +00:00
Jacopo Cappellato 05073f29df Upgrade to the most recent version of Freemarker-2.3-gae: this is not an official release yet but it will be soon; I have committed this work, as discussed in the dev list, in order to get help from the community to test this new improved version of Freemarker and provide feedback to the Freemarker community.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605029 13f79535-47bb-0310-9956-ffa450edef68
2014-06-24 08:33:04 +00:00
Jacques Le Roux f23822cdca A patch from Rong Nguyen for "Focus input(dropdown list) when click on label in widget form" https://issues.apache.org/jira/browse/OFBIZ-5594
The current widget form does not focus input(dropdown list) when a label is clicked on.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1583026 13f79535-47bb-0310-9956-ffa450edef68
2014-03-29 16:49:02 +00:00
Jacques Le Roux ba28208c2f A patch from simon maskell for "Paginate in screen fails" https://issues.apache.org/jira/browse/OFBIZ-5574
When you use the paginate = true in a screen and the total number of rows returned is greater than 999 the string is formatted with a coma and an exception is thrown when trying to convert it to an Integer.

jleroux: this depends on language (French would be space) but Simon's fix works for all (we are only dealing with integers there)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1577268 13f79535-47bb-0310-9956-ffa450edef68
2014-03-13 18:23:47 +00:00
Jacques Le Roux bd6c3c7dad A slightly modified patch from Rong Nguyen for "Render multiMenu problem when linktype="hidden-form"" https://issues.apache.org/jira/browse/OFBIZ-5557
Scenario:
1. Go to Content webapp
2. Go to CompDoc menuitem
3. Search
4. Go to 'Tree' view
5. We can not use 'Up' and 'Down' function

When menu with linktype="hidden-form" was render for each menu, they has the same name for form element, so it cause error.
My solution is add extra attribute(extra-index) for Menu, and then in menu definition we provide this attribute and the forms with different name will be rendered.
My implement was tested in this bug for Content webapp

jleroux: I have simply amended the up and down labels to have them more legible. I'd have preferred to not have all uppercased, but ran out of time for such a trivial change


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1576891 13f79535-47bb-0310-9956-ffa450edef68
2014-03-12 20:37:56 +00:00
Jacques Le Roux c74c991639 Thanks to Jacopo's comment on dev ML, reverts r1576331 to avoid injecting the web world in the form model, rather calls MacroFormRenderer.renderDateTimeField() method.
In my opinion a better solution would be to rewrite EditCalendarExceptionWeek and EditCalendarExceptionDay screens to replace the call to EditCalendarExceptionWeek.ftl by direct accesses to the form widgets called by it. 
But this means a lot more analysis and delicate work (here the replacement is safe), so this will be it for now.

This is for "View Calendar broken in Manufacturing" https://issues.apache.org/jira/browse/OFBIZ-5558 reported by Rong Nguyen 
Url: https://demo-trunk.ofbiz.apache.org:8443/manufacturing/control/EditCalendarExceptionDay?calendarId=SUPPLIER Calendar broken
And is related with https://issues.apache.org/jira/browse/OFBIZ-4739 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1576506 13f79535-47bb-0310-9956-ffa450edef68
2014-03-11 21:25:25 +00:00
Jacques Le Roux e762ad9e0e A slightly modified patch from Rong Nguyen for "View Calendar broken in Manufacturing" https://issues.apache.org/jira/browse/OFBIZ-5558
Url: https://demo-trunk.ofbiz.apache.org:8443/manufacturing/control/EditCalendarExceptionDay?calendarId=SUPPLIER
Calendar broken

Related with https://issues.apache.org/jira/browse/OFBIZ-4739

jleroux: formatting and some other slight issues fixed in patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1576331 13f79535-47bb-0310-9956-ffa450edef68
2014-03-11 13:26:10 +00:00
Jacques Le Roux d16055c9cc With https://issues.apache.org/jira/browse/OFBIZ-64 the default option for text-find fields was like (aka begins with, don't ask why)
Then with https://issues.apache.org/jira/browse/OFBIZ-3128 contains became the default
But this was working only when defining a text-field. When auto-fields-entity (and I guess auto-fields-service, not tested) was used then like/begins-with was still the default.

This commit changes that and makes things consistent: contains is now always used and set as default everywhere (no longer need to specify the text-field when using auto-fields-* to have contains as default)

Note: I'm not quite sure why like/begins-with was still used as default, since it was no longer the default in widget-form.xsd, but anyway making contains default there works. Also in ModelFormField.java to have things consistent

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1576276 13f79535-47bb-0310-9956-ffa450edef68
2014-03-11 10:49:31 +00:00
Jacques Le Roux 0f80353735 A patch from Leila Mekika for "Problems in single form when use-when and position are used together" https://issues.apache.org/jira/browse/OFBIZ-5552
The service "renderSingleFormString" check the previous field position to see if the current field must be displayed after the previous field or on a new line. 

When the previous field has a use-when condition that is not valid, it remains as the currentFormField and the next field is compared with this "not rendered" field. If the position of this previous field is the same as the current field, the current is displayed on the next line.


To reproduce, add in a single form the three fields below :

<field position="1" name="first"><display description="first"/></field>
<field position="2" name="second" use-when="true"><display description="second"/></field>
<field position="2" name="second" use-when="false"><display description="second"/></field>

The field second is rendered on a new line

jleroux: this second version works correctly

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1574019 13f79535-47bb-0310-9956-ffa450edef68
2014-03-04 10:37:01 +00:00
Jacques Le Roux e28ab6bda6 Revert r1573161 (A patch from Leila Mekika for "Problems in single form when use-when and position are used together" https://issues.apache.org/jira/browse/OFBIZ-5552)
This had some side effects, like hiding the top part of the product edit screen

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1573498 13f79535-47bb-0310-9956-ffa450edef68
2014-03-03 09:49:34 +00:00
Jacques Le Roux d79ae78453 A patch from Leila Mekika for "Problems in single form when use-when and position are used together" https://issues.apache.org/jira/browse/OFBIZ-5552
The service "renderSingleFormString" check the previous field position to see if the current field must be displayed after the previous field or on a new line. 

When the previous field has a use-when condition that is not valid, it remains as the currentFormField and the next field is compared with this "not rendered" field. If the position of this previous field is the same as the current field, the current is displayed on the next line.


To reproduce, add in a single form the three fields below :

<field position="1" name="first"><display description="first"/></field>
<field position="2" name="second" use-when="true"><display description="second"/></field>
<field position="2" name="second" use-when="false"><display description="second"/></field>

The field second is rendered on a new line

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1573161 13f79535-47bb-0310-9956-ffa450edef68
2014-03-01 12:15:33 +00:00
Jacques Le Roux 0757ed8a24 A patch from Gareth Carter for "last index for paging is not calculated correctly" https://issues.apache.org/jira/browse/OFBIZ-5497
The last index (used on the last button) is not calculated correctly in ftl or the renderer classes. It currently users floor which works only for list sizes that are not multiples of the view size. When you have a list size which is a multiple of the view size, it does not subtract 1 for zero based index and therefore the last button goes to the last page + 1

Examples

listSize = 1
viewSize = 10
listSize / viewSize = 0.1
floor(0.1) = 0
This one produces the correct value

listSize = 20
viewSize = 10
listSize / viewSize = 2
floor(2) = 2
Last index should be 1 because of zero based index but never occurs

To reproduce, enter a view with a list and paging functionality, the list size must be a multiple of the view size


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1560176 13f79535-47bb-0310-9956-ffa450edef68
2014-01-21 20:53:29 +00:00
Jacques Le Roux c06bd63860 This fixes "Set field in (at least) widget screen does not take into account a locale for (at least) the Float type" https://issues.apache.org/jira/browse/OFBIZ-5453
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
2014-01-11 19:39:23 +00:00
Jacques Le Roux 22cdda72c4 This closes "Set field in (at least) widget screen does not take into account a locale for (at least) the Float type" https://issues.apache.org/jira/browse/OFBIZ-5453
And definitively fixes issues with i18n of geolocation 

It introduces a "locale" attribute to the "set" operation in widget (I only tested screen, form is quite similar, should be ok) and minilang.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1554681 13f79535-47bb-0310-9956-ffa450edef68
2014-01-01 21:30:12 +00:00
Jacques Le Roux ede1994465 A patch from Leon for "NPE thrown out while rendering disabled menu item" https://issues.apache.org/jira/browse/OFBIZ-5451
The method "renderLink" of new class MacroMenuRenderer calls the WidgetWorker.determineAutoLinkType. When menuItem.getDisabled() is true, the link target will be set to null and NPE occurs.

jleroux: This was related with r1517353 and r1537833. The Leon's patch fixes r1517353 and this commits also reverts r1537833


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1553887 13f79535-47bb-0310-9956-ffa450edef68
2013-12-28 18:55:53 +00:00
Jacques Le Roux 4c3e9b7ec8 No functional changes:
Removes all remaining unchecked warnings
Automatically adds some @Override

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1551207 13f79535-47bb-0310-9956-ffa450edef68
2013-12-16 13:30:46 +00:00
Jacques Le Roux 576a213948 No functional changes, code improvements
Fixes some dead code entries
Automatically adds some override annotations


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1550429 13f79535-47bb-0310-9956-ffa450edef68
2013-12-12 14:53:38 +00:00
Jacques Le Roux a38a21fc0a This closes "Introduce Tomcat's JreMemoryLeakPreventionListener and why" https://issues.apache.org/jira/browse/OFBIZ-5395
The idea is to avoid ThreadLocal with custom classes, this can lead to memory leaks when an external application server is used.
Reverts r1075322 (commit for OFBIZ-4107) hence removes CompilerMatcher 
Uses PatternFactory instead of CompilerMatcher class (from CompilerMatcher keeps the compiled patterns cache idea)
In UtilHttp.java
  Removes dead code
  Removes useless "UtilHttp." for class methods and constants calls (moot point, have we conventions on this?).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1542960 13f79535-47bb-0310-9956-ffa450edef68
2013-11-18 09:46:35 +00:00
Adrian Crum af23fe0b35 Refactored ConfigXMLReader.java - added exception handling. The class swallowed exceptions like controller.xml file is missing or invalid - making debugging difficult. This commit introduces a WebAppConfigurationException and it propagates that exception farther up the stack.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534517 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 06:50:05 +00:00
Adrian Crum 27f77678ef New feature - add placeholder to form widget. Patch contributed by Sumit Pandit.
https://issues.apache.org/jira/browse/OFBIZ-5341


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530656 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 14:54:40 +00:00