Commit Graph
10269 Commits
Author SHA1 Message Date
Jacques Le Roux 80e545c0f8 Improved: Use Error.ftl everywhere it's not yet used (OFBIZ-11890)
We no longer have "/error/error.jsp" file,
so always use "common/webcommon/error/Error.ftl" by default
2020-07-18 11:14:58 +02:00
Suraj Khurana 8b1e0dbd85 Improved: Corrected all checkstyle formatting issues: 'typecast' is not followed by whitespace in framework component.
(OFBIZ-11887)
2020-07-18 12:26:42 +05:30
girishvasmatkar 04791d5821 Implemented: New service definition attribute "verb" to denote the corresponding HTTP method (OFBIZ-11328) (#214)
* Added verb as an attribute to specify the REST method OFBiz service is going to serve on

* Added methods to get service IN and OUT parameters as MAP

* Added TODO for supporing nested parameters

* Improvement : Added Restrictions for verb attribute and documentation for the same

* Fixed checkstyle issues

* Changed attribute name from verb to action for better clarity
2020-07-18 08:54:55 +05:30
Jacques Le Roux 1d391df2f0 Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)
At https://markmail.org/message/n76cchtriexxmgm7 I asked

Why having the ftl handlers only in webtools controller? BTW it makes the XSD
documentation awkward because it speaks about the ftl handlers being in
handlers-controller.xml
Why not using error.ftl in common-controller.xml instead of error.jsp?
Same question for plugins.

And answered

I believe we could change all that and definitely get rid of error.jsp
(error.ftl is already in all supported releases branches)
2020-07-15 20:58:16 +02:00
holivier 9ec3d9ca77 Documented: Framework, delete all docbook files related to migration to
asciidoc (OFBIZ-11587)

Add a link to developer-manual for webtools in old help system
2020-07-14 17:06:56 +02:00
holivier 91fe7bf4cc Documented: Framework, delete all docbook files related to migration to
asciidoc
(OFBIZ-11587)

- common-sending-email: include in email
- datafile: move as a include at the end of entity-engine section
- entity-engine: list of link to OFBiz wiki about entity configuration
- service-engine: a link to OFBiz wiki Service Engine Guide
- webtools: help for main screen
- mini-lang: include a link to OFBiz wiki mini-lang-reference at the
beginning of minilang-to-groovy-manual
           move minilang-to-groovy-manual to Development environment
section
- unit-test: include as Junit test, and use README to list gradle
command available (so add a tag in REAME.adoc)
- base: add a link to OFBiz wiki Configuration Guide, in deployment
section
- SingleSignOn with LDAP: move to plugin LDAP and include in deployment
section
2020-07-14 17:04:36 +02:00
holivier b0f445b123 Documented: Framework, migration all docbook files to asciidoc
(OFBIZ-11587)

- common-sending-email: include in email
- datafile: move as a include at the end of entity-engine section
- entity-engine: list of link to OFBiz wiki about entity configuration
- service-engine: a link to OFBiz wiki Service Engine Guide
- webtools: help for main screen
- mini-lang: include a link to OFBiz wiki mini-lang-reference at the
beginning of minilang-to-groovy-manual
           move minilang-to-groovy-manual to Development environment
section
- unit-test: include as Junit test, and use README to list gradle
command available (so add a tag in REAME.adoc)
- base: add a link to OFBiz wiki Configuration Guide, in deployment
section
- SingleSignOn with LDAP: move to plugin LDAP and include in deployment
section

developer-manual is updated with some include lines or with directly a
sentence.
2020-07-14 16:56:05 +02:00
holivier 5f56177d02 Documented: Framework/base migration to asciidoc
(OFBIZ-11587)

Delete docbook files
2020-07-14 16:53:09 +02:00
holivier 2c700e86af Documented: Framework/base migration to asciidoc
(OFBIZ-11587)

only one file about receiving email, so create email.adoc which included
receiving and later sending.
email.adoc is included in developer-manual.adoc in deployment section
2020-07-14 16:27:23 +02:00
Jacques Le Roux 33ca531db4 Improved: correct formatting of LoginServices
This was a WIP related to "Allow single line statements in checkstyle"
(OFBIZ-11886) but not really part of it.
See OFBIZ-11886-format-LoginServices-checkNewPassword.patch.

It may also include changes from
"Checkstyle formatting issues: 'typecast' is not followed by whitespace"
(OFBIZ-11887)
2020-07-14 14:09:45 +02:00
Pawan Verma 2b39209a1c Improved: Added getter for componentName.(OFBIZ-11751)
Thanks, Sebastian Berg for report and patch and Aditya Sharma for the review.
2020-07-13 15:33:01 +05:30
Suraj Khurana 0c37e80036 Improved: Corrected all checkstyle formatting issues: Line has trailing spaces in framework component.
(OFBIZ-11880)
Thanks Jacques for review.
2020-07-13 14:18:24 +05:30
Suraj Khurana dd4da77d76 Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for framework 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:33:47 +05:30
Jacques Le Roux d0fceffadd Fixed: don't remove localhost from host-headers-allowed it was only for testing 2020-07-11 09:59:17 +02:00
Jacques Le Roux 3c9fe5f916 Improved: better message for host-headers-allowed
Adds an explanation about what to do when using own domain.

Some users don't look into the log so it's better to set also the exception
message in order for them to have it right at 1st glance.
2020-07-11 09:59:16 +02:00
Pawan Verma 5c27d7ad5b Improved: Introduce support for having condition in EntityQuery#queryList method(OFBIZ-11846)
Thanks, Nitish and Suraj for review.
2020-07-11 09:36:13 +05:30
Suraj Khurana 3bb22302c7 Improved: Corrected all checkstyle issues related to succeeding space for comma in framework directory.
(OFBIZ-11805)
Thanks Jacques and Ritesh Kumar for review.
2020-07-09 12:07:29 +05:30
Jacques Le Roux c5cb927124 Documented: POC for CSRF Token (CVE-2019-0235) (OFBIZ-11306)
Clarifies the behaviour of csrf-token

Thanks: James Yong
2020-07-08 10:22:02 +02:00
Suraj Khurana a38fa69e57 Improved: Corrected typo in license header text in ModelActionVisitor.java, ModelConditionVisitor.java and ModelFieldVisitor.java. While working on some checkstyle issues, I found this typo. 2020-07-08 11:12:07 +05:30
Suraj Khurana c5f9697e35 Improved: Removed unused SuppressWarnings and added proper space after comma and before { in LoginServices.java.
(OFBIZ-11805)
Thanks: Pawan Verma
Also updated tasks.checkstyleMain.maxErrors (-5).
2020-07-07 17:10:11 +05:30
Suraj Khurana 443025e37f Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 2020-07-07 15:10:53 +05:30
Suraj Khurana fc6b8a6ca3 Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
2020-07-07 15:08:17 +05:30
Jacques Le Roux c52e437eca Improved: Removes trailing blanks found by chance, updates checkstyleMain.maxErrors 2020-07-07 10:12:25 +02:00
Jacques Le Roux 05b62d7476 Improved: moves a comment to its right location 2020-07-06 16:10:57 +02:00
Jacques Le Roux 16c2d35219 Documented: CsrfDefenseStrategy in case of no support for SameSite cookie attribute
Use of CsrfDefenseStrategy in case of potential use of a browser version not
supporting the SameSite cookie attribute

Refer to https://caniuse.com/#feat=same-site-cookie-attribute
2020-07-06 15:15:48 +02:00
Suraj Khurana bbfb390fb8 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk 2020-07-06 15:31:59 +05:30
Suraj Khurana 4f53828bea Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
Thanks Jacques Le Roux and Ritesh Kumar for review.
2020-07-06 15:29:58 +05:30
Pawan Verma 71ac32c89b Implemented: EntityBatchIterator which pages through large resultsets (500 at a time by default) and added support for EntityBatchIterator to EntityQuery via 'queryBatchIterator'(OFBIZ-11789) (#191)
Modified GenericDao#makeOffsetString to have OFFSET/FETCH style by default
Modified entityengine's mysql and postgres datasources to have LIMIT/OFFSET style, rest can work with default OFFSET/FETCH style

Thanks: Scott for the help.
2020-07-04 23:02:47 +05:30
Michael Brohl dfbcf595ca Fixed: Adds missing AJP connector property introduced for Tomcat 9.0.31
(OFBIZ-11848)
2020-07-03 17:34:47 +02:00
Daniel Watford 3bc59aeb14 Improved: Added new MacroFormRenderer unit tests (OFBIZ-11456) (#213)
Improved: Suppress deprecation warning on test method used to ensure behaviour is preserved until the deprecated method is removed. (OFBIZ-11456)

* Improved: Unit Tests for MacroFormRenderer

As part of refactoring MacroFormRender, unit tests have been created for
the main render methods to help ensure consistent behaviour is
maintained when MacroFormRender is changed.

More in-depth unit testing may be added when the more complex parts of
MacroFormRenderer are modified in the future.
2020-07-03 09:31:21 +02:00
Jacques Le Roux b1e48eef37 Improved: makes ScreenFopViewHandler::render debug area also usable on Windows 2020-06-29 11:47:23 +02:00
Pawan Verma 031592cc32 Fixed: EntityQuery queryCount is throwing error with distinct method (OFBIZ-11294)
Added missing support for selectFields in queryCount and all the subsequent methods.

Thanks: Deepak Dixit for the review.
2020-06-28 01:40:58 +05:30
Priya SharmaandPriya Sharma 5a144c0bed Improved: Use GroovyBaseScript's makeValue utility methods in each Groovy files (OFBIZ-11779)
Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-06-28 01:24:32 +05:30
Pawan Verma 3da16a182c Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830) 2020-06-28 01:21:23 +05:30
Pawan Verma e19b12eae9 Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
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.
2020-06-28 01:04:51 +05:30
Priya SharmaandPriya Sharma 0f9307c071 Improved: Convert InvoicePerShipmentTests.xml tests to groovy (OFBIZ-11553) (#208)
* Improved: Convert InvoicePerShipmentTests.xml tests to groovy (OFBIZ-11553)
Done following:
- converted all xml test implementation to groovy
- used MockHttpServletRequest MockHttpServletResponse objects for triggering the events
- removed the xml version of the test implementations
- updated the test service mapping in the invoicetests.xml
(OFBIZ-11553)

* Improved: Moved the common code into a method so as to avoid duplication of code.
- passed in two parameters i.e. product id and the invoicePerShipment flag, to be used as per the need of the testcase.
(OFBIz-11553)

* Improved: Added support to get access to the Debug log methods in the groovy tests. (OFBIZ-11553)
- Also updated the references in the InvoicePerShipment tests.

Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-06-27 18:09:34 +05:30
Pawan Verma f0af2894e5 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:23:12 +05:30
Pawan Verma 4275825b4a Improved: Replace anonymous types with lambda expressions(OFBIZ-11833) 2020-06-24 14:11:05 +05:30
Pawan Verma 2a4a617d0d Improved: Replace try-finally with try with resources(OFBIZ-11826)
Set checkstyleMain.maxErrors to 26678 (-4)

Thanks: Jacques for the review.
2020-06-22 21:32:42 +05:30
Pawan Verma 30732dd57b Improved: Replace Map.get() with Map.getOrDefault() method.(OFBIZ-11832)
Set checkstyleMain.maxErrors to 26682 (-2)
2020-06-22 21:26:18 +05:30
Pawan Verma 18f5dadd93 Improved: Replace single method call lambda with method reference(OFBIZ-11835)
Thanks: Jacques for the review.
2020-06-22 20:59:44 +05:30
James Yong 4dbdf720c5 Fixed: Apply multi-block attr to each application (OFBIZ-11706)
Rendering screen within freemarker template not done correctly when multi-block=true

Thanks: Jacques for reporting
2020-06-19 23:09:17 +08:00
Jacques Le Roux 743c790a36 Fixed: getEntityRefData service has a weird issue (OFBIZ-11401)
It's reproductible on trunk demo though only visible in log, UI shows no issue

R17 and R18 are also affected, R16 is OK.

Ankush: This stacktrace should be coming for all entities where
default-resource-name is defined on entity definition but no property exist in
defined resource for key EntityDescription.entityname and FieldDescription.field.

As we want to have these entity labels as much as possible, we can simply print
warning about the missing entity descriptions and field descriptions for
readability purpose instead of printing huge exceptions stacktrace.

Thanks: Ankush Upadhyay and Pierre Smits for the help
2020-06-18 17:39:49 +02:00
James Yong 3a13afe811 Fixed: showHelp not working (OFBIZ-11803)
Cater for page that uses layoutSettings.VT_STYLESHEET
instead of layoutSettings.styleSheets
2020-06-18 23:29:02 +08:00
Pawan Verma 43747764bc Improved: Change resources with proper naming convention in framework(OFBIZ-11834)
Also, modified checkstyleMain.maxErrors to 26735(-24)

Thanks: Jacques and Suraj for review.
2020-06-18 15:30:00 +05:30
holivier da690493f9 Fixed: Check embedded Javascript libs vulnerabilities using retire.js
(OFBIZ-11752)

Upgraded jQuery to 3.5.2 and jQuery migrate to 3.3.0 to vulnerabilities
of medium severity
    Regex in its jQuery.htmlPrefilter sometimes may introduce XSS;
https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

change in HelpScreen.xml
2020-06-17 14:34:51 +02:00
Jacques Le Roux 50fa929b83 Improved: Clean code according to SpotBugs and Eclipse (OFBIZ-11824)
Handles 2 possible NPR reported by SpotBugs
Removes the unused createPrimaryKeyFetcher method as reported by Eclipse
Reformats modified code to stay into 150 chars by line and other style issues
Sets tasks.checkstyleMain.maxErrors to 26759 (-1)
2020-06-17 10:07:00 +02:00
Jacques Le Roux 488b9b6b9a Improved: Checks if the value passed to checkStringForHtmlSafe is not null (OFBIZ-11822)
This was reported by SpotBugs in Eclipse to prevent a possible NPE.

It seems to me that it's more complex than that because of the
PolicyFactory::sanitize methods signatures where @Nullable annotation is
used. So the SpotBugs warning remains, anyway can't hurt.

BTW found 92 issues reported by SpotBugs in Eclipse, among them 33 are "scary"

I had to add 1 to tasks.checkstyleMain.maxErrors because of
https://github.com/apache/ofbiz-framework/pull/203 that I pulled after the push
was rejected by the pre-push local Git hook
2020-06-16 14:05:16 +02:00
Jacques Le Roux df828419be Fixed: Double encoded urls are not being decoded (OFBIZ-11822)
This was broken by OFBIZ-10275

Thanks: Alex Bodnaru
2020-06-15 13:25:35 +02:00
Jacques Le Roux 88bda0b4dc Improved: Install a Checkstyle pre-push (on every committer machine?) (OFBIZ-11304)
Updates tasks.checkstyleMain.maxErrors to 26842
Remove a trailing space in RequestHandler I used to test the pre-push hook.

In the previous commit (c4b5f5e) I have pushed a pre-push hook rather than a
pre-commit hook. I think it makes sense. I noticed that this does not clear the
existing pre-commit hook in .git\hooks. You have to clear it by hand.

But anyway I believe we should rather use a webhook as Suggested by Samuel and
proposed by Infra. This for at least 3 reasons:
    Handles PRs and not only local commits
    Minimise the CPU usage locally
    Simplify usage for custom projects

I think it's the best solution but I'll continue the discussion on dev ML about
2020-06-13 10:09:48 +02:00