Commit Graph
10472 Commits
Author SHA1 Message Date
Nicolas Malin fac12a4e6f Fixed: No functional change, correct checkstyle issues on GenericWebEvent.java 2020-01-29 10:50:29 +01:00
Jacques Le Roux c672c3a304 Fixed: Cannot run ComponentContainerTest on windows
(OFBIZ-11331)

Running ComponentContainerTest on windows fails due to parsing of paths of the
form '/c:/dev/....'
org.apache.ofbiz.base.container.ComponentContainerTest >
testCheckDependencyForComponent FAILED
java.nio.file.InvalidPathException at ComponentContainerTest.java:44

Line 44:
private Path ofbizHome = Paths.get(ComponentContainerTest.class.getResource
("testsdata").getFile()).toAbsolutePath().normalize();

PR created: #8

Thanks: Daniel WatfordNina Simone - My Baby Just Cares For Me.mp3
2020-01-28 18:36:06 +01:00
Daniel Watford 259f71dd43 Removed unused test imports. 2020-01-28 11:38:07 +00:00
Daniel Watford 0c2124a08a Get Path from URI than a string representation of a file path when building Path to test resources. 2020-01-28 11:35:52 +00:00
Jacques Le Roux 660018a0c4 Amend previous by removing a typo:
Improved: no functional change

After 12 years being unperceived I suddenly wondered about the world "default"
at the right of the connection and main Webtools screen.
It was added by OFBIZ-914, and missed a label, here it is.
2020-01-17 15:22:54 +01:00
Jacques Le Roux 121a913585 Improved: no functional change
After 12 years being unperceived I suddenly wondered about the world "default"
at the right of the connection and main Webtools screen.
It was added by OFBIZ-914, and missed a label, here it is.
2020-01-17 15:14:15 +01:00
James Yong 05ffbd2817 Improved: Add 'controlPath' attribute to 'ofbizUrl' freemarker macro
(OFBIZ-11317)

Adding the controlPath attribute to allow the controls by ofbizUrl to support uri to other OFBiz web application.

Thanks: Jacques for the review
2020-01-12 22:25:50 +08: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 583f926e04 Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ argument
No functional change.
2020-01-03 16:01:44 +01:00
Mathieu Lirzin 20e0bbe55c Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness
No functional changes.
2020-01-03 14:32:31 +01:00
Mathieu Lirzin 7508917a0a Improved: Remove ‘RequestHandler#ControllerConfig’ wrapper
(OFBIZ-11313)

‘RequestHandler#ControllerConfig’ was a wrapper around
‘ConfigXMLReader#ControllerConfig’ used as a convenience to gather
error handling when accessing configuration properties. Since the
later is now only throwing exceptions when instantiating the object,
‘RequestHandler#ControllerConfig’ is not useful anymore.
2019-12-30 09:54:24 +01:00
Mathieu Lirzin 6c745f6ea5 Improved: Retrieve the included controller files eagerly
(OFBIZ-11313)

The included controller files resolution was previously delayed when
accessing the configuration properties. The issue is that it imposes
callers to handle exceptions when accessing those
properties. Additionally this has the drawback of detecting inclusion
issues late.

We are now retrieving the included files when instantiating the
controller configuration object. This provides more guarantee on the
integrity of instantiated controllers and relax the error handling
requirements on configuration properties callers.
2019-12-30 09:47:55 +01:00
Jacques Le Roux 28b658e260 Improved: Equivalent of svn:auto-props properties on the server
(OFBIZ-OFBIZ-11279)

As explained at https://s.apache.org/i86ht

This is needed after b424d2683e
2019-12-19 13:19:59 +01:00
Mathieu Lirzin aae1c8a8f5 Reverted: "Improved: Use ‘depends-on’ attribute instead of “component-load.xml”"
(OFBIZ-11296)

This reverts commit eeabe69813.
2019-12-18 12:09:20 +01:00
Mathieu Lirzin d4c59c3bde Improved: Inline ‘StartupControlPanel#createLogDirectoryIfMissing’.
Use a lambda instead of an anonymous class to implement a thread.
2019-12-08 00:33:11 +01:00
Mathieu Lirzin df5dde37d5 Improved: Replace getLocation with location in ‘ComponentConfig.WebappInfo’
(OFBIZ-11192)

Use Path instead of String + File.
2019-12-08 00:12:52 +01:00
Mathieu Lirzin 4d4a1ba1cd Improved: Lint ‘FreeMarkerWorker’ class
(OFBIZ-11161)
2019-12-07 23:16:45 +01:00
Mathieu Lirzin 376b818464 Improved: Do not add classpath info to the classloader classpath (OFBIZ-11161)
Those directories are already added in the classpath by the build
system. The classpath info defined in “ofbiz-component.xml” files are
now only used to retrieve label files.
2019-12-07 23:13:18 +01:00
Samuel Trégouët 98bfafd148 Improved: Resolve classpath conflict on freemarkerTransforms.properties
(OFBIZ-11161)

All files in {compoment}/config directories are placed in jar
root (cf. sourceSets definition in build.gradle) but there are 4 different
`freemarkerTransforms.properties` in ofbiz (content, product, webapp, widget).
This works fine because we are adding config directories in classpath (through
classpath tag in ofbiz-component.xml), but this is not really intuitive. So to
make things clearer this patch move `freemarkerTransforms.properties` into
`src/main/resources` with a namespace package and `FreeMarkerWorker.java` is
modified accordingly.
2019-12-07 23:13:10 +01:00
Samuel Trégouët 62c617eeec 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
2019-12-07 22:58:29 +01:00
Samuel Trégouët e7bec48f16 Fixed: Use ‘WebAppUtil#parseWebXmlFile’ when handling “web.xml” files
(OFBIZ-6993)
2019-12-07 22:51:09 +01:00
Mathieu Lirzin 3c9af84245 Fixed: Display file name in XML parsing errors
(OFBIZ-6993)
2019-12-07 22:51:05 +01:00
Nicolas Malin 071a74238b Fixed: Fix missing else during previous refactoring
(OFBIZ-11253)
When you rendering for with auto-field-entity on edit mode, indicator field has been override by text field.
Fix also two error on source field type set to FieldInfo.SOURCE_AUTO_SERVICE instead of FieldInfo.SOURCE_AUTO_ENTITY

Thanks to Olivier Heintz to inform on the regression.
2019-12-06 21:29:32 +01:00
Mathieu Lirzin 87d7465306 Improved: Move ‘ComponentContainerTest’ data to src/test/resources/ (OFBIZ-11275)
Remove unnecessary webapp declaration inside the test component
configurations.
2019-12-01 23:43:53 +01:00
Jacques Le Roux 2da6de1090 Fixed: https://github.com/apache/ofbiz-framework/pull/3
Just fixes a typo I guess people from Indonesia and Yogyakarta did not see
it yet, so I did not create a Jira
2019-12-01 12:31:17 +01:00
Mathieu Lirzin 3b14e7afa9 Reverted: "Fixed: add XML declaration in “web.xml” files (OFBIZ-6993)"
This reverts commit a93b1fcb78.
2019-11-27 21:42:33 +01:00
Mathieu Lirzin b006b8c7cb Revert "Improved: Update “web.xml” files version 3.0 → 4.0 (OFBIZ-6993)"
This reverts commit 226e901981.
2019-11-27 21:40:10 +01:00
Samuel Trégouët 226e901981 Improved: Update “web.xml” files version 3.0 → 4.0 (OFBIZ-6993) 2019-11-27 17:29:41 +01:00
Samuel Trégouët a93b1fcb78 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
2019-11-27 17:28:44 +01:00
Mathieu Lirzin eeabe69813 Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)
We currently have two ways to define component loading order. Either
by using ‘depends-on’ attribute in “component-config.xml” or by adding
a “component-load.xml” file at the root of a component directory.

“depends-on” is more flexible because it handles partial ordering when
“component-load.xml” defines a total order which is not necessarily
meaningful, so it is better to rely only “depends-on”.

This removes the usage of “component-load.xml” to use ‘depends-on’
instead. The dependency declarations correspond to the total ordering
previously defined but will need to be refined in the future to relax
unnecessary dependency declarations.

Only “framework/base/config/component-load.xml” which defines the
top-level directories order (framework, applications, themes and
plugins) is kept.
2019-11-25 15:28:54 +01:00
Samuel Trégouët 000325208a Fixed: Remove dependency management from ‘ComponentContainer’
(OFBIZ-11275)

This fixes a bug identified by ‘testCheckDependencyForComponent’ where
the dependencies declared inside component configurations were not
impacting the component retrieval order.

Component configurations stored in the cache can now be properly
sorted based on their <depends-on> declaration.  The new
‘ComponentConfig#sortDependencies’ method returns a collection of
component configuration following a topological ordering.

In case of dependency cycle we throw an error.
2019-11-25 14:56:18 +01:00
Nicolas Malin bc0b80b466 Fixed: Remove unneeded space after parenthesis 2019-11-25 09:13:18 +01:00
Nicolas Malin a1f16274c2 Improved: Add enconding type attribute for import data file tools
(OFBIZ-10234)
During the import of file via datafile import you may want to set encoding type.
Actually only the type UTF-8 is supported.
This commit allows to add a new "encoding-type" attribute into data-file to indicate the type of encoding of the imported file.

Thanks to Pierre Gaudin for this improvement.
2019-11-22 15:10:37 +01:00
Nicolas Malin 935ffe86ca Fixed: Possible NPE in StringUtil#strToMap
(OFBIZ-11281)

StringUtil#strToMap(String, String, boolean, String) throws Nullpointer for StringUtil.strToMap("", false).

Thanks to Ulrich Heidfeld for this fix
2019-11-14 09:10:05 +01:00
Nicolas Malin 2c58133e50 Improved: Improve webtools/control/FindGeneric
(OFBIZ-11253)
Update the script to generate xml form to introduce new following features :

   * set equals as operator by default on pk instead of contains, when you use a pk on FindGeneric it's in general to resolve it on completed key.
   * add on tooltip the raw field name
   * add possibility to filter on internal field
   * add sort on column

During this work I also view that the ModelFormField contains an 'IF forest' to analyze each field. I rewrote it to consolidate the analyze by type.
2019-11-10 20:14:34 +01:00
Mathieu Lirzin a521de9ad8 Reverted: "Fixed: Remove dependency management from ‘ComponentContainer’"
(OFBIZ-11275)

This reverts commit 3d3533cf5e.

‘./gradlew cleanAll loadAll’ do not work anymore.
2019-11-09 00:54:56 +01:00
Mathieu Lirzin 03b69b30a5 Fixed: Fix linting issues
(OFBIZ-11265)
2019-11-08 18:19:51 +01:00
Samuel Trégouët 3d3533cf5e Fixed: Remove dependency management from ‘ComponentContainer’
(OFBIZ-11275)

This fixes a bug identified by ‘testCheckDependencyForComponent’ where
the dependencies declared inside component configurations were not
impacting the component retrieval order.

Component configurations stored in the cache can now be properly
sorted based on their <depends-on> declaration.  The new
‘ComponentConfig#sortDependencies’ method returns a collection of
component configuration following a topological ordering.

In case of dependency cycle we throw an error.
2019-11-08 18:19:51 +01:00
Samuel Trégouët 7044af8a6f Implemented: Add a generic directed graph utilitary class
(OFBIZ-11275)
2019-11-08 18:19:51 +01:00
Samuel Trégouët 1317703c9a Implemented: Show dependency resolution algorithm problem
(OFBIZ-11275)

This adds a test demonstrating a bug in the dependency resolution
algorithm done in ‘ComponentContainer’.

When relying on <depends-on> declaration in “ofbiz-component.xml”
files we should expect to retrieve components (and their associated
containers) in a topological ordering meaning a linear ordering where
each component configuration element is placed after its dependencies
configuration elements.  Currently this is not the case and the
dependency declarations only impact the construction of the dynamic
classpath.
2019-11-08 18:19:46 +01:00
Jacques Le Roux 8aea160e04 Fixed: Getting policy error while editing html text data using cms
(OFBIZ-11265)

Service parameter with allow-html="safe" does not check the OWASP sanitizer flag
ie. enabled or not and perform sanitization which causing policy error while
editing text data

getting following exception error:
"In field [textData] by our input policy, your input has not been accepted for
security reason. Please check and modify accordingly, thanks."

Thanks: Pradeep Choudhary for report and suggestion
2019-11-07 15:46:05 +01:00
Samuel Trégouët 889769593e Improved: Remove ‘ServiceEventHandler#checkSecureParameter’
(OFBIZ-11260)

There is no security reason justifying to prevent the invocation of
service event handlers with URI parameters if we accept request body
parameters.  As a consequence it is preferable to unconditionally
accept URI parameters and remove the
‘service.http.parameters.require.encrypted’ configuration property.
2019-11-04 22:52:16 +01:00
Samuel Trégouët f93b9ea29a Improved: Lint ‘ServiceEventHandler’ class
(OFBIZ-11260)
2019-11-04 22:50:14 +01:00
Jacques Le Roux 2af71198d4 Fixed: content/control/WebSiteCms?webSiteId=CmsSite fails
(OFBIZ-11266)

I did not notice that I unintentionally removed a line
while fixing OFBIZ-11259
2019-11-04 15:24:23 +01:00
Mathieu Lirzin 7d9080702d Improved: Turn ‘DependsOnInfo’ into a String
(OFBIZ-11264)

`depends-on` XML tag doesn't have any `loader` or `location` attribute so
DependsOnInfo does not need to extend ResourceInfo.

When removing the class derivation, DependsOnInfo now becomes a simple box
containing a String attribute. In order to make the manipulation of dependency
information simpler, the attribute is now inlined as a simple String value.

Thanks: Samuel Trégouët for your contribution


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869185 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:47:58 +00:00
Mathieu Lirzin e5592a9bf4 Improved: Add ‘ComponentConfig#toString’ to ease debugging
(OFBIZ-11264)

Thanks: Samuel Trégouët for your contribution


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869184 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:42:59 +00:00
Mathieu Lirzin 5a8e2dcf3c Improved: Rewrite ‘ComponentContainer#loadComponentsInDirectory’
(OFBIZ-11264)

Use a more declarative style with the stream API.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869183 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:41:29 +00:00
Mathieu Lirzin aeebf807b8 Improved: Delay the construction of component classpaths
(OFBIZ-11264)

The list of component classpath elements was constructed iteratively
while loading components. This list was additionally used to check if
a component was actually loaded.  This implementation was leading to
hard to understand code that has been replaced by a more appropriate
‘LinkedHashSet’ object.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869182 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:38:08 +00:00
Mathieu Lirzin 7093974aa7 Improved: Remove unnecessary ‘throws’ declarations
(OFBIZ-11264)

Some declared and/or documented exceptions that were not actually
thrown.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869181 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:34:30 +00:00
Mathieu Lirzin c9788a0b48 Improved: Import ‘ComponentDef’ and ‘DependsOnInfo’ inner-classes
(OFBIZ-11264)

This allows to use shorter name when using an variable or parameter of
those types.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1869180 13f79535-47bb-0310-9956-ffa450edef68
2019-10-30 15:33:13 +00:00