(OFBIZ-10553)
But createQuoteWorkEffort is not a crud service on entity QuoteWorkEffort because it is linked to a seca to call createWorkeffort before if a workEffortId is not present in context.
<eca service="createQuoteWorkEffort" event="in-validate">
<condition field-name="workEffortId" operator="is-empty"/>
<action service="createWorkEffort" mode="sync"/>
</eca>
I converted this service createQuoteWorkEffort has a real Crud service and create an other ensureWorkEffortAndCreateQuoteWorkEffort to simulate the attendee process. Now we have a coherent service naming and not surprise for developer .
To manage the service createQuoteWorkEffort as deprecated, I define it twice
<service name="createQuoteWorkEffort" default-entity-name="QuoteWorkEffort" engine="entity-auto" invoke="create" auth="true">
<deprecated use-instead="ensureWorkEffortAndCreateQuoteWorkEffort" since="Upcoming Release">
use createQuoteWorkEffort to create a workeffort has been deprecated for best pratice naming reason, use ensureWorkEffortAndCreateQuoteWorkEffort instead.
Now createQuoteWorkEffort work as a crud service on QuoteWorkEffort
</deprecated>
</service>
<service name="createQuoteWorkEffort" default-entity-name="QuoteWorkEffort" engine="entity-auto" invoke="create" auth="true">
<description>Create a new QuoteWorkEffort</description>
<required-permissions join-type="AND">
<check-permission permission="ORDERMGR" action="_CREATE"/>
</required-permissions>
<auto-attributes mode="IN" include="pk"/>
</service>
First to alert on deprecation and second ensure that the definition work fine.
In log we will have an alert on the deprecation and an alert on the duplicated definition during the deprecation time.
Thanks to Antoine Ouvrard, Gil Portenseigne, Leila Mekika and Mathieu Lirzin for their review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1847056 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10214)
4 updates were not possible:
Tika 1.18 max
Poi 3.17 max
I did not update
sshd-core
cas-server-core
Please refer to the Jira for more information
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1847026 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10474)
In an effort of refactoring the RequestHandler class, I have factored the code
from runAfterLoginEvents and runBeforeLogoutEvents using a FunctionalInterface
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846899 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10651)
After INFRA-17258 Infra has created the directories needed to access the
generated documentation from the site.
Adds a generateAllPluginsDocumentation task to generate the plugins
documentation under the build\asciidoc\plugins directory. It will be used in the
Buildbot script to copy the plugins documentation in
ci.apache.org/projects/ofbiz/site/pluginsdoc/
with the OFBiz documentation generated in build\asciidoc\ofbiz
copied to ci.apache.org/projects/ofbiz/site/ofbizdoc/
The plugin documentation tasks are also changed to use the build/asciidoc/plugins
path instead of /build/asciidoc previously
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846890 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10451)
Use String#equalsIgnoreCase instead of combining String#equals and
String#toUpperCase. Additionally this avoids having to check the emptiness
of the X-Forwarded-Proto request header.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846793 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10447)
It seems better to remove some code and rely on method/contructor dispatch.
jleroux: w/o specific implementations, there is no point indeed
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846790 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10445)
There was only two local callers of this trivial method, so remove it.
Rename requestHandler in doGet local variable to handler.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846784 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10649)
The service callback handling done in
org.apache.ofbiz.service.engine.AbstractEngine
can be rewritten more nicely without explicit iterators.
Additionally it is not nice that the engine is responsible for removing
disabled callbacks. The ServiceDispatcher should be responsible for removing
them.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846783 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10411)
To define boolean values, some ad-hoc enumeration of "true" and "false" are
repeatedly used. Since XML Schema defines a standard boolean datatype it's
better to use it.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846727 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10597)
Instead of having multiple null checks for viewMap separately for each security header we can have a single combined null check at the top in setResponseBrowserDefaultSecurityHeaders() method.
With increasing security headers these may become expensive.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846632 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10648)
Bill of Materials search returning duplicate entries in search results.
Test Steps:
1. Login to Manufacturing application.
2. Navigate to Bill of Materials tab.
3. Observe the issue in Search results.
Expected Result:
Unique products should be displayed on Bill of Materials search results.
Actual Result:
Bill of Materials search returning duplicate entries in search results.
The distinct constraint is missing in FindProductBom.groovy find query.
Thanks: Aditya Barve
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846594 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10646)
Following discussion at https://markmail.org/message/y3izmnxd7jd6jbkf
this cleans some Groovy files in the base component, notably:
* remove ant-scripts folder and its content.
* Rename framework/base/groovyScript to framework/base/groovyScripts;
* Move GroovyInit.groovy and GroovyServiceTest.groovy respectively to
framework/base/groovyScripts and framework/common/groovyScripts
and change their paths where used.
* Removes GroovyInit.groovy from excludedConfigFiles in build.gradle
* After OFBIZ-10611 it's possible to move GroovyBaseScript.groovy from
framework/service/src/main/java/org/apache/ofbiz/service/engine
to
framework/service/src/main/groovy/org/apache/ofbiz/service/engine
* Removes FileUtilTests.groovy from basetests.xml (missed it in OFBIZ-10611)
* Fixes a typo in test-suite.xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846485 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10611)
Since OFBIZ-9996 it is possible to write integration tests in Groovy, meaning
test that depend on the dispatcher and the delegator. It would be nice if the
unit tests could be written in Groovy too.
The major benefit of writing tests in Groovy is that you create inputs and
expected outputs more easily with objects literals.
For example the following java code:
Map<String, Integer> input = new HashMap<>();
input.put("foo", 42);
input.put("bar", 37);
can be rewritten in Groovy like this:
def input = [foo: 42, bar: 37]
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846393 13f79535-47bb-0310-9956-ffa450edef68
As annouced on dev ML removes unused code related to rememberMe.
I noticed this block of code in LoginEvents::storeLogin
if ("Y".equals(request.getParameter("rememberMe"))) {
setUsername(request, response);
}
It was added by Andrew long ago: https://markmail.org/message/dmqqxse65inh6amr
But rememberMe is never created in code so LoginEvents::setUsername is never used.
This removes this block of code and the 2 related methods below.
Also automatically clean imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846221 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10615)
Steps to Regenerate issue:
# Login to demo-trunk or demo-stable instance with details:
URL - [https://demo-trunk.ofbiz.apache.org/content/control/findForumGroups]
admin/ ofbiz OR
URl - [https://demo-stable.ofbiz.apache.org/content/control/createForumGroup]
admin/ ofbiz
# Go to Content > Forum and try to create new forum group.
# do not enter Forum Group Name and Description.
# Click on the Submit button.
Actual - System allowed the user to enter an empty forum group.
This issue is occurring at demo-trunk and demo-stable instance.
Expected - Empty Forum group should not be added. If the user tries to do this
s/he should not be allowed and proper validation error message should display.
Thanks: Sanjay Yadav
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846214 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10631)
Several phone number validation functions have been deprecated (and are not used in framework code).
This concerns:
isUSPhoneNumber
isUSPhoneAreaCode
isUSPhoneMainNumber
isInternationalPhoneNumber
Thanks: Pierre Smits
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846213 13f79535-47bb-0310-9956-ffa450edef68
existing categories
(OFBIZ-10328)
This method just crashes, if there is a category which has the same name as
the one the user is trying to create.
There should be a check for existing attributes and a clean return,
no exception throwing.
Thanks: Benjamin Jugl
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846158 13f79535-47bb-0310-9956-ffa450edef68
existing attributes
(OFBIZ-10327)
This method just crashes, if there is an attribute which has the same name as
the one the user is trying to create.
There should be a check for existing attributes and a clean return,
no exception throwing.
Thanks: Dennis Balkir for report and Benjamin Jugl for patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846156 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9557)
When scheduling a job it automatically schedules it to run as the user that
created the schedule. The issue comes up when that users password changes.
If your are forced to change your password automatically you have to delete all
previously scheduled jobs and recreate them.
This adds a checkbox to run a job as system on Schedule Job screen as system user
Permissions are used to guarantee security.
Thanks: Matthew Mulligan for report and Rohit Koushal for discussion and patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846137 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10567)
This is related with the common-theme introduction.
There are 2 fields named visualThemeId in the data model. The one in
ProductStore entity existed before the common-theme introduction with the new
entity VisualTheme. When the theme is initialised with InitTheme.groovy it sets
the context.visualThemeId value if it does not exist yet with
parameters.visualThemeId. At this point things get confused and the
backend theme used is replaced by the ecommerce theme defined for the
productStore.
I think it would overwhelming to change the data model when only the
EditProductStore form and updateProductStore service are concerned.
So here is a very simple workaround where visualThemeId is replaced by
ecomThemeId in the EditProductStore form and updateProductStore service.
If someone prefers to change the data model and related code feel free to revert,
reopen the Jira and do.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846097 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10641)
A test error related to GetLocaleListTests.java seems to happen only on a fresh
trunk install when running unit tests. It's no stopping tests.
I'm not sure yet if R17 is concerned. I did not try, but will 1st confirm with
this commit with trunk demo error.loç
Mathieu suggested to replace the location
component://base/config/GroovyInit.groovy
with ofbizhome://framework/base/config/GroovyInit.groovy
because GroovyUtil [should not] depend on the component container in the
1st place, and it seems to work.
Thanks: Mathieu for the idea.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845933 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10635)
Renames "keep-autologin-cookie" to "use-autologin-cookie", and only create
Autologin cookies when needed. No need to create Autologin cookies in
applications that don't need it.
Don't pass webAppName to LoginWorker::getSecuredUserLoginId, that can be handled
with improved LoginWorker::getSecuredLoginIdCookieName
Removes LoginWorker::autoLogoutCleanCookies, no longer needed since only those
needed are created and kept (1 year at least after creation).
For both autoLogin and securedLoginId cookies sets the path to the application.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845558 13f79535-47bb-0310-9956-ffa450edef68
without <<app-bar-display="false">>
(OFBIZ-10637)
LoginWorked::getAppBarWebInfos is used to define the apps menus in themes so we
need to also check that no menuName is passed to
ComponentConfig::getAppBarWebInfos. Else all menus appears in the secondary menu
bars
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845552 13f79535-47bb-0310-9956-ffa450edef68
authentication
(OFBIZ-10307)
While working on OFBIZ-10635 I spotted that I used a root path for
securedLoginId cookies. It's better to set it to the webapp name like it's done
by Tomcat for the JSESSIONID cookie. This fixes it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845502 13f79535-47bb-0310-9956-ffa450edef68
authentication
(OFBIZ-10307)
While working on OFBIZ-10635 I spotted that at r1844880 I forgot to put a call
to LoginWorker::createSecuredLoginIdCookie in LoginWorker::checkExternalLoginKey
in the general case (when the user log in for the 1st time). This fixes it.
Also makes the comment makes sense.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845497 13f79535-47bb-0310-9956-ffa450edef68
Fixed:
(OFBIZ-10597)
While rendering the view through the controller request we set the important
security headers like x-frame-options, strict-transport-security,
x-content-type-options, X-XSS-Protection and Referrer-Policy etc. in the
response object. (Please see the 'rendervView' method of RequestHandler class.)
In the similar line, we set the cache related headers like Expires,
Last-Modified, Cache-Control, Pragma.
But these security headers are missing in the pages rendered through CMS.
(Please visit the CmsEvents class).
These headers are very crucial for the security of the application as they help
to prevent various security threats like cross-site scripting,
cross-site request forgery, clickjacking etc.
Thanks: Deepak Nigam for initial patch and review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845420 13f79535-47bb-0310-9956-ffa450edef68
Fixed:
(OFBIZ-10597)
While rendering the view through the controller request we set the important
security headers like x-frame-options, strict-transport-security,
x-content-type-options, X-XSS-Protection and Referrer-Policy etc. in the
response object. (Please see the 'rendervView' method of RequestHandler class.)
In the similar line, we set the cache related headers like Expires,
Last-Modified, Cache-Control, Pragma.
But these security headers are missing in the pages rendered through CMS.
(Please visit the CmsEvents class).
These headers are very crucial for the security of the application as they help
to prevent various security threats like cross-site scripting,
cross-site request forgery, clickjacking etc.
Thanks: Deepak Nigam for initial patch and review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845418 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10635)
While working on this issue I spotted that securedLoginId has the same duration
(1 year) than autoUserLoginId.
I have reduced it to the browser session which is the purpose.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845341 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10452)
The RequestHandler#doRequest is only a wrapper for an overload.
Since it is not used anywhere in the framework, just remove it.
jleroux: jaz (Andrew Zeneski) added it as a "convenience". I see no problems
removing it
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845208 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10598)
Added prefix to files as OfbizSetup to better understand its usage.
Changes the file names and adds a missing files used in the SetupEvents xml events to setup ofbiz.
Thanks to Jacques for reporting the issue and help.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1845104 13f79535-47bb-0310-9956-ffa450edef68