Jacopo Cappellato
a5879b6f8f
Moved code dependent on OWASP ESAPI and utilities for codec tasks from StringUtil to a new UtilCodec class: now the UtilCodec class is the only class dependent on OWASP ESAPI.
...
The DefaultEncoder from OWASP ESAPI, used internally by UtilCodec is now built with the default constructor that also adds the JavascriptCodec to the list of codecs used to canonicalize and validate the input.
Renamed the UrlEncoder class to UrlCodec in order to better describe its behavior.
Misc minor cleanups.
Added to the list of tests of the base component a series of Junit test classes that were missing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648403 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 18:24:57 +00:00
Jacopo Cappellato
b969e376ed
A series of cleanup to the integration with OWASP ESAPI. Isolated dependencies on the external OWASP ESAPI jar into the StringUtil class.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648298 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 09:24:46 +00:00
Adrian Crum
dfb9f37a1f
Refactor menu widget to reuse common condition models.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648153 13f79535-47bb-0310-9956-ffa450edef68
2014-12-28 08:13:28 +00:00
Adrian Crum
51f7152723
Extract screen widget condition models to a separate class so they can be reused in other widgets.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648152 13f79535-47bb-0310-9956-ffa450edef68
2014-12-28 07:37:03 +00:00
Adrian Crum
1fc589d681
Some fixups for the Form widget refactor.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648142 13f79535-47bb-0310-9956-ffa450edef68
2014-12-28 02:22:06 +00:00
Adrian Crum
cd3ed9f83d
Begin work on ModelMenu.java thread safety.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648093 13f79535-47bb-0310-9956-ffa450edef68
2014-12-27 19:18:12 +00:00
Adrian Crum
e5fcf293ae
Merged revision(s) 1635411 from ofbiz/branches/boostrap_theme:
...
MacroScreenViewHandler.java improvement: get macro library locations from Visual Theme resources. Themes can create their own HTML now.
resourceTypeEnumId=VT_SCRN_MACRO_LIB - screen macro library location
resourceTypeEnumId=VT_FORM_MACRO_LIB - form macro library location
resourceTypeEnumId=VT_TREE_MACRO_LIB - tree macro library location
resourceTypeEnumId=VT_MENU_MACRO_LIB - menu macro library location
Merged revision(s) 1635465 from ofbiz/branches/boostrap_theme:
Fix ClassCastException.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648013 13f79535-47bb-0310-9956-ffa450edef68
2014-12-26 19:06:30 +00:00
Adrian Crum
124b003d0d
Rewrite ModelFormField.java and related classes. Most of this is thread-safe now. Implemented a builder design because the original ModelForm design makes several passes over the fields - modifying them incrementally. Now ModelForm modifies builders instead, then when the parsing process is complete, the builders create the thread-safe field models.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647936 13f79535-47bb-0310-9956-ffa450edef68
2014-12-26 06:47:13 +00:00
Ashish Vijaywargiya
c572355faf
Applied patch from jira issue OFBIZ-5313 - Tree rendering is missing labels.
...
Thanks Sumit for creating the issue and providing the patch for the same. Thanks Arun for verifying the issue.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646969 13f79535-47bb-0310-9956-ffa450edef68
2014-12-20 12:37:07 +00:00
Jacques Le Roux
73e1958d50
No functional changes
...
Removes a tab found by chance.
My Eclipse setting automatically adds Override annotations when needed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646656 13f79535-47bb-0310-9956-ffa450edef68
2014-12-19 09:35:55 +00:00
Ashish Vijaywargiya
039f0608bc
Applied framework related patch from jira issue - OFBIZ-5844 - Convert java files to EntityQuery.
...
Thanks Arun for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646212 13f79535-47bb-0310-9956-ffa450edef68
2014-12-17 12:13:46 +00:00
Jacques Le Roux
cd75b72260
A patch from Leon for ""Value" attribute of hidden form field is overridden by same name value in context" https://issues.apache.org/jira/browse/OFBIZ-5904
...
Uses URLEncoder.encode while rendering a link
Uses StringUtil.htmlEncoder.encode while rendering a form field.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644904 13f79535-47bb-0310-9956-ffa450edef68
2014-12-12 14:46:56 +00:00
Ashish Vijaywargiya
9e044d163a
Applied patch from jira issue - OFBIZ-5902 - Fetch configurable settings data driven by replacing UtilProperties.getPropertyValue() method with EntityUtilProperties.getPropertyValue(). Thanks so much Arun for this important contribution.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644015 13f79535-47bb-0310-9956-ffa450edef68
2014-12-09 10:09:22 +00:00
Adrian Crum
fe1a35d9af
Screen widgets - some code cleanup plus add some accessor methods.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1643683 13f79535-47bb-0310-9956-ffa450edef68
2014-12-07 15:23:55 +00:00
Adrian Crum
50811e5a51
Screen widgets - clean up some object types around SectionsRenderer class.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1643584 13f79535-47bb-0310-9956-ffa450edef68
2014-12-06 18:50:10 +00:00
Jacques Le Roux
82506bb7cc
It's not quite clear to me why Date.CultureInfo.formatPatterns.longTime from date.js returns ms (always .000 it seems). I don't know if this would not happen, but anyway I prefer to assign the value to the calendar out of the block which changes the value.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1641165 13f79535-47bb-0310-9956-ffa450edef68
2014-11-23 08:49:48 +00:00
Jacques Le Roux
c680b1c262
A patch from Gareth Carter for "jQuery datetimepicker popup time value is not set correctly from an existing value" https://issues.apache.org/jira/browse/OFBIZ-5883
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1641131 13f79535-47bb-0310-9956-ffa450edef68
2014-11-22 22:48:44 +00:00
Adrian Crum
865c3ef338
Fixed a bug in the form widgets that was caused by recent refactoring - https://issues.apache.org/jira/browse/OFBIZ-5882 .
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1641087 13f79535-47bb-0310-9956-ffa450edef68
2014-11-22 15:56:41 +00:00
Jacques Le Roux
d244ee435b
A slightly modified patch from Gareth Carter for "<@htmlTemplate.renderDateTimeField does not parse date string based on input format" https://issues.apache.org/jira/browse/OFBIZ-5850
...
Commit 1626419 changed htmlFormMacroLibrary.ftl renderDateTimeField to use Date.parse instead of Date.parseExact.
https://code.google.com/p/datejs/wiki/APIDocumentation states Date.parse will use current CultureInfo for formats but for parsing ISO yyyy-MM-dd from hidden field, need to use parseExact.
I spotted this when CultureInfo was en-GB and selecting 2014-11-01 on any date field (i18n field displays 11/01/2014 instead of 01/11/2014)
For November all days after the 12th display correctly
jleroux: I simply removed the line added in the block which remove the dot and 000 ms in date/time string. I did not see any reason why this was needed. I modified the comment on this block for faster understanding.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1641066 13f79535-47bb-0310-9956-ffa450edef68
2014-11-22 14:15:54 +00:00
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