Commit Graph
10541 Commits
Author SHA1 Message Date
Jacques Le Roux 13d6bc2913 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Those should be OK, for instance I see no reasons to do something like that:
window.location.href = window.location.href;
2021-08-06 11:45:30 +02:00
Nicolas Malin 2aa68dc4de Fixed: UserLoginHistory failed the store operation with large password (OFBIZ-12287)
When you have a user with long password (greater than 256 characters) present in OFBiz and you try to log with, OFBiz return a long error message with sensitive information due to exceeding value size to store on the field UserLoginHistory.passwordUsed.

To solve this we don't return any information on the genericValue that failed and analyze the field passwordUsed to escape the case where the password set to login is create than the database field capacity.

Thanks to Daniel Elkabes <daniel.elkabes@whitesourcesoftware.com> and Hagai Wechsler <hagai.wechsler@whitesourcesoftware.com> from white source software to raise the problem.
2021-07-28 11:59:03 +02:00
Nicolas Malin de4213f017 Improved: Add description for all color orientation on Helveticus theme (OFBIZ-12288) 2021-07-28 11:25:15 +02:00
Jacques Le Roux 4f14cb96cf Fixed: Use platform specific failed on CompoundWidget (OFBIZ-12283)
Fixes a checkstyle issue
2021-07-23 09:30:25 +02:00
Jacques Le Roux 4e0ed1e6df Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)

I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:

https://s.apache.org/vhlbj
https://s.apache.org/nyndk

IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.

The issues can be fixed with something like the following:

byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);

jleroux: this prepends the IV in order to decrypt the plaintexts. It's similar
to what has been done for the DesCrypt class. But contrary to the DesCrypt class
I did not test.

Thanks: Artem Smotrakov
2021-07-23 09:30:25 +02:00
Nicolas Malin c5a1a91fbd Fixed: Correct checkstyle typo 2021-07-23 09:10:09 +02:00
Nicolas Malin 8b5bd93d3a Fixed: Use platform specific failed on CompoundWidget (OFBIZ-12283)
When you use a platform-specific element on CompoundWidget like this :

     <ws:platform-specific>
        <ws:html><ws:html-template location="component ..."/></ws:html>
     </ws:platform-specific>

the ModelScreenWidget failed to resolve the attended type due to the
namespace presence (ws:html != html) and finally failed to rendering the screen

Complete the previous commit where I forgot this part
2021-07-22 21:37:09 +02:00
Jacques Le Roux 9963c46c82 Fixed: Static initialization vectors for encryption (OFBIZ-12281)
(after discussing this on security@ofbiz.apache.org, it was decided to open a
Jira issue for that)

I've noticed that OFBiz Framework sometimes uses static initialization vectors
(IV) while creating a cipher:

https://s.apache.org/vhlbj
https://s.apache.org/nyndk

IVs should be unique and ideally unpredictable to avoid producing the same
ciphertexts for the same plaintexts.

The issues can be fixed with something like the following:

byte[] rawIV = new byte[8];
SecureRandom random = new SecureRandom();
random.nextBytes(rawIV).
IvParameterSpec iv = new IvParameterSpec(rawIV);

jleroux: we prepend the IV in order to decrypt the plaintexts. I'll do
something similar in ValueLinkApi class ASAP

Thanks: Artem Smotrakov
2021-07-21 10:55:49 +02:00
Jacques Le Roux 2c421cedfb Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
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
2021-07-20 07:47:32 +02:00
Nicolas Malin c7e21a7249 Fixed: Use platform specific failed on CompoundWidget (OFBIZ-12283)
When you use a platform-specific element on CompoundWidget like this :

     <ws:platform-specific>
        <ws:html><ws:html-template location="component ..."/></ws:html>
     </ws:platform-specific>

the ModelScreenWidget failed to resolve the attended type due to the
namespace presence (ws:html != html) and finally failed to rendering the screen
2021-07-16 18:10:17 +02:00
Jacques Le Roux 414e4d83ed Fixed: Macro renderLink default height and width not retrieved on menus (OFBIZ-12279)
Menus link defaut parameters for height and width are not considered when the
link is generated. When parameter with empty value is passed to the macro, macro
default values are not retrieved.

To reproduce
you can create a "layered-modal" type link in a menu and click on the link
(without height nor width):
this will generate the link with parameters "data-dialog-height" and
"data-dialog-width" empty

Patch provided
When applied, the MacroMenuRenderer.renderLink  will not send empty values to
the macro so that default value will be retrieved (what is actually done on
MacroFormRenderer.renderLookup)

Thanks: Leila
2021-07-12 12:03:59 +02:00
Jacques Le Roux 0a91996090 Improved: adds a description for Helveticus theme 2021-07-10 12:44:04 +02:00
Nicolas Malin 894408cb0d Fixed: Link request-confirmation not generated on menus (OFBIZ-12278)
Menus link with request-confirmation and confirmation message do not generate the script that open confirmation

When you activate the following menu item :
      <menu-item name="statusToCancelled" title="${uiLabelMap.AccountingPaymentTabStatusToCancelled}">
          <link target="setPaymentStatus" request-confirmation="true" confirmation-message="You want to cancel this payment number ${payment.paymentId}?">
              ....
         </link>
      </menu-item>

OFBiz to not generate the js code link to the request-confirmation attribute because this functionality has been never implemented on java code for MenuRenderer

Thanks to Leila Mekika for raised this issue and solved it
2021-07-09 20:31:56 +02:00
Nicolas Malin ff8a141581 Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
Complete previous commit with adding CommonDynamicList form on common previously forgot but present on common-theme
2021-07-09 20:13:29 +02:00
Eugen Stan 19b1b8407e Improved: Clean commented code from ofbiz webapp (#312)
(OFBIZ-8042)
2021-07-09 07:31:00 +02:00
Eugen Stan 293db968c0 Improved: Clean commented code from ofbiz webtools (#313)
(OFBIZ-8043)
2021-07-09 07:30:44 +02:00
Eugen Stan cd40cc28a7 Improved: Clean commented code from ofbiz services (#310)
(OFBIZ-8040)
2021-07-08 09:56:44 +02:00
Nicolas Malin d795fd45be Fixed: List parameters forwarded by element callback failed to restore the list (OFBIZ-11812) (OFBIZ-12261)
There is an error when the callback element resolve the list parameters, it check the parameters element as field and not as final variable.

This generate an empty callback link.
2021-07-07 10:17:36 +02:00
Nicolas Malin 3770cdbb38 Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
Complete previous commit with adding CommonDynamicGrid and CommonDynamicSingle form on common-theme previously forgot
2021-07-07 10:10:27 +02:00
Eugen Stan dbaed189b1 Improved: Cleaned commented code from entity component (OFBIZ-8038) (#308) 2021-07-06 17:02:20 +02:00
Jacques Le Roux e4919d16ca Fixed: IndexOutOfBoundsException on Entity Import (OFBIZ-12273)
Removes the localhost (and 127.0.0.1) OOTB.
Allows to use it through a "multi-property" (list) in security.properties.
2021-07-06 14:30:39 +02:00
Jacques Le Roux b00aed6d20 Fixed: IndexOutOfBoundsException on Entity Import (OFBIZ-12273)
My changes in OFBIZ-12249 were only to handle textareas.

The case Nicolas reported is not related to a textarea but to the special case
of KeywordSearchBox handled by KeywordSearchBox.ftl.
So this simply bypasses this special case using the "DUMMYPAGE" key then present
2021-07-05 19:36:42 +02:00
Xin Wang 46722b713f Improved: Upgrade Shiro to 1.7.1 (OFBIZ-12275) (#309)
The default padding scheme of ECB mode for
org.apache.shiro.crypto.AesCipherService is different between v1.4.1 and
v1.7.1, i.e.:

v1.4.1 getPaddingSchemeName() result is "PKCS5Padding"

v1.7.1 getPaddingSchemeName() result is "NoPadding"

This patch specify padding scheme explicitly, after that exception
mentioned in build.gradle does not raise anymore, and initial data can
load successfully.
2021-07-04 19:18:38 +02:00
Jacques Le Roux 27d9e64d82 Fixed: fixes a chekstyle issue
It was put in with
https://github.com/apache/ofbiz-framework/commit/7120cf7
2021-07-03 19:30:17 +02:00
Jacques Le Roux 0effce0c7b Fixed: IndexOutOfBoundsException on Entity Import (OFBIZ-12273)
I get an IndexOutOfBoundsException when using the EntityImport.

The problem occurs while having a resemblance of an url in the data.
For example
screenPath="component://... is interpreted as url because of '://'
but doesn't match a valid url pattern.

jleroux: I decided to keep it simple and to take the "component://" and the
"https://localhost" cases apart. I see no reasons to fear "https://localhost"
there. It should be only used in a safe dev env.

Thanks: Sebastian Berg and Nicolas Malin for report
2021-07-03 19:24:08 +02:00
Nicolas Malin 7120cf7d5f Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
When you display a list with search criteria, pagination information and/or sort parameters, if you update an element of this list with a update area, you loose all of them.

Example:

<form name="ListProductMeters" type="list" list-name="productMeters" target="updateProductMeter" paginate-target="ListProductMeters">
    <actions>
       <entity-condition entity-name="ProductMeter">...
    </actions>
    <auto-fields-service service-name="updateProductMeter"/>
    <field name="meterName"><text size="20"/></field>
    <field name="updateButton"><submit/></field>
    <on-event-update-area event-type="paginate"/>
    <on-event-update-area event-type="sort-column"/>
    <on-event-update-area event-type="submit"/>
</form>

Or this works well if you move an next page sort the list.
I realize the same principle for each event which do a modification of element in the list and after refresh it.

I also introduce the possibility to submit a form on modal (for edition) when you press 'enter' that will refresh the origin list.

Last point, the queryString element use to propage pagination state is also forwarded on callback element to keep this on update the list.

Thanks to Gil Portenseigne is help.
2021-07-02 17:27:21 +02:00
Gil Portenseigne b4e46ff070 Implemented : New child element set-callback on link to control dynamism (OFBIZ-11812)
Refreshment information are controlled by the calling object,
instead of the called form.

This avoid dependency between called form and parent screens.

The set-callback tag generate a jwt encoded UpdateArea widget, that
is transmitted through submits and links until a submit with no
update-area information is met.  This specific submit ends the
process launched by the link, and trigger the refresh action
contained into the JWT token.
2021-06-24 16:13:00 +02:00
Jacques Le Roux 6579bcbb9b Improved: Add global web.xml to simplify session timeout configuration (OFBIZ-12255)
Adds missing ASL2 header, uses the same root element than other web.xml files
2021-06-22 18:25:26 +02:00
Gil Portenseigne 69cea81b12 Fixed: SeoConfigUtil does not maintain char-replace order (OFBIZ-12259)
Thanks: Ingo Wolfmayr for your contribution
2021-06-22 16:51:17 +02:00
Jacques Le Roux 9b09dd61bb Improved: Add global web.xml to simplify session timeout configuration (OFBIZ-12255)
Forgot to add/commit/push the new main, for session duration, web.xml file
2021-06-22 15:58:02 +02:00
Jacques Le Roux cc4de50f6f Improved: fixes an indentation issue 2021-06-22 15:56:04 +02:00
Jacques Le Roux 29705efa65 Improved: Add global web.xml to simplify session timeout configuration (OFBIZ-12255)
Currently, session timeout is configured in apps separately, but session is
shared globally, so the smallest one take effects, and it will not take effect
separately for different apps.

Then it is both inconvenient and confusing to increase session timeout value,
as all values in those files need to be updated.

A global web.xml is needed, to simplify session timeout configuration.

Thanks: Xin Wang
2021-06-22 15:51:32 +02:00
Gil Portenseigne 38d4ef69b4 Implemented : Add sub-screen decorator DetailScreenDecorator and EmbeddedDecorator
(OFBIZ-11813)

To homogenize and help each theme to implement correctly the screen engine concept,
we add two sub-decorators like existing 'FindScreenDecorator'.

DetailScreenDecorator can be used to display a sum up of an object and
its related data.

Embedded Decorator can be used to inject a specific screen in an
structured page area.

Those are composed of several sections that can be handled by the
theme for specific display.

Thanks Nicolas
2021-06-22 10:19:56 +02:00
Wiebke Pätzold d0924362af Fixed: Adding tel protocol in CustomPermissivePolicy is not working
(OFBIZ-12258)

With these changes, the default sanitizers rules are only loaded if
there is no CustomPermissivePolicy
2021-06-21 07:44:08 +02:00
Jacques Le Roux b9f785d2fa Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)
Oops, forgot to commit this checkstyle issue fix
2021-06-10 09:21:05 +02:00
Jacques Le Roux 4bab66e501 Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)
When trying to add a note to WorkEffort entity, I found that URL encoded
characters are unescaped, which is not expected.

e.g.:
1. Go to page: https://demo-trunk.ofbiz.apache.org/workeffort/control/EditWorkEffortNotes?workEffortId=TASK01
2. Add a note with content: https://example.com/a%20link
3. After submission, it will turned to be: https://example.com/a link

Thanks: Xin Wang for report and exchanges until solution I provided
2021-06-09 10:57:51 +02:00
Jacques Le Roux cf2f0b378c Fixed: Status change button on Invoice screen is not working (OFBIZ-12248)
Steps:
1. Open URL https://demo-trunk.ofbiz.apache.org/accounting/control/findInvoices
2. View any invoice from the list say [invoice# : 8010]
3. Change the status to Ready / Cancelled

Expected:
Status should be marked to Ready for Posting or Cancelled

Actual Result
The loader is visible but nothing happens

Thanks: Nameet Jain
2021-06-03 11:53:59 +02:00
Daniel Watford c654d9bbcc Improved: Convert EntitySyncServices.xml mini-lang to groovy
(OFBIZ-11660)

removed: EntitySyncServices.xml
added: EntitySyncServices.groovy
modified: services.xml to reflect the change from minilang to groovy for:
- entitySyncPermissionCheck
- resetEntitySyncStatus
modified: webtools/controller.xml to reflect changed request-map and event type regarding reset of EntitySyncStatus
modified: webtools/widget/EntitySyncForms.xml to reflect changed target regarding reset of EntitySyncStatus

Thanks: Pierre Smits for implementation
2021-05-30 08:13:23 +01:00
fehnomenal d288e12030 Make latitude and longitude numeric fields for correct comparisons (#220) 2021-05-29 12:07:19 +02:00
Jacques Le Roux fec6559e7b Improved: Allow to pass a Google API key for geolocation (OFBIZ-12247)
This is related to this question from Daniel at
https://github.com/apache/ofbiz-framework/pull/220

I couldn't figure out how to configure OFBiz with my Google API key so ended up
temporarily patching
themes/common-theme/template/includes/GeoLocation.ftl line 44 with my key.
Line 44 looked similar to:
<script src="https://maps.googleapis.com/maps/api/js?key=secret_google_api_key" type="application/javascript"></script>

Is there a way to configure ofbiz with the API key?

Disclaimer: w/o a not free "Google API key" I was not able to test, will ask
Daniel...
2021-05-29 12:06:16 +02:00
Daniel Watford d16bef46dc Improved: MacroFormRenderer refactoring of field group open and close elements
(OFBIZ-12124)

Part of the OFBIZ-11456 MacroFormRenderer refactoring effort.

Rather than MacroFormRenderer producing and evaulating FTL strings, it now
uses RenderableFtlElementsBuilder to create RenderableFtlMacroCall objects
which are then passed to an FtlWriter for evaluation.
2021-05-27 11:12:12 +01:00
Jacques Le Roux 7c5b78919e Improved: fixes a checkstyle issue
In RequestHandler.java[1394] ':' is not preceded with whitespace.
2021-05-25 12:14:27 +02:00
Nicolas Malin b663660486 Implemented: on-event-update-area on form inherit information from parent form
(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
2021-05-21 17:58:27 +02:00
Jacques Le Roux fb0701b7bd Fixed: Plugin not showing in menu due to permission (OFBIZ-12233)
When creating a plugin via gradle :
./gradlew createPlugin -PpluginId=plugin-test -PpluginResourceName=PluginTest
-PwebappName=plugin-test -PbasePermission=PLUGIN_TEST

and loading all the required data and permissions, the plugin doesn't appear
in the menu.

It comes from the ComponentConfig.java file, L1229, when the permissions gets
trimmed and modified. I tried removing it locally and it fixed the problem.

Thanks: Gaetan Chaboussie
2021-05-17 11:59:36 +02:00
Aditya Sharma e97f45c381 Fixed: removed unused asmselect files and unused variable asm_asmListItemPercentOfForm (OFBIZ-10113)
asm select library is already replaced with select2 library, but the library files still exist in code base unused.
asm_asmListItemPercentOfForm varaible was used to set the width of the selected items which were displaced distictly from select fields. With select2, the selected items display inside the input field so it is no more needed

Thanks Jacques Le Roux for reporting it
2021-05-12 11:57:54 +05:30
Jacques Le Roux 45f50c910d Improved: Handle remaining checkstyle errors (OFBIZ-12169)
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.
2021-05-04 10:34:52 +02:00
Jacques Le Roux 1e3148c3a8 Fixed: Secure the uploads (OFBIZ-12080)
Reopened after report of a bug (only on *nix systems) by Shrilesh Korgaonkar.
This fixes the issue

Thanks: Shrilesh Korgaonkar
2021-04-16 09:25:18 +02:00
Jacques Le Roux 7fd9d05f7e Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
Forgot to change ListOfSafeObjectsForInputStream to allowList in UtilObjectTests
2021-04-07 10:12:33 +02:00
Jacques Le Roux 3f975780cf Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
In SafeObjectInputStream.properties
  Renames listOfSafeObjectsForInputStream to allowList and fixes it
  Introduces a denyList

Adapts SafeObjectInputStream class to new denyList
2021-04-07 08:51:36 +02:00
Jacques Le Roux fcc0078b60 Improved: Improve ObjectInputStream denyList (OFBIZ-12221)
Prevents generics markup in string type names.
2021-04-05 17:03:12 +02:00