Currently, when you would be rendering a widget screen from a ftl template, you can use a element screen present on context to call the renderer :
${screens.render("component://common/widget/CommonScreens.xml#countries")}
This rendering is realized with the context present when the object screen has been initialized.
To simplify the screen call from freemarker template, I implemented a new macro ofbizScreen
You can call a Ofbiz screen with the ftl context with simple macro
<@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#MyScreen</@ofbizScreen>
You can also write
<@ofbizScreen location="component://mycomponent/widget/MyComponentScreens.xml" name="MyScreen"/>
Or set a default location on your context
action :
context.defaultTemplateLocation = "component://mycomponent/widget/MyComponentScreens.xml"
widget :
<@ofbizScreen>MyScreen</@ofbizScreen>
When the screen would be call, the context to rendering the screen would be use the current context:
<#list contactMechs as contactMech>
<#assign contactMechId = contactMech.contachMechId/>
<@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#DisplayContactMech</@ofbizScreen>
</#list>
This prevented to run the stable demo, hence the next, weirdly the trunk had
not this problem. Anyway better safe than sorry... Maybe related to Gradle
version or rather libs loaded?
The reason why the stable (and old) demos were not running is because the
EntitySaxReaderTests did not pass
(OFBIZ-11811) (OFBIZ-11808)
When you write a form, if you want the dynamic interaction and style, you need to implement everything on the form.
The developer must know the style used, different area and rules support by the technology besides the really information/action that the form will do.
<form name="ListFacility" type="list" list-name="listIt" paginate-target="FindFacility"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
<actions>...
<field name="facilityId">....
<on-event-update-area event-type="sort-column" area-id="search-results" area-target="FacilitySearchResults"/>
<on-event-update-area event-type="paginate" area-id="search-results" area-target="FacilitySearchResults"/>
</form>
We can put all information on the theme and all dynamic refresh (for area) are related to the parent form and parent screen. Finally we will obtain :
<form name="ListFacility" extends="CommonDynamicList" extends-resource="component://common/widget/CommonForms.xml"
paginate-target="FindFacility">
<actions>...
<field name="facilityId">....
</form>
<form name="CommonDynamicList" type="list"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
<on-event-update-area event-type="sort-column"/>
<on-event-update-area event-type="paginate"/>
</form>
The target and area to update has been automatically resolved from the parent form and screen.
This commit improve the modelForm and the widget-form.xsd to do that.
Thanks to Gil Portenseigne his help
This handles the "'(' should be on the previous line?" rule of MethodParamPad
Actually not completely, because there are still some cases that can't be
handled by changing code, notably when a casting is necessary. I believe there
is an error in checkstyle code. I'll discuss that in dev ML before sending
checkstyle team a report.
Makes afterlogin.lastvisit.show to false by default and document that in the
security documentation, ie in
https://cwiki.apache.org/confluence/display/OFBIZ/How+to+secure+your+deployment
Else when working in dev mode you always have to remove or wait the message to
remove itself
Fixes wrong wiki links in sy-password-and-JWT.adoc
Fixes the tests:
Checks that when the same position is provided by the `WebappInfo` instance
only one is retrieved
Checks that when the same title with no position is provided by the `WebappInfo`
instance 2 instances are retrieved. though they use the same title only position
allows "collision"
After some small study, it seem there is a problem because login request not
require authentication
I have tried to add a test to check if current request is login and only if it's
not to remove PREVIOUS_REQUEST Session Attribute, it seem better with this
modification.
Thanks: Olivier for the patch and Michael for suggesting to parameterize using
a property. I simply used EntityUtilProperties.getPropertyValue instead of
UtilProperties.getPropertyValue
Renames respectively blacklist and whitelist to denylist and allowlist in
several places.
There are still a lot of master word which can be replaced by main, but not in
contexts where slave is also used. I'll discuss that on dev ML again...
Provides the migrateOldOrderBlacklistAndOldOrderBlacklistType service to migrate
records from OrderBlacklist and OrderBlacklistType entities to new OrderDenylist
and OrderDenylistType entities
Improved: Display last-visited-time popup after login (OFBIZ-12148)
To allow users to know of any unauthorised access to their accounts.
Thanks: Michael for review
pages (OFBIZ-12047)
Added removal of the _PREVIOUS_REQUEST_ attribute when requesting
non-authenticated sites and moved targetRequestUri handling to a
accommodate this change
(OFBIZ-7327)
Use a data URL rather than a regular URL for company logos when a
logo has been specified as a Party Content item. This works around the
problem of Apache FOP failing to retrieve content from HTTPS URLs.
Thanks: Deepak Dixit for the review and suggestions
When you use the Flat Grey theme (useful for RTL languages) you see an error in
the main menu (component choise). It's related to the rest component not using a
controller.
Fixes is simple and has not side effect: instead of throwing an exception simply
log a warning and return an empty string
This error appears after trying to upload a file to party content:
2020-11-06 07:48:22,488 |jsse-nio-8443-exec-7 |RequestHandler |I|
Sending redirect to:
[https://localhost:8443/partymgr/control/viewprofile?partyId=admin].
2020-11-06 07:48:29,288 |jsse-nio-8443-exec-7 |UtilObject |E|
null
java.io.NotSerializableException: org.apache.commons.fileupload.disk.DiskFileItem
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
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
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.
Fixes few javadoc issues
Since this has been ignored for few commits I need to increase
tasks.checkstyleMain.maxErrors from 12224 to 12247 (did not check the detail)