Commit Graph
2247 Commits
Author SHA1 Message Date
Jacques Le Roux 4e01679854 Improved: suppresses 2 warnings related to deprecated CSVFormat.DEFAULT.withHeader()
This was not done correctly last time (previous commit e4d4329)
2021-12-26 19:20:43 +01:00
Jacques Le Roux e4d43297a9 Improved: suppresses 2 warnings related to deprecated CSVFormat.DEFAULT.withHeader()
Also adds a try-with-ressource in InvoiceServices::importInvoice to properly
close csvReader on returns. Hence removes an useless csvReader.close().

Several comments about Eclipse giving wrong advice
<<Resource leak: '<unassigned Closeable value>' is not closed at this location>>
It's OK, we are inside try-with-ressources.

Finally removes a redundant final in PartyServices::importParty
2021-12-26 18:22:48 +01:00
Jacques Le Roux 06092ae0af Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
As advised by SpotBugs:

<<This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.

If it is important that the generated Random numbers not be guessable, you must
not create a new Random for each random number; the values are too easily
guessable. You should strongly consider using a java.security.SecureRandom
instead (and avoid allocating a new SecureRandom for each random number needed).

Rank: Troubling (14), confidence: High
Pattern: DMI_RANDOM_USED_ONLY_ONCE
Type: DMI, Category: BAD_PRACTICE (Bad practice)>>

uses <<private static final SecureRandom SECURE_RANDOM = new SecureRandom();>>
in classes:
PaymentGatewayServices
ValueLinkApi
ContactMechServices
ProductStoreWorker
DesCrypt
HashCrypt
EntityCrypto
ContextFilter.java

Despite doing so SpotButs still reports the same error for those classes.
As it's obviously an error I prefer to not excludes those cases that will maybe
not be reported in a future version of SpotButs in Eclipse. For instance they
are not reported at all in previous version (4.5.1) but are in 4.5.2
2021-12-26 14:50:32 +01:00
Jacques Le Roux 36b82f2b16 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
GenericEntity::getBoolean can't return null, so false

CommunicationEventServices::sendEmailToContactList handles correctly
tmpResult != null
2021-12-03 12:37:46 +01:00
Jacques Le Roux 11cec4a6a2 Improved: comment about wrong Eclipse report
Eclipse reports: Resource leak: '<unassigned Closeable value>' is not closed
at this location but it's OK.
As csvReader is in a try-with-ressource it will be closed anyway
2021-12-02 09:37:01 +01:00
Jacques Le Roux 53ec407858 Improved: French translation for Accounting module (OFBIZ-869)
Replaces allouer by enregistrer. Allouer has not the right meaning in the
accouting context.
2021-11-27 12:14:08 +01:00
Jacques Le Roux b62cfbdc3a Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
Try a syntax change from Andrew Eisenberg
It also needs a not functional change for codeQL to run

Thanks to Andrew Eisenberg from GH CodeQL
2021-11-17 08:06:39 +01:00
Jacques Le Roux 72f8655857 Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
Try adityasharad's syntax slightly modified
It also needs a not functional change for codeQL to run

Thanks again to adityasharad from GH CodeQL
2021-11-16 17:23:41 +01:00
Jacques Le Roux 13da3fdf88 Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
Forgot 2 things:
I created a Jira (here is the ref)
I removed Java analysis (here it's back)

Now uses again adityasharad's syntax, not sure it's the right one and place
It also needs a not functional change for codeQL to run

Thanks: adityasharad from GH CodeQL
See https://github.com/github/vscode-codeql/issues/735#issuecomment-969348461
2021-11-16 12:10:26 +01:00
Jacques Le Roux 0c7d0c05a1 Improved: On advice of adityasharad try something else in codeql-analysis.yml
See https://github.com/github/vscode-codeql/issues/735#issuecomment-969348461
Syntax given by adityasharad seems to not work, trying something near

It also needs a not functional change for codeQL to run
2021-11-16 11:45:19 +01:00
Jacques Le Roux 1162b49fc1 Improved: On advice of adityasharad try something else in codeql-analysis.yml
See https://github.com/github/vscode-codeql/issues/735#issuecomment-969348461
Still not quire sure of the syntax, trying again before asking

It also needs a not functional change for codeQL to run
2021-11-16 11:40:22 +01:00
Jacques Le Roux 7ee7005846 Improved: On advice of adityasharad try something else in codeql-analysis.yml
See https://github.com/github/vscode-codeql/issues/735#issuecomment-969348461
Still not quire sure of the syntax, trying again before asking
OK no needs to ask, I missed 2 spaces before with

It also needs a not functional change for codeQL to run
2021-11-16 11:33:51 +01:00
Jacques Le Roux 6714d8e069 Improved: On advice of adityasharad try something else in codeql-analysis.yml
See https://github.com/github/vscode-codeql/issues/735#issuecomment-969348461
Still not quire sure of the syntax, trying again before asking

It also needs a not functional change for codeQL to run
2021-11-16 11:28:24 +01:00
Jacques Le Roux 6727f469dc Reverted: work related to PartyRole handling initiated with (OFBIZ-5980)
Currently OFBiz is broken and hard to fix. You can't even create an order !

Revert "Improved: visibility of expire button (OFBIZ-12362) (#331)"
This reverts commit e3b125ef4c.

Revert "(OFBIZ-5980) Improvement: PartyRole record(s) expiration/revocation (#330)"
This reverts commit a8ab2be55a.

Revert "Improved: seed data (OFBIZ-12355) (#328)"
This reverts commit b204b867b4.

Revert "Reverted: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 85e066deb3.

Revert "Reverted: damn I did not revert the right push :/"
This reverts commit b867b2a89f.

Revert "(OFBIZ-5980) Improvement: PartyRole record(s) expiration/revocation (#325)"
This reverts commit 8ed2252df8.

Revert "Reverted: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 5b5e03f71b.

Revert "Improved: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 46f7ee91d3.

Revert "Improved: seed data (OFBIZ-12353) (#324)"
This reverts commit fade92bb57.
2021-11-08 20:41:51 +01:00
Pierre Smits e3b125ef4c Improved: visibility of expire button (OFBIZ-12362) (#331)
applied 'use-when' on field 'expire'
2021-11-03 10:17:15 +01:00
Pierre Smits a8ab2be55a (OFBIZ-5980) Improvement: PartyRole record(s) expiration/revocation (#330)
added/changed/updated:
- added field definition for from and through date to the entity
- added service for expiration
- request-map for expiration
- appropriate forms to work with  added entity fields
- added groovy code to check existing when adding PartyRole record and call expiration service if needed
- adding fromDate value to seed, test and demo data
2021-11-02 11:36:52 +01:00
Jacques Le Roux 85e066deb3 Reverted: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)
Reverts commit 46f7ee91d3

Reverted on Pierre Smits kindly asking for authoring by pushing a PR, not only a
thanks while committing his patch after testing it locally
2021-11-02 10:30:51 +01:00
Jacques Le Roux 46f7ee91d3 Improved: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)
Currently it only possible to delete a role. That can lead to potential error
messages, when a particular role is associated with records where the roleTypeId
is used as a foreign key in the entity-model/database and the user tries to
delete that role from the list.

In order to avoid such, it is better to revoke the PartyRole record by setting
an expiration date (end date) on the record.

Thanks: Pierre Smits
2021-11-01 12:46:29 +01:00
Jacques Le Roux 2489381f7f Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Adds unused hashCode method to *ArtifactInfo and PackingSession classes
Makes final CmsEvents, ContactMechWorker and PartyWorker classes

There are no longer any checkstyle issues
2021-10-17 15:59:35 +02:00
Jacques Le Roux 49cae3c73a Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Adds getter and setter to ScreenRenderer class
Adds unused hashCode method to ControllerRequestArtifactInfo class
Makes final UomWorker and ContactHelper classes

Only 10 checkstyle issues now
2021-10-17 15:45:55 +02:00
Jacques Le Roux c85f60279b Improved: Remove Checkstyle warning related to double parenthesis at start of lines (OFBIZ-12340)
At https://markmail.org/message/3mhzlqew3igad3r2 I reported an issue that I was
not able to really qualify. After exchanging with a Checkstyle expert
(see markmail thread).

I was unable to find what in our checkstyle.xml file was wrongly throwing these
warnings. I decided that there was no reason to throw those warnings.

So I decided to put the SuppressionCommentFilter in our checkstyle.xml file and
use CHECKSTYLE_OFF: ALMOST_ALL/CHECKSTYLE_ON: ALMOST_ALL around
the concerned lines as documented here
https://checkstyle.sourceforge.io/config_filters.html#SuppressionCommentFilter_Examples
2021-10-17 15:38:30 +02:00
Jacques Le Roux 87f9981f71 Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Fixes wrong methods names in EntityFunction class
2021-10-17 10:49:51 +02:00
Nicolas Malin 2d14be3c3d Improved: Improve velocity of PartyHelper.getPartyName() with the cache
The class PartyHelper is massively used to resolve the name of a party without know is type.

     <field name="organizationPartyId" title="${uiLabelMap.ProductOrganization}">
         <display description="${groovy: org.apache.ofbiz.party.party.PartyHelper.getPartyName(delegator, organizationPartyId, true);} [${organizationPartyId}]"/>
     </field>

A party name have few change over time, or the PartyHelper.getPartyName function call the database at each call.

On huge screen, we distinctly clearly the database latency.

So for a cold data, no reason to didn't use the cache.
2021-09-29 23:25:58 +02:00
Nicolas Malin be5f6aef76 Improved: Mandatory contact number when create/update a TelecumNumber (OFBIZ-11110)
It's possible that create a Telecum number without contactNumber that appears as an inconsistency.

Thanks: Rashi Dhagat for this issue
2021-09-27 16:56:48 +02:00
Jacques Le Roux 6c4238418e Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
Adds HTML accept where it fits, let the more general cases as they are
2021-09-21 17:53:01 +02:00
Nicolas Malin 26a9dc7336 Implemented: Rendering widget screen from ftl with the current context (OFBIZ-12310)
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>
2021-09-03 18:29:48 +02:00
Nicolas Malin 3fb6b40aa3 Fixed: Clean groovy file FindLookUp
No functional change :
 * remove case syntax
 * use groovy syntax (excepted on executeResult.listIt, EntityListIterator not support the groovy syntax *if (!listIt)*)
 * use Elvis operator for default values
 * add typage to help ide and compilation
2021-08-17 16:26:38 +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
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
holivier 462b871f18 Documented: Order online Documentation and help (OFBIZ-12224)
Migration of OFBiz wiki 3.1-3.2-3.3 Order Entry page and Sales Order Management page

Create Order Diagrams
Order Status Diagrams
Add link from screen to help
2021-05-04 16:03:01 +02:00
Joonas Hiltunen 9b4a4ad8d6 Implemented: Add new party while placing quotes (OFBIZ-7456) (#294)
Introduce the option to create a new party group while placing the quotes in the system.
2021-04-12 12:32:40 +02:00
Jacques Le Roux f062ff4613 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
Fixes PartyServices.java lines too long
Error Description	                        Line
La ligne excède 150 caractères (trouvé 178).	2621
La ligne excède 150 caractères (trouvé 178).	2638
La ligne excède 150 caractères (trouvé 191).	2655
2021-04-08 11:46:33 +02:00
bjugl 983f04dfd6 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175, "createPartyContactMech Service has been changed to expect an OUT contactMechTypeId paramter and the call on this end has not been modified."
2021-04-08 11:05:38 +02:00
holivier 64ce92baa7 Documented:migrated Wiki How to Create the main Company in Party Manager to user-manual (OFBIZ-12065)
Add a link to the video of the tutorial running
Thanks to Aditya Sharma for put it on Youtube
2021-03-17 16:36:34 +01:00
Sebastian Berg 1047003b92 Fixed: Remove CommunicationContent not working as expected (OFBIZ-12172) 2021-02-26 18:49:58 +01:00
Jacques Le Roux 54ab93ff2a Improved: Field 'govAgencyPartyId' shows all parties, not just Government Agencies (OFBIZ-10863)
The field govAgencyPartyId in the AddFixedAssetRegistration form shows all
parties through the lookup target-form-name="LookupPartyName function.

This should be limited to those parties that qualify with the constraint.

Thanks: Pierre Smits for report Priya Sharma for the fix
2021-02-21 14:22:00 +01:00
Michael Brohl 69c62f5f00 Merge changes for PR #267 due to conflicting changes in trunk (OFBIZ-12169) 2021-02-15 17:15:18 +01:00
Jacques Le Roux a2dac5482c Improved: Default ordering of webapps titles in main menu (OFBIZ-12166)
[...] having more important apps in 1st places would be better [...]
the feature should be easily changed by custom projects [...]
documentation for that would be enough.

This 1st step sorts the applications and webtools. I believe webtools should not
be secondary but that needs to be discussed with other options.
2021-02-14 21:11:58 +01:00
Michael Brohl 662a3f9d1c Improved: Remove Compdoc functionality from content manager
(OFBIZ-10476)
2021-02-13 17:33:05 +01:00
Michael Brohl 29bf0a040a Merge branch 'trunk' into OFBIZ-12169_Handle_remaining_checkstyle_errors 2021-02-13 11:26:01 +01:00
Benjamin Jugl ce5397dbc6 Fixed: Prevents NPE in Party/My Communications (OFBIZ-12164) 2021-02-11 21:36:04 +01:00
Wiebke Pätzold 95d37d2189 Removes and adds whitespaces as suggested by checkstyle (OFBIZ-12169) 2021-02-09 08:46:20 +01:00
Nicolas Malin 7165768251 Implemented: Add a framework method to get main webapp menu with the webapp name
(OFBIZ-10601)

To improve theme management and provide better tools for new themes, we implement a method to obtain the main menu of a webapp.
Instead of just managing a menu, we extend the functionality by offering a method to expose a summary of the webapp, to simplify the navigation.

For this we add a new attribute on webapp definition app-shortcut-screen :

    <webapp name="mywebapp"
            ...
            app-shortcut-screen="component://mycomponent/widget/CommonScreens.xml#ShortcutApp"
            ...
    />

The idea is to define a new purpose screen *Shortcut* that contains what defines a webapp when an action or navigation has been requested. With this screen you can load a menu, a search, a complex description and use all screen powerfulness to resolve what displaying and support by theming

    <screen name="ShortcutApp">
        <section>
            <actions>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
            </actions>
            <widgets>
                <decorator-screen name="ShortcutDecorator" location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="body">
                        <include-menu name="MyShortcutAppBar" location="component://mycomponent/widget/CommonMenus.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

Each component are self-sufficient to define what shortcuts to display without framework change or knowledge about other component.
Each theme can implement and customize the display rendering at will.

To illustrate an example of implementation we set sub menu for each webapp defined on applications and exploit it on bluelight theme.

Thanks for Dennis Balkir, Jacques Leroux, Leila Mekika and Julien Nicolas for their involvement
2021-01-15 08:56:23 +01:00
Jacques Le Roux 66decd89f7 Improved: Create 'New Communication' button should be removed from create new communication screen. (OFBIZ-12027)
Steps to replicate the issue :
Go to Party application.
On the 'find communications' screen clicks on the 'New communications' button.
The system will navigate you to create/edit communications screen.
On create/edit communications screen you will see the 'New communications' button.

Providing the 'New communications' button on the 'create new communication
screen' does not make any sense over so it should be removed from here.

Thanks: Shubham Choudhary
2020-12-29 11:28:16 +01: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 17eb2e4cf7 Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)
Same for sub-hyperlink
2020-12-11 16:52:04 +01:00
Jacques Le Roux 06e56ed7e9 Improved: Invoice import is not visible from UI and not working (OFBIZ-12089)
While working on OFBIZ-12080 I found an upload feature that allows to import
invoices but it's not visible from UI and not working.
Moreover the export feature was missing a parameters as the import.

It has been introduced by Hans Bakker with
https://svn.apache.org/repos/asf/ofbiz/trunk@1502093
and I'm not sure the integration was completed.

We could remove it, but I think it can be useful and does not seem to miss much
to work fine.

Also use an uploadedFile label in ImportParty and UploadContent forms
2020-12-08 17:22:24 +01:00
holivier 5781f08ff6 Documented:migrated Wiki How to Create the main Company in Party Manager to user-manual (OFBIZ-12065)
Add section Parties Processes and as first process How To Create Main Company
2020-11-30 12:07:57 +01:00
Nicolas Malin 8a51586c63 Fixed: service createCommunicationEventWithoutPermission failed to store a communication
(OFBIZ-12074)

When you call the service createCommunicationEventWithoutPermission to create a anonymous communication or from a user without party permission, the service failed due to missing permission.

With the minilang to groovy conversion the userLogin system it's not loaded before call the main service createCommunicationEvent
2020-11-30 09:40:04 +01:00
holivier c2c1eae612 Documented: migrated Wiki Glossary to glossary asciidoc files (OFBIZ-12060)
- Accounting Glossary,
  - declare it as glossary
  - re-order existing items
  - add a comment at beginning about importance of order items
  - correction for some ID: change space to _
  - add some items coming from wiki glossary
- Facility
  - add glossary directly in facility.adoc
- Human Resource Glossary
  - re-order existing items
  - add a comment at beginning about importance of order items
  - move some items to Party Glossary or global Glossary
- HR appendix: add link to wiki OFBiz related book for Data Model Reference Book
- Add Party Glossary and included it in party.adoc
  - add some items coming from wiki glossary and HR glossary
- General Glossary
  - add a comment at beginning about importance of order items
  - add some items coming from wiki glossary and HR glossary
2020-11-18 17:19:39 +01:00