Commit Graph
311 Commits
Author SHA1 Message Date
Jacques Le Roux 7a22a2bfc9 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 09:28:06 +02:00
Nicolas Malin fa3e3573dc Improved: Improve run test from artefact info (OFBIZ-12312)
From https://localhost:8443/webtools/control/ViewComponents we have te possibility to run each test case or test suite.

We improve it with call with rest schema (like https://localhost:8443/webtools/control/RunTest/product/producttagtests) and display the result below

By this way, we also improve the groovy syntax to slim the code and extend xml form to CommonBasicGrid

Thanks to Gil Portenseigne for is support
2021-09-10 10:17:23 +02:00
Eugen Stan 293db968c0 Improved: Clean commented code from ofbiz webtools (#313)
(OFBIZ-8043)
2021-07-09 07:30:44 +02:00
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
Wiebke Pätzold 82a15c70e3 Improved: Removed inner assignments (OFBIZ-12169) 2021-02-10 11:38:04 +01:00
Wiebke Pätzold 2e6399c20c Improved: Simplified expression (OFBIZ-12169) 2021-02-09 14:09:55 +01:00
Michael Brohl bae3628501 Declare classes final as suggested by checkstyle (OFBIZ-12169)
Helper and Worker classes which are likely to be extended by custom
projects where left as is.
2021-02-08 17:09:56 +01:00
Benjamin Jugl 5a0b0a0c0d Fixed: Checkstyle Issues in WebToolsDbEvents and UtilXml (OFBIZ-6510) 2021-02-04 12:29:28 +01:00
Benjamin Jugl 8fac07ad0a Improved: Replaces ModelInduceFromDb with widgets (OFBIZ-6510) 2021-02-03 12:39:15 +01:00
Suraj Khurana a5619831eb Improved: Added missing Javadocs for remaining methods in framework component, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
Thanks Jacques for review.
2020-09-13 11:28:00 +05:30
Suraj Khurana 97b1688b0d Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements. Thanks Jacques for review.
2020-09-12 12:05:16 +05:30
Jacques Le Roux 5d8541ebf8 Fixed: Checkstyle, variable must be private and have accessor methods (OFBIZ-11963)
Removes RESOURCE, not used anywhere
Replaces keyseparator by KEY_SEPARATOR in Groovy files that use it

We need to be careful about Groovy files that use variables. At least Eclipse
Grooby plugin is not able to check that in an easy way (ill-names vars are
though underlined)
2020-09-09 15:46:06 +02:00
Suraj Khurana bc5e945ded Improved: Corrected line is longer than 150 characters checkstyle issues in framework component.
(OFBIZ-11921)
Also fixed some other extra space and naming related checkstyle issues observed.
Thanks Jacques for review.
2020-09-04 12:25:12 +05:30
Suraj Khurana f98f5ebb86 Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
Also fixed some other checkstyle issues that requires re-factoring.
Thanks Jacques for review.
2020-08-28 16:54:15 +05:30
Pawan Verma 6cb67c1a40 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:17:10 +05:30
Suraj Khurana 9689201b84 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements.
Thanks jacques for finalizing Javadoc pattern during this effort.
2020-08-22 13:20:39 +05:30
Suraj Khurana 8c10d4ae72 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 framework component. Also corrected some variables as per naming convention best practices.
Thanks Jacques for review.
2020-08-17 12:30:26 +05:30
Suraj Khurana 33f05c1684 Improved: Corrected all redundant modifiers occurences in framework component. Also, fixed some other checkstyle line formatting and spacing issues.
(OFBIZ-11925)
2020-08-06 18:53:13 +05:30
Suraj Khurana 7d82b17c72 Improved: Corrected some line is longer than 150 characters checkstyle issues in framework component. Also fixed some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
2020-08-03 10:11:40 +05:30
Suraj Khurana d374019465 Improved: Corrected all incorrect indentation level issues in framework component, also fixed some case indentation checkstyle issues.
(OFBIZ-11922)
2020-07-26 21:04:41 +05:30
Suraj Khurana f4f2722d36 Improved: Updated case indentation to 0 for all switch statements in framework component. Also done formatting changes as per checkstyle best practices.
(OFBIZ-11904)
2020-07-25 13:50:37 +05:30
Suraj Khurana 7b251e43d9 Improved: Corrected some single line statements to fix checkstyle issues, also removed some remaining extra spaces from code to avoid checkstyle erros in framework component.
(OFBIZ-11886)
2020-07-21 12:25:20 +05:30
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
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
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
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
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 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 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
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
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
Priya SharmaandPriya Sharma 15aec7e8f7 WIP: [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762) (#185)
* [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug
- Replaced the debug.log methods with the respective groovy utility method
- Enhanced the GroovyBaseScript to entertain the fetch the current class name as the module name for logging
- Overloaded the logError method to entertain throwbale object for better logging
- Removed unused import statements and module variables.

(OFBIZ-11762)

* [Removed]: Extra line spaces. (OFBIZ-11762)

* [Revert]: Unwanted changes. (OFBIZ-11762)

* [Added] Same changes to these files. (OFBIZ-11762)

Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-06 10:17:23 +02:00
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux ddb8f4273a Improved: replaces module by MODULE everywhere 2020-04-05 19:46:34 +02:00
Jacques Le Roux 549543ace5 Fixed: replaceFirst sensible to variable pattern
(OFBIZ-11396)

When using variable pattern with replaceFirst you may cross issues if the
pattern contains specific tokens. For instance on Windows with the path
"C:\projectsASF\Git\ofbiz-framework/" you have inside the token "\p" which has
a special meaning.
2020-02-22 07:32:15 +01:00
Nicolas Malin 1941a05a34 Improved: Manage VisualTheme in ModelForm
(OFBIZ-11335)

Related to issue OFBIZ-11335, extends form's factories and form's models
to support a visualTheme during the model creation.

This extend help centralize style information used by forms on a theme.
For performance reason when the model is loaded in memory, all theme information
need to be present to set immutable as possible to put it in cache
(implies why the key cache contains now the visualThemeId).
2020-02-20 14:34:28 +01:00
Nicolas Malin 1ee1ec76d6 Fixed: Change 'restMethod' by '_method' in request parameters
(OFBIZ-11007)

Some issue has been introduce on the previous commit 6e1c7b5 [1], corrected by this one :
  * the view link on ListGeneric failed
  * the paginate on ListGeneric failed

I also simplify the url writing with delegate the entity path generation and translation
to two function on EntityUtil : entityToPath and getPkValuesMapFromPath

thanks to Pawan Verma to spot the pagination problem

[1] https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=6e1c7b5
2020-01-29 10:50:30 +01:00
Nicolas Malin fac12a4e6f Fixed: No functional change, correct checkstyle issues on GenericWebEvent.java 2020-01-29 10:50:29 +01:00
Nicolas Malin 6e1c7b5958 Implemented: REST, adding segmented URI support for webtools/entitymaint
(OFBIZ-11007)

After implemeted Rest mechanism on rev. 1868963 by Mathieu Lirzin,
I reviewed the rest url implemented by Artemiy Rozovyk for entitymaint in webtools.

With discussion with Mathieu and Leila, I selected this pattern :

    entity/[cover]/{entityName}/{pkValues: .*}

and implemented like this :

    entity/list -> list all entities
    entity/find/Party -> search
    entity/find/Party/Company -> displaying form for Party with id Company
    entity/create/Party -> creation form for a Party
    entity/edit/Party/Company/Company -> edit form for Party with id Company
    entity/change/Party/Company -> call crud following given http method
    entity/relations/Party -> View relation for Party

The old uris were currently kept and the oldest GenericWebEvent.updateGeneric() were updated to support rest method information.

Thanks Mathieu, Artemiy and Leila for their help to complete this improvement.
2020-01-09 17:51:12 +01:00
Mathieu Lirzin 2c37e2188b Improved: Move APACHE2_HEADER_FOR_XML to “src/main/resources”
(OFBIZ-11161)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868646 13f79535-47bb-0310-9956-ffa450edef68
2019-10-20 11:17:41 +00:00
Mathieu Lirzin 13188ab6cc Improved: Refactor ‘ComponentConfig.ClasspathInfo’
(OFBIZ-11192)(OFBIZ-11238)

The validity checks have been moved at construction time instead of
relying on client code to ensure that the class path information are
sound.

A new ‘ComponentConfig.ClasspathInfo.Type’ enum has been defined to
improve type safety.

The location of the class path information is now using a
‘java.nio.file.Path’ class instance.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868030 13f79535-47bb-0310-9956-ffa450edef68
2019-10-05 16:30:12 +00:00
Mathieu Lirzin 60f7041c3d Improved: Use ‘Path’ for component config ‘rootLocation’ attribute
(OFBIZ-11192)

The method ‘ComponentConfig#getRootLocation’ has been removed
and replaced by ‘ComponentConfig#rootLocation’.

The callers have been adapted.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868028 13f79535-47bb-0310-9956-ffa450edef68
2019-10-05 16:20:32 +00:00
Jacques Le Roux 6a89860bbc Improved: Move Groovy scripts from /groovyScripts/ to /src/main/groovy/
(OFBIZ-11205)

Moves FetchLogs.groovy as a 1st step

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867344 13f79535-47bb-0310-9956-ffa450edef68
2019-09-22 14:18:23 +00:00
Mathieu Lirzin daa1e6160e Reverted: JSON entity data import and export utility
(OFBIZ-10966)

Implementation was not matching OFBiz code quality requirements.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867342 13f79535-47bb-0310-9956-ffa450edef68
2019-09-22 12:29:54 +00:00
Jacques Le Roux 28dfdf5c2e Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use 3 try-with-ressource blocks and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866957 13f79535-47bb-0310-9956-ffa450edef68
2019-09-15 06:32:42 +00:00
Jacques Le Roux 73ebcfb095 Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

In many Java and Groovy files we have auto generated catch blocks or empty catch 
blocks. 
To avoid such exception swallowing this should be improved to at least log the 
error and also return error in case of service.

Here we use a try-with-ressource block and log some errors

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866952 13f79535-47bb-0310-9956-ffa450edef68
2019-09-14 17:11:59 +00:00
Mathieu Lirzin 7999e3adc1 Improved: Remove useless imports
(OFBIZ-11142)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863507 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 18:45:21 +00:00
Mathieu Lirzin fc6f9023d2 Improved: Use ‘StandardCharsets.UTF_8’
(OFBIZ-11142)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863505 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 18:41:37 +00:00