Commit Graph
26 Commits
Author SHA1 Message Date
Jacques Le Roux c1d09961dd Improved: Clean some Groovy files in base component
(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
2018-11-13 05:03:51 +00:00
Jacques Le Roux b4ad57201f Improved: Rename the misnamed setUserLocale.js to setUserTimeZone.js
(OFBIZ-10472)

At the same time renames setLocaleFromBrowser to SetTimeZoneFromBrowser 
everywhere it's needed
And adds a documentation about the auth mismatch as suggested by Mathieu

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835628 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 11:16:07 +00:00
Gil Portenseigne 8686e1f4c7 Improved: GetLocaleList call can provide duplicate results
(OFBIZ-10458)

Just improve hasFilter condition to use .with groovy notation.

Thanks Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835599 13f79535-47bb-0310-9956-ffa450edef68
2018-07-10 19:59:20 +00:00
Gil Portenseigne f428a7e803 Fixed: GetLocaleList call can provide duplicate results
(OFBIZ-10458)

A new Junit test is implemented to validate that no duplicates are present.
Groovy service has been refactored to use a more functional style

Thanks Mathieu Lirzin for reporting and providing the patch


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835282 13f79535-47bb-0310-9956-ffa450edef68
2018-07-06 21:10:07 +00:00
Nicolas Malin 6a5ffb512e Implemented: Add CustomScreen entity copy from CustomMethod pattern (OFBIZ-10186)
With this entity we can define some different widget screens available on the system (organised by type) to link with other entities for resolve a specific screen to use for a specific context (future actual case to implement, select a invoice pdf screen linked to a party) without framework modification

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824274 13f79535-47bb-0310-9956-ffa450edef68
2018-02-14 23:15:11 +00:00
Nicolas Malin f1534bd1d6 Improved: Convert CommonPermissionServices.xml mini lang to groovy (OFBIZ-9993)
convert services genericBasePermissionCheck, commonGetAllCrudPermissions and visualThemePermissionCheck from minilang to groovy.
The simple method genericBasePermissionCheck is maintain but indicate as deprecated in log to don't break direct call from other mini-lang script.

Thanks to Dennis Balkir for this patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823397 13f79535-47bb-0310-9956-ffa450edef68
2018-02-06 22:01:52 +00:00
Jacques Le Roux 97a9b690dd Fixed: Security issue in Token Based Authentication
(OFBIZ-10206)

The version I committed so far in OFBIZ-9833 has a small security issue.
See the Jira description for all details

To test I have attached a OFBIZ-10206-external-server-test-example.patch to 
the Jira

This removes the external-server-query property now useless

In  ContextFilter the getHeader (wrapper) now uses an autoLoginCookie to get 
the userLoginId passed in the JWT instead of externalServerUserLogin parameter.
A sourceServerWebappName parameter must be passed from the client request to
allow reading the autoLoginCookie.

This userLoginId is then retrieved on the target server from the JWT in the 
externalServerLoginCheck which is simplified.

In LoginWorker
  getAutoLoginCookieName() has now 2 versions to allow to pass a webappname

  A new autoLogoutFromAllBackendSessions() method has been added but for now 
  commented out. Decommenting it out will be submitted as a patch in OFBIZ-4959.

Thanks: Leila Mekika for reporting the security issue directly to me

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823324 13f79535-47bb-0310-9956-ffa450edef68
2018-02-06 13:17:57 +00:00
Deepak Dixit 7e19de9966 Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818003 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:03:17 +00:00
Deepak Dixit 63258e90f8 Reverted r#1817989, workign fine locally, reverted for now will check and commit again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817998 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 10:42:32 +00:00
Deepak Dixit d1f85a7e5d Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817989 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 09:21:33 +00:00
Jacques Le Roux 90a349b441 Implemented: Token Based Authentication
(OFBIZ-9833)

This works the same way than externalLoginKey but between 2 servers, 
not 2 webapps on the same server. 

The Single Sign On (SSO) is ensured by a JWT token, then all is handled as 
normal by a session on the reached server. The servers may or may not share a 
database but the loginUserIds on the 2 servers must be the same.

OOTB the JWT masterSecretKey is not properly initialised and can not be OOTB.
As we sign on on several servers, so have different sessions, we can't use the 
externalLoginKey way to create the JWT masterSecretKey.
The best way to create the JWT masterSecretKey is to use a temporary way to load 
in a static final key when compiling. This is simple and most secure. 
One of the proposed way is to use sed and uuidgen to modify the masterSecretKey 
value. The magic words here are TEMPORARY and FINAL!

I have not tested this between 2 servers yet, only locally where it works well.
I'll do after this commit between my local instance and the trunk demo.

Thanks: Nicolas for the sed ans uuidgen suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813679 13f79535-47bb-0310-9956-ffa450edef68
2017-10-29 11:02:00 +00:00
Jacques Le Roux 15deb25aae No functional change, fixes wrong ASL2 headers I introduced recently
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812235 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 21:02:52 +00:00
Jacques Le Roux 2382cd9cbd No functional change, these files were missing the ASL2 header
I stop here, please help at https://ci.apache.org/projects/ofbiz/rat-output.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812225 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 17:40:59 +00:00
Nicolas Malin 8f447bdbc2 Fixed: InitTheme.groovy can't work without request (OFBIZ-9798)
When a sendOrderConfirmation runs it calls InitTheme.groovy. But then there is no request and InitTheme fails
The script was improved to escape if the request is empty and try before to resolve the visualThemeId from the context
Tanks Jacques for the catch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811042 13f79535-47bb-0310-9956-ffa450edef68
2017-10-04 07:13:21 +00:00
Nicolas Malin 40fdd2ca73 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step 
#9 Change all set screen and script that call widget.properties values replaced by call to modelTheme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806150 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 10:02:34 +00:00
Nicolas Malin 871ed108a6 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step WARNING these step is separate on many commit break all the UI
#1 Prepare the common screens to retrieve widget.properties, VisualThemeRessources and common screen location from the modelTheme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806137 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 09:31:58 +00:00
Nicolas Malin aec57b51c5 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Third step, move macro ftl libraries and ftl template present on framework common to common theme
At this step, the common-theme is forced like the common component previously.

Main common screens present on CommonScreens.xml, LookupScreens.xml and HelpScreens.xml are moved to common screen with a forced rewrite to common-theme 
Warning this commit is going to follow with a other commit for CommonScreens.xml because LookupScreens.xml and HelpScreens.xml are recreated on common-theme, but to keep the history of CommonScreens.xml it was moved entirely, the second commit restore it with redirect call.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806091 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 21:55:06 +00:00
Deepak Dixit 7bacf44bd4 Improved: Inconsistent String Comparisons, Applied framework groovy patch from jira issue. (OFBIZ-9254)
I found an inconsistency in the code for string comparison statusId.equals("PRUN_COMPLETED") whereas it should be written as "PRUN_COMPLETED".equals(statusId) cause the former can throw NullPointerException if the variable found to be NULL.

Thanks Devanshu Vyas for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1795342 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 17:20:24 +00:00
Jacques Le Roux d8d7ef6b15 Implemented: Make sure the local date time uses the time zone from the
local browser.
(OFBIZ-9264)

If a time zone is already set for a user, this new feature won't override it.
The user still can set it's own time zone, but if it isn't set, 
this avoids the time zone set to the default of the server.

jelroux: the momentjs license is MIT

Thanks: Francis Douet

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1788256 13f79535-47bb-0310-9956-ffa450edef68
2017-03-23 14:37:47 +00:00
Jacques Le Roux 0a5b1646b7 No functional changes
At http://markmail.org/message/ffmyw773p65fndey I wrote:

I'd like to follow the suggestion I made in the last message of the linked 
thread.
In other words, use
http://subversion.apache.org/docs/release-notes/1.8.html#repos-dictated-config
http://blogs.collab.net/subversion/the-road-to-repository-dictated-configuration-day-2-autoprops
Then this problem would be over. No longer need to check from time to time that
concerned files, have svn:eol-style=native property set
This imply that all OFBiz users use svn > 1.7, but we can inform them, et voilà

Then at markmail.org/message/h3q2yvj4db544ro7 I wrote:

Actually, since we get new committers now and then and their are able to create
new files I have a warning every 6 months which says "Check Java 
files, have all svn:eol-style=native" (I totally forgot that because I assume
the machine knows it and warns me ;))
I could extend that to all files (at least the most prominent types), I'll
see...

This does what the last sentence said for Groovy, XML and few new Birt 
Java files.

I'll see if I can implement the svn 1.8 repos-dictated-config ASAP!




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781219 13f79535-47bb-0310-9956-ffa450edef68
2017-02-01 10:58:46 +00:00
Arun Patidar 2bfc816e9b Improved: Removed semicolon from all Groovy files of all components.
(OFBIZ-8652)

Thanks: Rohit Koushal, Jacques Le Roux and Rishi Solanki for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1767764 13f79535-47bb-0310-9956-ffa450edef68
2016-11-02 19:09:13 +00:00
Jacques Le Roux f47ffc755c A request from Pierre Smits for "Move *CertKeystore.groovy* to location according to best practice" https://issues.apache.org/jira/browse/OFBIZ-7892
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1753196 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 10:11:56 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Nicolas Malin 46296d0688 Add new functionnality on auto-complete lookup field do offer the possibility for developper to add condition dates for the search on the lookup screen.
To automatically filter on fromDate thruDate attribute with value now, init a condition map like 
     <set field="conditionDates.default" value="Y"/>

To use specific attribute date with value now
      <set field="conditionDates.fromDateName" value="startDate"/>
      <set field="conditionDates.thruDateName" value="endDate"/>

To use an other value than now
      <set field="conditionDates.filterByDateValue" from-field="invoice.invoiceDate"/>
or
      <set field="conditionDates.filterByDateValue" value="2016-01-01 00:00:00" type="Timestamp"/>

You can also set only low border date 
      <set field="conditionDates.fromDateName" value="fromDate"/>
Or you can also set only high border date 
      <set field="conditionDates.thruDateName" value="endDate"/>

Thanks to Kongrath Suankaewmanee for the proposition follow on issue OFBIZ-7266

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750856 13f79535-47bb-0310-9956-ffa450edef68
2016-06-30 19:38:13 +00:00
Jacques Le Roux 12e9c7f36c No functional change, just removing trailing blanks
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750585 13f79535-47bb-0310-9956-ffa450edef68
2016-06-28 21:11:06 +00:00
Deepak Dixit 4a276ecf91 (OFBIZ-7231) Relocate .groovy files in the framework/common component
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747776 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 18:58:37 +00:00