Commit Graph
1568 Commits
Author SHA1 Message Date
Nicolas Malin 5229d572df Implemented: Element link can update partial area
(OFBIZ-11810)

   Currently when you want to display an information easily on sub-screen
dynamically (example as related element) is currently not possible without
write specific js code.
   To simplify it, we introduce a new link type: update-area, to indicate
to the theme that we want to refresh  a local area with the call result.

   Example :
       <link target="ListCategoryProductMembers" link-type="update-area" target-window="detail">
           <parameter param-name="productCategoryId"/>
       </link>

For this example we indicate that the display result of target 'ListCategoryProductMembers' is going
on the area identify by 'detail'. Pleasure to the theme to manage it.
2021-02-17 18:11:19 +01:00
Wiebke Pätzold 384572401d Improved: Fixed indentation level (OFBIZ-12169) 2021-02-09 14:12:15 +01:00
Wiebke Pätzold 95d37d2189 Removes and adds whitespaces as suggested by checkstyle (OFBIZ-12169) 2021-02-09 08:46:20 +01:00
Michael Brohl bae3628501 Declare classes final as suggested by checkstyle (OFBIZ-12169)
Helper and Worker classes which are likely to be extended by custom
projects where left as is.
2021-02-08 17:09:56 +01:00
Wiebke Pätzold 2fe5e15a83 Improved: Adds newline at the end of file (OFBIZ-12169) 2021-02-08 16:31:13 +01:00
Jacques Le Roux c54dced51c Improved: Improve description encoding in 2 classes: MacroFormRenderer and renderableFtlFormElementsBuilder (OFBIZ-12159)
Concern MacroFormRenderer::makeHyperlinkByType and renderableFtlFormElementsBuilder::encode
I'm not sure it's useful but it's harmless
2021-01-23 18:18:16 +01:00
Jacques Le Roux cb9c366327 Fixed: Ampersand in Party not displayed correctly (OFBIZ-12140)
In the reported case, ModelFormField::getDescription double HTML encodes the
description when both the entity and the description contain an ampersand.

A solution is to test if the description is already HTML encoded before encoding
it again. If HTML encoded then only String encodes it.

BTW I'm not sure it's useful but it's harmless, the same solution can be applied
to OFBIZ-12026 and similarly in renderableFtlFormElementsBuilder::encode. I'll
do as improvements...

Thanks: Andrew Waters for report and help in analysis
2021-01-23 17:56:15 +01:00
Jacques Le Roux 3f76f86014 Improved: Marked unused HTML renderers as deprecated (OFBIZ-11927)
Upcoming Branch is actually another name for trunk. It's always evolving and
never released. Better put a date when deprecating a Class or method. Else you
have no idea when it was deprecated, apart referring to git-blame.
2021-01-16 10:14:28 +01:00
Daniel Watford 406f51d032 Improved: Marked unused HTML renderers as deprecated
(OFBIZ-11927)
2021-01-14 17:30:03 +00:00
Daniel Watford d40081dc86 Improved: Minor changes to reduce checkstyle warnings count 2021-01-13 14:28:19 +00:00
James Yong 9c7dc7b877 Improved: Rename MultiBlockHtmlTemplateUtil to ScriptLinkHelper (OFBIZ-12134)
Rename + Refactor
2021-01-13 09:26:42 +08:00
Nicolas Malin e0a840a0c4 Implemented: Access to the current screen from any widget element
(OFBIZ-11809)

During the rendering process, an element have no information about the screen which is dependent from. This not really help to automate some refresh treatment and force the developer to know the screen structure where is the element.

To solve this situation we implement a new class, ScreenStack that allow anytime for any element to identify its direct dependency. This help to resolve the unique Id that the screen take and can be used by the theme.

At any time a developer can retrieve the screen reference with uel function screen:id(screenStack)

example:
     <container id="${screen:id(screenStack)}">

The object screenStack is always present during a rendering process.
2021-01-12 17:48:00 +01:00
James Yong 3c83ab53b2 Refactoring 2021-01-12 23:25:25 +08:00
Daniel Watford 3795727ea2 Improved: MacroFormRenderer refactoring of label, display and text
fields

(OFBIZ-11900)

New RenderableFtl elements to represent pre-rendered FTL strings and FTL
macro calls. RenderableFtl elements are able to render themselves to
strings which are processed as an FTL template by the FtlWriter class.

For labels, display fields and text fields, MacroFormRenderer no longer
generates FTL to write to a template itself, but instead calls
RenderableFtlFormElementsBuilder to create corresponding RenderableFtl
elements which are then processed by FtlWriter. This is a WIP to reduce
complexity in MacroFormRenderer.
2021-01-12 10:40:58 +00:00
James Yong 067db8fe9e Improved: Open Menu file from browser (OFBIZ-12119)
User can open menu definition file from the browser by clicking on the named border.
2021-01-09 13:05:23 +08:00
James Yong f484b0d318 Fixed: Open Screen file from browser (OFBIZ-12038)
Fix named borders not rendered for sub-screens.
2021-01-06 23:23:35 +08:00
James Yong 203fa5f1c1 Implemented: Support Freemarker square interpolation syntax (OFBIZ-12099)
Use square interpolation syntax when file extension is .spi.ftl
2020-12-21 19:46:11 +08:00
James Yong 483e77ea83 Fixed: Date picker not initialised in ajax-called form (OFBIZ-12097)
Use inline script when request is ajax
2020-12-20 08:46:52 +08:00
Jacques Le Roux ec2b84341e Reverted: "Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)"
This reverts commit 17eb2e4cf7.

It does not work when using <<target="javascript:........>>
I could change those cases but it's easier and safer to simply revert back to
target-type!

Thanks: James for report
2020-12-18 11:08:32 +01:00
Jacques Le Roux 93fb762071 Improved: Add unique identifier data to portlet context (OFBIZ-12090)
Add the portalPortletId + portletSeqId to the portlet context. This is useful if
a unique identifier within the portlet body (the portlet content) is required.

Thanks: Ingo Wolfmayr
2020-12-12 19:39:31 +01:00
Jacques Le Roux caded9e937 Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)
When we use any title with special characters for hyperlink tag, it shows broken
string on UI, eg:
<hyperlink description="${uiLabelMap.CommonImportExport}"  target="ImportExport">
should render a button with the title "Import/Export. But it shows as
Import&#x2f;Export

jleroux: I have noticed that the same happens with special French characters.
So it's a general issue.
The title (description in code) is HTML encoded and that does not work for
special characters. I simply used a string encoder.

Thanks: Pradeep Choudhary for report, Sourabh Jain for a possible but not
general solution at OFBIZ-12023, ie using target-type="plain"
2020-12-11 13:40:53 +01:00
James Yong c1644940e9 Fixed: Make locale available for DateFindField and DateTimeField macros (OFBIZ-12086)
Fixed compile error in MacroFormRendererTest.java.

Thanks: Daniel and Tomek for the finding
2020-12-07 23:46:02 +08:00
James Yong 76a940ab43 Improved: Make locale available for DateFindField and DateTimeField macros (OFBIZ-12086)
DateFindField and DateTimeField macros need to find locale-specific javascript library files.
2020-12-05 23:13:55 +08:00
Jacques Le Roux 21e5f215f1 Fixed: Sorting of lists generates undesired results (OFBIZ-8302)
Workaround for an issue reported by
MacroFormRendererTest::renderSortFieldUsesQueryString
Put in with "MacroFormRenderer refactoring" (OFBIZ-11456)

I put a FIXME as I'm not sure how to handle it in a reasonable time :/
2020-11-01 17:43:07 +01:00
Jacques Le Roux cd242ea34c Fixed: Sorting of lists generates undesired results (OFBIZ-8302)
For this issue (OFBIZ-8302) I reverted the point 1 of
http://svn.apache.org/viewvc?view=revision&revision=1759555

As reported by Alvaro Munoz from GH security team it's not sufficient:
<<the second part of the fix was not effective, since the attacker can close the
raw string context with a double quote and write a new attribute or even close
the macro tag and write arbitrary FreeMarker code.>>

So this removes the 2nd part and add better solution to fix the OFBIZ-8302 issue
The solution is to encode only the QueryString and to handle it correctly in
UtilHttp::getParameterMap. I must say it was not a sinecure!
2020-10-31 20:21:32 +01:00
James Yong 127cd86da7 Improved: Open Screen file from browser (OFBIZ-12038)
Refactoring
2020-10-11 09:18:58 +08:00
James Yong a983c7741c Improved: Open Form Widget (Single Type) source file from browser (OFBIZ-12041)
Add function to open the corresponding Form Widget file with IDE
when the named border is clicked from browser.
Dependent on widget.dev.namedBorder and widget.dev.cmd.openSourceFile properties.

Thanks Jacques for review
2020-10-11 08:37:39 +08:00
James Yong cbbcb14119 Improved: Open Screen file from browser (OFBIZ-12038)
Refactoring
2020-10-10 18:06:14 +08:00
James Yong 0088af8b90 Fixed: Open Screen file from browser (OFBIZ-12038)
Fix regresssions in integration tests
2020-10-10 16:29:41 +08:00
James Yong 5fca2ed58d Improved: Open Screen file from browser (OFBIZ-12038)
Refactoring
2020-10-10 12:39:43 +08:00
James Yong 0e40d9f091 Improved: Open Screen file from browser (OFBIZ-12038)
Allow the opening of screen definition that contributed to the web page from the browser. Command to open the file is set at widget.dev.cmd.openSourceFile.

Thanks Jacques for review.
2020-10-08 15:28:43 +08:00
James Yong 582e6c6ac9 Improved: Open FTL File from browser (OFBIZ-12018)
Comment + Rename method
2020-10-03 11:08:14 +08:00
James Yong aa8ae4b01e Improved: Move SeoConfigUtil.java from Product to Widget component (OFBIZ-12031)
Help to remove dependency of product component from widget component
An afterthought: webapp component seems better for SeoConfigUtil.java than widget component.

Thanks Jacques for review
2020-10-02 22:57:15 +08:00
James Yong 10fbedbce0 Fixed: Open FTL File from browser (OFBIZ-12018)
Not able to open source file when clicking on named border in ecomseo landing page

Thanks Jacques for reporting
2020-10-02 20:33:44 +08:00
James Yong f15c037e07 Fixed: Open FTL File from browser (OFBIZ-12018)
Some named borders were hidden in ecomseo landing page
2020-09-30 19:16:53 +08:00
James Yong 91d8a2f02a Improved: multi-block attribute for html-template tag (OFBIZ-11686)
Form getJs link according to SEO Config setting
2020-09-28 21:54:25 +08:00
James Yong c911019856 Improved: Open FTL File from browser (OFBIZ-12018)
Better usability when clicking on named border
2020-09-28 21:50:01 +08:00
Suraj Khurana acdddaf85c Improved: Corrected some spacing issues in code, where there are extra white spaces, this will fix some checkstyle issues in framework component.
(OFBIZ-12022)
2020-09-26 14:01:43 +05:30
James Yong 4b8dd2a06b Fixed: Open FTL File from browser (OFBIZ-12018)
Unable to open file in Windows

Thanks Jacques for reporting.
2020-09-25 22:44:46 +08:00
James Yong d7a5d601bd Fixed: Open FTL File from browser (OFBIZ-12018)
StringIndexOutOfBoundsException error in Windows

Thanks Jacques for reporting.
2020-09-25 13:00:34 +08:00
James Yong ad2e8de7c2 Improved: Open FTL File from browser (OFBIZ-12018)
Add function to open the corresponding FTL file with IDE
when the named border is clicked from browser.

Thanks Rishi and Jacques for review
2020-09-24 21:36:24 +08:00
Jacques Le Roux ee8bd3f5d4 Fixes a JavaDoc issue 2020-09-24 10:32:06 +02:00
Jacques Le Roux f1b88bd84b Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
Better use Debug.logVerbose in place where I replaced missing expression with
another varation of Debug.log. We mainly don't need these information, it's only
for Checkstyle.

I thought did not replace cases where using another variation makes sense
2020-09-21 10:45:03 +02:00
James Yong 2cc3ab0f66 Fixed: Show border and file name for content rendered from ftl (OFBIZ-12002)
Error in testIntegration

Thanks Jacques for reporting
2020-09-19 23:34:53 +08:00
James Yong 347c905674 Improved: Show border and file name for content rendered from ftl (OFBIZ-12002)
New property “widget.dev.namedBorder” to control the display of the named border

Thanks Michael for review
2020-09-18 14:37:36 +08:00
James Yong d4713fa647 Improved: Remove formatBoundaryComment function in HtmlWidgetRenderer class (OFBIZ-12015)
Use buildBoundaryComment function instead of formatBoundaryComment function. Both functions do the same thing.

Thanks: Jacques for review
2020-09-17 21:11:07 +08:00
Jacques Le Roux ae8b2d89b0 Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
Removes last remaining "Must have at least one statement" issues by using
Debug.logVerbose

Decreases tasks.checkstyleMain.maxErrors from 543 to 535

Thanks: Suraj for report
2020-09-16 10:30:37 +02:00
Jacques Le Roux 346c63bfdf Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
We have a lot of "do nothing" in Java code. In case of catch we should at least
have Debug.logError(e, MODULE); and maybe an explanation in the comment.
2020-09-15 15:24:45 +02:00
Suraj Khurana 02bb30ec61 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 2020-09-13 11:29:46 +05:30
Suraj Khurana a5619831eb Improved: Added missing Javadocs for remaining methods in framework component, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
Thanks Jacques for review.
2020-09-13 11:28:00 +05:30