Commit Graph
82 Commits
Author SHA1 Message Date
Jacques Le Roux cf086a2b47 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In GitHubEvents::gitHubRedirect, random object created and used only once.

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.
Also fixes 2 Javadoc errors

In SampleHtmlThread, uses SecureRandom rather than Random class

In LinkedInEvents::linkedInRedirect, uses SecureRandom rather than Random class
Also fixes 2 Javadoc errors
2021-12-05 09:55:08 +01:00
Jacques Le Roux 923b42c2da Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings in
EbayHelper::createPayment,
AbstractPricatParser::writeCommentsToFile
SolrProductSearch::getSideDeepCategories
WebPosEvents::getProductType
2021-12-05 09:55:08 +01:00
Jacques Le Roux 48156518c9 Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
Removes unused OOTB TextImage.ftl
Explain the script in ViewProfile.ftl
"Accepts" CSV files in SamplePricat.ftl
2021-09-21 17:47:20 +02:00
Jacques Le Roux 9d4c9fcaff Improved: Update build.gradle to the latest dependencies (OFBIZ-12311)
The tests fails locally but it makes no sense, trying w/ BUilbot...
2021-09-06 10:05:40 +02:00
Jacques Le Roux 190e816364 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:25 +02:00
Jacques Le Roux 6106277bb4 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 08:52:44 +02:00
Jacques Le Roux dbfa4f0ca0 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:35:12 +02:00
Wiebke Pätzold 9465c20566 Improved: Adds newline at the end of the file (OFBIZ-12169) 2021-02-15 17:27:01 +01:00
holivier 30aa0132e6 Documented: migration to help system using asciidoc files (OFBIZ-11587)
Add <set field=helpAnchor... in CommonScreens for plugins where it's
not present. With this commit all OFBiz plugins application help go to the html
generated from asciidoc files
2020-10-23 18:34:33 +02:00
Jacques Le Roux 6ac7dc934a 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:25:08 +02:00
Suraj Khurana 26ddcc0c8e Improved: Corrected line is longer than 150 characters checkstyle issues in plugins component.
(OFBIZ-11921)
Also fixed some other extra space and naming related checkstyle issues observed.
Thanks Jacques for review.
2020-09-04 12:27:09 +05:30
Suraj Khurana 6dfc3c19e7 Improved: Corrected some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
Also fixed some access modifiers for some private class members. Thanks Jacques Le Roux for review.
2020-08-31 20:01:25 +05:30
Akash Jain 3b9fbffc6d Improved: Fix Literals comparisons with variable to avoid NPE (OFBIZ-11929)
Thanks, Devanshu Vyas for your contribution.
2020-08-30 17:22:44 +05:30
Jacques Le Roux b9a3be3e1e Reverted: "Improved: Have a readme in every component (OFBIZ-6243)"
This reverts commit 598cf6c27d.

An Apache URL is much easier to have (NO bad idea, does not show like the
camo.githubusercontent.com link does, cache control issue on ASF servers?)
2020-08-29 13:53:36 +02:00
Jacques Le Roux 598cf6c27d Improved: Have a readme in every component (OFBIZ-6243)
An Apache URL is much easier to have
2020-08-29 13:48:57 +02:00
Jacques Le Roux 9bf5e044f7 Improved: Have a readme in every component (OFBIZ-6243)
Not sure why we have this problem (according to
https://docs.github.com/en/github/authenticating-to-github/about-anonymized-image-urls
could be to missing cache control in our site server)

As I was fed up not viewing the OFBIz logo anywhere, and mostly in GH,
but just in browser at https://ofbiz.apache.org/images/ofbiz_logo.png
and I noticed I was viewing it well locally at
https://github.com/apache/ofbiz-framework/tree/trunk/themes/rainbowstone
so decided to use this URL everywhere rather!
2020-08-29 13:36:23 +02:00
Jacques Le Roux 7d140f3e27 Improved: Have a readme in every component (OFBIZ-6243)
This preludes the move of content of README.md files into the asciidoc
documentation

Updates the link to OFBiz-logo.png (also in ReportDesignGenerator.java)
Removes deprecated information related to Svn, Jira and Confluence
We will move the wiki pages to wiki attic with OFBIZ-11619
2020-08-29 11:52:35 +02:00
Suraj Khurana 33d4d6c915 Improved: Corrected class names, method names, data members of class and variables names in plugins component.
(OFBIZ-11926)
Also corrected some formatting and line length related checkstyle issues.
2020-08-26 21:42:06 +05:30
Pawan Verma 5545b13b13 Improved: Replace .size() == 0 with isEmpty() in Java files(OFBIZ-11944)
Thanks, priya for the report and patch and jacques for the review.
2020-08-22 19:18:38 +05:30
Suraj Khurana 403fc39d7f Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
This is done for plugins component. Also corrected some variables as per naming convention best practices.
Thanks Jacques for review.
2020-08-17 12:29:08 +05:30
Priya Sharma fb7bdda1ef Improved: Remove unused imports from Java files (OFBIZ-11930) (#36)
Improved: Remove unused imports from Java files
(OFBIZ-11930)
Thanks: Priya Sharma
2020-08-06 19:49:45 +05:30
Suraj Khurana 30f796146c Improved: Corrected some line is longer than 150 characters checkstyle issues. Also fixed some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
2020-08-03 10:07:16 +05:30
Suraj Khurana 743c627f40 Improved: Corrected all incorrect indentation level issues in plugins component, also fixed some case indentation checkstyle issues.
(OFBIZ-11922)
2020-07-26 21:07:45 +05:30
Suraj Khurana 78801df453 Improved: Updated case indentation to 0 for all switch statements in plugins component. Also done formatting changes as per checkstyle best practices.
(OFBIZ-11904)
2020-07-25 13:48:25 +05:30
Suraj Khurana 51cb1d7958 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-07-21 12:29:01 +05:30
Suraj Khurana 22ccc6801f Improved: Corrected some single line statements to fix checkstyle issues, also removed some remaining extra spaces from code to avoid checkstyle erros in plugins component.
(OFBIZ-11886)
2020-07-21 12:28:45 +05:30
Jacques Le Roux a0f7e77e77 Improved: Use Error.ftl everywhere it's not yet used (OFBIZ-11890)
Removes all error*.jsp reference, no longer used
2020-07-20 19:27:23 +02:00
Suraj Khurana 2144763bc0 Improved: Corrected all checkstyle formatting issues: 'typecast' is not followed by whitespace in plugins component.
(OFBIZ-11887)
2020-07-18 12:26:04 +05:30
Suraj Khurana e7ead3697f Improved: Corrected all checkstyle formatting issues: Line has trailing spaces in plugins component.
(OFBIZ-11880)
Thanks Jacques for review.
2020-07-13 14:14:42 +05:30
Suraj Khurana b18669cddc Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for plugins component.
(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.

'{' is not followed by whitespace.

'}' is not followed by whitespace.

'}' is not preceded with whitespace.

'typecast' is not followed by whitespace.

'try' is not followed by whitespace.

';' is preceded with whitespace.
2020-07-11 14:27:09 +05:30
Suraj Khurana c24db772c9 Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors.
(OFBIZ-11805)
Thanks Jacques Le Roux and Ritesh Kumar for review.
2020-07-06 15:28:07 +05:30
Pawan Verma 8f14af21c5 Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830) 2020-06-28 01:22:17 +05:30
Pawan Verma 1f97f89bae Improved: Merge identical catch blocks in single catch block(OFBIZ-11827)
In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.

Thanks: Jacques for the review.
2020-06-27 11:24:33 +05:30
Suraj Khurana b08fa4a944 Improved: Enforce noninstantiability to FinAccountHelper Class. (#22)
(OFBIZ-11723)

Made class as final, added private constructor, also made data members as private, defined getter and changed related occurrences.
2020-06-05 13:14:11 +05:30
Suraj Khurana ae31c01fa7 Improved: Change resources with proper naming convention in all plugin components.
(OFBIZ-11739)
Also, made MODULE as private data member of class instead of public. Thanks Jacques for review.
2020-05-29 13:14:02 +05:30
James Yong ca5e6b45f1 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For remaining plugin applications.
2020-05-16 13:37:43 +08:00
Jacques Le Roux 1cacb15000 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11603)

I tried to update to Groovy 3 but got a compile issue with commons-cli.
I did not dig further.
2020-04-21 12:00:32 +02:00
Jacques Le Roux 208ef1b1be Improved: replaces module by MODULE everywhere 2020-04-06 12:14:23 +02:00
Jacques Le Roux d267d161e0 Fixed: Ensure that the SameSite attribute is set to 'strict' for all cookies.
(OFBIZ-11470)

As reported by OWASP ZAP:
A cookie has been set without the SameSite attribute, which means that the
cookie can be sent as a result of a 'cross-site' request. The SameSite attribute
is an effective counter measure to cross-site request forgery, cross-site script
inclusion, and timing attacks.

The solution was not obvious in OFBiz for 2 reasons:

1. There is no HttpServletResponse::setHeader. So we need to use a filter
  (SameSiteFilter) and even that is not enough because of 2:
2. To prevent session fixation we force Tomcat to generates a new jsessionId,
ultimately put in cookie, in LoginWorker::login. So we need to add a call to
SameSiteFilter::addSameSiteCookieAttribute in
UtilHttp::setResponseBrowserDefaultSecurityHeaders.
2020-03-20 17:51:00 +01:00
Mathieu Lirzin 1158664ba3 Fixed: Add XML declaration in “web.xml” files (OFBIZ-6993)
These declarations avoid SAXParseException traceback when parsing web.xml
the first time in WebappUtil.parseWebXmlFile

A schema conformance issue has been fixed in ecommerce “web.xml”.
2019-12-07 22:52:30 +01:00
Jacopo Cappellato e49b345808 Fixed: Add missing view permissions checks to various screens. 2019-11-15 19:24:22 +01:00
Jacques Le Roux 4f19b762f3 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11151)

Like for OFBIZ-10922 some updates were not possible. Please refer to the Jira 
for more information

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1864973 13f79535-47bb-0310-9956-ffa450edef68
2019-08-12 15:03:03 +00:00
Mathieu Lirzin 5ae9892e4e Improved: Inline ‘UtilGenerics#checkList’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863492 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:22:24 +00:00
Mathieu Lirzin cfea3ca859 Improved: Use the ‘@Override’ annotation
(OFBIZ-10939)

The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.

Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860028 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:44:25 +00:00
Mathieu Lirzin 9354ac2997 Improved: Remove redundant type declarations
(OFBIZ-10937)

Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is already done in the
declared type.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860025 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:42:00 +00:00
Jacques Le Roux d30c1733c5 Reverted: Refactor boolean returns from methods
(OFBIZ-10725)

Revert an error in previous commit (r1858350)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858351 13f79535-47bb-0310-9956-ffa450edef68
2019-04-29 09:20:10 +00:00
Jacques Le Roux c91becf3b2 Improved: Refactor boolean returns from methods
(OFBIZ-10725)

I was wondering if we should close. I just had a look and using this regexp:

if \(.*\) \{\R.*return true;

 I found
* 60 matches in applications
* 138 in framework
* 4 in plugins
I only checked the 1st two in applications and they really match

While at it this improves 3 of the 4 in plugins (the other is in a loop)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858350 13f79535-47bb-0310-9956-ffa450edef68
2019-04-29 09:09:20 +00:00
Jacques Le Roux 3238d53ecf Improved: Java code contains unnecessary semicolons
(OFBIZ-10936)

Oops in previous commit missed that it's a Java not Groovy file :/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858223 13f79535-47bb-0310-9956-ffa450edef68
2019-04-26 18:51:09 +00:00
Jacques Le Roux 94e4c3f48a Improved: Java code contains unnecessary semicolons
(OFBIZ-10936)

Loosely related: Groovy code don't even needs them :)

Thanks: Mathieu for creating the Jira

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858220 13f79535-47bb-0310-9956-ffa450edef68
2019-04-26 18:09:39 +00:00
Deepak Dixit 5579e37bde Improved: Updated plugin code to fix console warning related to deprecated method. Removed Double constructor call as its depracated since jdk 9. Also replace the CellType::getCellTypeEnum method call with CellTyoe::getCellType
(OFBIZ-10757)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1853904 13f79535-47bb-0310-9956-ffa450edef68
2019-02-19 17:30:35 +00:00