Commit Graph
1062 Commits
Author SHA1 Message Date
Adrian Crum f803833df9 ModelFormField.java refactor:
1. Extract FieldInfo class to a separate file.
2. Make FieldInfo thread-safe.
3. Modify FieldInfo subclasses so they include a thread-safe copy method.

This commit fixes a major flaw in the original design. When a widget form is extended, the original design would copy the child FieldInfo state to the parent FieldInfo - so the parent FieldInfo referenced the child form instead of the parent form. With this commit, parent FieldInfo instances  are copied as new instances to the child form - so the parent FieldInfo instances remain unchanged.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1639927 13f79535-47bb-0310-9956-ffa450edef68
2014-11-15 21:33:51 +00:00
Adrian Crum 1a21c100ff Add throws clause to ModelWidgetVisitor.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1639886 13f79535-47bb-0310-9956-ffa450edef68
2014-11-15 14:06:32 +00:00
Adrian Crum fd4ea93d14 Fix NPE caused by recent widget refactoring - https://issues.apache.org/jira/browse/OFBIZ-5875.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1639551 13f79535-47bb-0310-9956-ffa450edef68
2014-11-13 23:30:26 +00:00
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
Ashish Vijaywargiya 7859237729 Applied bug fix from jira issue - OFBIZ-5773 - <@htmlTemplate.renderDateTimeField> icon buttons disappear on some pages after refresh.
Thanks Akash Jain for the contribution. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626419 13f79535-47bb-0310-9956-ffa450edef68
2014-09-20 11:14:02 +00:00
Jacques Le Roux 3b118d4842 An excerpt of a patch from Nick Ho for "Add/Revise Traditional Chinese (zh-TW) translations" https://issues.apache.org/jira/browse/OFBIZ-5764
added/revised zh-TW translations in the framework, applications and specialpurpose folders to have consistent, commonly-used meaningful terms in Traditional Chinese.

jleroux: from Nick Ho's patch I have extracted only the Chinese changes, w/o the proposed  dash to underscore changes
This contains notably this 14 "zh" (not "sh-TW") changes:
<value xml:lang="zh">人将由电子邮件接受一个临时密码。</value><!-- was 客户将通过电子邮件收到一个临时密码。 -->
<value xml:lang="zh">合计属于公司: </value>
<value xml:lang="zh"> 完整文本:${fullText}</value>
<value xml:lang="zh">供货商佣金百分比</value>
<value xml:lang="zh">文本大小</value>
<value xml:lang="zh">值</value>
<value xml:lang="zh">算子</value>
<value xml:lang="zh">不能转移已序列化的库存。</value>
<value xml:lang="zh">货运收据</value>
<value xml:lang="zh">获取标识为 ${productStoreShipMethId} 的产品店铺送货方法(ProductStoreShipmentMeth)时出错:${errorString}</value>
<value xml:lang="zh">中国人民币元</value>
<value xml:lang="zh">如果选择"specify other",下拉框旁边会出现文本框。参考form的drop-down元素的other-field-size属性说明</value>
<value xml:lang="zh">文本消息</value>
<value xml:lang="zh">能够收到和解析XML消息,但是BSR->NOUN(买卖关系->名词) ${bsrNoun} 和/或 BSR->VERB(买卖关系->动词) ${bsrVerb} 是空的</value>
I have no competency to judge these changes, but from previous Shi Jinghai's feedback I believe there are OK

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1625816 13f79535-47bb-0310-9956-ffa450edef68
2014-09-17 20:44:07 +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
Jacques Le Roux 425ce1c003 A patch from Nick Ho for "Add/Revise Traditional Chinese (zh-TW) translations in framework" https://issues.apache.org/jira/browse/OFBIZ-5737
more added/updated translations patch files for zh-TW locale

jleroux: 
I added the label
<value xml:lang="zh_TW">服務執行程式拋出一個異常</value>
by hand
Only 1 label was not added:
<value xml:lang="zh_TW">代號</value>
Because of the fuzziness and presence of several possibilities


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621688 13f79535-47bb-0310-9956-ffa450edef68
2014-09-01 06:51:33 +00:00
Ashish Vijaywargiya e4d68ed2f7 Applied the patch OFBIZ-4902_framework.patch from OFBIZ-4902 - Replace in Freemarker templates the deprecated built-ins: default, exists, if_exists.
Thanks http://ofbiz.us team for providing the patch work.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1618325 13f79535-47bb-0310-9956-ffa450edef68
2014-08-16 10:58:51 +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
Jacques Le Roux 59119195eb A patch from Leon for "Wrong timeFormat of datetimepicker causes hours represented as 12 not 24" https://issues.apache.org/jira/browse/OFBIZ-5702
Latest datetimepicker add-on uses "timeFormat" option to detect am/pm, lowercase "h" represents 12hr am/pm, uppercase "H" represents 24 hr. (see https://github.com/trentrichardson/jQuery-Timepicker-Addon/issues/547). The datetime input widget that relying on this add-on does not work correctly: it's in 12-hours format not 24 hours.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1616272 13f79535-47bb-0310-9956-ffa450edef68
2014-08-06 16:39:30 +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 8f3be2d59f Dammit, reverts unwanted previous commit (wrong button)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1596126 13f79535-47bb-0310-9956-ffa450edef68
2014-05-20 07:42:55 +00:00
Jacques Le Roux 10f0335c64 git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1596125 13f79535-47bb-0310-9956-ffa450edef68 2014-05-20 07:40:25 +00:00
Jacques Le Roux a5e8b8639a Complete r1583026, sequel of "Focus input(dropdown list) when click on label in widget form" https://issues.apache.org/jira/browse/OFBIZ-5594. Thanks to Wei Zhang's report
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1584552 13f79535-47bb-0310-9956-ffa450edef68
2014-04-04 08:00: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 4d71caff21 Fixes a bug reported by Rong Nguyen "Error when first login and change password" https://issues.apache.org/jira/browse/OFBIZ-5564
Scenario:
 1. Load-seed
 2. Create-admin-user
 3. Access: /catalog/control/main
 4. Login
 5. Change password for the first use
 
After password change, web browser redirect user to /catalog/control/main with an error

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1575508 13f79535-47bb-0310-9956-ffa450edef68
2014-03-08 10:55:39 +00:00