Commit Graph
68 Commits
Author SHA1 Message Date
Jacques Le Roux a7121bff23 Improved: Improves service-eca.xsd documentation (OFBIZ-9994)
Fixes some issues
2020-08-30 18:56:52 +02:00
Jacques Le Roux d534f78c6a Improved: Improves service-eca.xsd documentation (OFBIZ-9994)
Also with formatting
2020-08-30 11:09:10 +02:00
girishvasmatkar fdb67aee72 WIP: Implemented: Added support for defining nested attributes.(OFBIZ-11902) (#231)
* Added nested attr definition and code to handle nested attributes

* Checkstyle error fix

* Fixed indentation and tabs issues
2020-08-22 23:50:12 +05:30
Jacques Le Roux 3155906740 Improved: small typo in trunk (OFBIZ-11952)
I also replaced tabs by spaces in applications/product/servicedef/services.xml

Thanks: Alex Bodnaru
2020-08-13 09:16:20 +02:00
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 2cbcb3ae5b Improved: Refactoring permission model call
(OFBIZ-7113)

As mentioned by Mathieu on dev ML uses rather a boolean than a token for 
"require-new-transaction" and "return-error-on-failure"
Also some formatting while at it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866589 13f79535-47bb-0310-9956-ffa450edef68
2019-09-08 07:48:40 +00:00
Nicolas Malin f4aab777a5 Improved: Refactoring permission model call
(OFBIZ-7113)
With the problem to have a permission service not on the same transaction that the related service [1]

I realized the following improvement to
 * unified call evalPermission
 * move all related field for permission service on ModelService to ModelPermission
 * Remove deprecated code
 * add labelized error message  
 * call as same transaction the permission service by defautl with possibility to overide this rule 
 * add new attributes on permission model: require-new-transaction and return-error-on-failure

Thanks to Jacques Leroux for the review


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866137 13f79535-47bb-0310-9956-ffa450edef68
2019-08-30 08:47:48 +00:00
Jacques Le Roux 2dadaacac8 Fixed: Services allow arbitrary HTML for parameters with allow-html set to "safe"
(OFBIZ-5254)

This was reopened after discussion at 
https://markmail.org/message/jnaitmwahjcjmdn5

This is a new solution which follows the work done with OFBIZ-6669 and OFBIZ-10187
Roughly said, it uses org.owasp.html.PolicyFactory and org.owasp.html.Sanitizers

Thanks: Christoph Neuroth for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859877 13f79535-47bb-0310-9956-ffa450edef68
2019-05-24 13:47:08 +00:00
Jacques Le Roux b0478d13f0 Improved: XML schemas should use predefined boolean type
(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
2018-11-16 16:38:24 +00:00
Nicolas Malin dfbda6210a Improved: Async persist service on error no restart by default
(OFBIZ-10557)
Related to the discussion on dev [1] I turn off by default the indefinitely restart when a service async failed.
When a service run by async with persistence (eg: dispatcher.runAsync('returnErrorService', context, true)), the default value set on jobsandbox.maxRetry is now 0 instead of -1 before.

If you want run indefinitely an async service while isn't a success, set on your service definition max-retry='-1'.

[1] https://s.apache.org/EBhf

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1840526 13f79535-47bb-0310-9956-ffa450edef68
2018-09-11 07:42:19 +00:00
Deepak Dixit eea53baef0 Fixed: Moved enabled attribute definition to its correct place, it was added in wrong attribute group
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813219 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 18:33:04 +00:00
Deepak Dixit 651a17d213 Improved: Added ability to disable seca rule (OFBIZ-9826)
We have enabled flag in ServiceEcaRule class, if its set false then seca rule will not be executed.
But there is not way to disable seca.

We can add enabled flag in SECA definition to disable the existing seca rule.
Here is the proposal:
- Add new attribute on seca tag named enabled
- Default value will be true for this.
- If user want to disable existing OOTB seca rule, then user can define same rule in custom component and set the enabled=false
Need to do some changes in code to honor the enabled attribute while loading seca rule.

Also as per current flow if same seca rule is define more then once, system will execute all the rule, ideally it should not execute same rule (same rule, condition and action) if its defined more than one.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812394 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 11:52:14 +00:00
Deepak Dixit 482cc1f979 Fixed: Updated deprecated element type set mixed as true in services.xsd as we are using it in mixed mode. Also moved deprecated sequence after namespace.Found this issue while reading log, this will fix those warning.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806206 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 18:13:06 +00:00
Nicolas Malin 703148c27e Implemented: Manage deprecated service in the ModelService (OFBIZ-9558)
When you want to remove a service we add a new xml element <deprecated/> that you can put on the service definition like this

<service name="oldService" ...>
    <deprecated use-instead="newService" since="theReleaseXXX">The reason to move it as deprecated</deprecated>
    <implements service="newService"/>
</service>

A deprecated service generate a warning log each time it is called
When you navigate on webtools a deprecated service is strike in the service list and display deprecated reason on the service definition detail page.

Thanks to Scott, Deepak, Taher and Jacques for sharing on this subject

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804786 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 12:41:22 +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
Deepak Dixit 96b5ff4f52 (OFBIZ-7765) Removed testBsh service references from code. Thanks Rishi Solanki for pointing out.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752140 13f79535-47bb-0310-9956-ffa450edef68
2016-07-11 10:22:32 +00:00
Jacopo Cappellato 1247c39d15 Improved the documentation about the purpose and behavior of the "auth" and "in-validate" secas events.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1735441 13f79535-47bb-0310-9956-ffa450edef68
2016-03-17 15:00:47 +00:00
Jacques Le Roux 3a047fadda Mark this feature as deprecated, due to OFBIZ-6228
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1670999 13f79535-47bb-0310-9956-ffa450edef68
2015-04-03 06:43:26 +00:00
Jacques Le Roux 7adfe90d71 Fixes <<Services allow arbitrary HTML for parameters with allow-html set to "safe">> https://issues.apache.org/jira/browse/OFBIZ-5254
After r751990, <<allow-html="any">> and <<allow-html="safe">> are the same: they do nothing! The only difference is the warning message from the OWASP Antisamy IntrusionDetector, which is both, as Christoph noted "giving you a false sense of security" or as I wrote "disturbing, wrong and useless". So there are no longer any reasons for differencing "safe" and "any".

This
* Deprecates "safe" (making it clear in the XSD documentation), keeping only "none" and "any". This is for backward compatibility, else we could completely remove the misleading "safe". Note that "none" is the default.
* Replaces in services definition all allow-html="safe" by allow-html="any"
* Remove from ModelService.java (near line 587) the code which throws the OWASP Antisamy IntrusionDetector message in log

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1536324 13f79535-47bb-0310-9956-ffa450edef68
2013-10-28 12:12:43 +00:00
Jacques Le Roux a0c34848cf Makes the documentation more legible
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529933 13f79535-47bb-0310-9956-ffa450edef68
2013-10-07 15:07:25 +00:00
Adrian Crum 32f9d30ca7 A final pass through ServiceConfigUtil.java - moved some of the convenience method code to the call sites. The convenience methods don't add much now that the API is easier to use. Reorganized methods and added JavaDocs.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490116 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 03:29:50 +00:00
Adrian Crum 38a3319174 Bug fix for NotificationGroup.java - if the <notification-group> element name attribute is being used as the key to a Map, then we should make it required.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1488646 13f79535-47bb-0310-9956-ffa450edef68
2013-06-02 06:41:54 +00:00
Adrian Crum 59633013b4 Clean up and format service-config.xsd so it is easier to read and understand.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1488645 13f79535-47bb-0310-9956-ffa450edef68
2013-06-02 06:37:11 +00:00
Adam Heath 952e43cdb5 FEATURE: When calling services from an incoming http requests, allow for a different request and session attribute name to be specified.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482508 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:09:31 +00:00
Jacques Le Roux b14d7c1ab9 Those are not needed and even counter productive now, see discussion on dev ML http://markmail.org/message/mqe6c6qm2rofa4gg
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1426605 13f79535-47bb-0310-9956-ffa450edef68
2012-12-28 18:32:23 +00:00
Adrian Crum 6fd584e207 Added Job Manager/Job Poller documentation to the service-config.xsd file. Hopefully this will help everyone understand the Job Scheduler behavior and what the settings do.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1372088 13f79535-47bb-0310-9956-ffa450edef68
2012-08-12 13:17:17 +00:00
Adrian Crum 3627d8bbc8 More work on the Job Scheduler:
1. Gave the job queue a fixed size so the job poller can't create an out-of-memory condition.
2. Changed min/max thread settings to more conservative values.
3. Changed JobSandbox polling code to accept a limit argument to control the number of records retrieved. Also used ELI to limit memory use.
4. Improved JobManager reloadCrashedJobs method to recover queued jobs that were being missed previously.

At this stage the Job Scheduler has been fixed to not crash/saturate the server, but it can still lose jobs. That will be fixed in the next commit.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1370437 13f79535-47bb-0310-9956-ffa450edef68
2012-08-07 19:11:06 +00:00
Jacopo Cappellato bf7606987c changed some comments/docs to refer to LocalDispatcher instead of ServiceDispatcher
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364980 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 11:25:08 +00:00
Jacopo Cappellato 8693969ac4 Refactored the very old code in the org.ofbiz.service.job package to leverage the Executor framework of java.util.concurrent rather than relying on ad-hoc synchronization and thread management: the new code is simpler, smaller and it is now easier to review and change the execution policy; two attributes of service-config.xsd have been deprecated as they are not used in the new version ("jobs" and "wait-millis").
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362422 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 09:20:42 +00:00
Adrian Crum 43a9cbef12 New feature - performance metrics. Service engine integration.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361725 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 16:10:50 +00:00
Jacques Le Roux 5e5f0e27a5 This introduces a mean to hide a service result in log (when the service is longer than 50 ms and Debug.timingOn() or > 200 ms and Debug.infoOn(), see ServiceDispatcher.java, just above line 600)
A hideResultInLog service attribute is added. If set to true the service result will be hidden from possible exposition in ServiceDispatcher.runSync() 
This is convenient when used for sending a password to an user (the password must be legible in the sent mail). 
I'm sure a lot of you would want to have no logs at all in production. But by experience I know that we need to log info in logs even in production. Especially when the system is quickly moving ahead...
So this is a sure mean to hide any password in logs, being current or backuped somewhere on the servers disks...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328122 13f79535-47bb-0310-9956-ffa450edef68
2012-04-19 21:41:39 +00:00
Scott Gray e00b1cf382 Add a description element for service attributes, should make documenting some services a little easier. Still need to display it in webtools somewhere.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981018 13f79535-47bb-0310-9956-ffa450edef68
2010-07-31 08:26:42 +00:00
Erwan de Ferrieres e710059ab7 OFBIZ-3798 Add xml-rpc engine on serviceengine - A new patch from Nicolas Malin (https://issues.apache.org/jira/browse/OFBIZ-3798) - Also updating xml-rpc libs from 3.0.1 to 3.1.2
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959261 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 10:52:12 +00:00
Erwan de Ferrieres 0803e3c6f1 Reverting previous commit as it wasn't fully reviewed and was producing errors. Sorry guys...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959076 13f79535-47bb-0310-9956-ffa450edef68
2010-06-29 19:19:55 +00:00
Erwan de Ferrieres ad183f5cea OFBIZ-3798 Add xml-rpc engine on serviceengine - (https://issues.apache.org/jira/browse/OFBIZ-3798)
A patch from Nicolas Malin - adding a generic service to call xml-rpc server. The goal is to have a technical interface to make calls directly from mini-lang.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959071 13f79535-47bb-0310-9956-ffa450edef68
2010-06-29 18:43:56 +00:00
Vikas Mayur ff81b42928 Extending the <required-permissions> tag in service model such that it can contain one or more occurrence of <permission-service> tag.
This is helpful when there is a need to check more then one permission using a permission service.

Applied framework only part from my patch from jira issue OFBIZ-3632 (https://issues.apache.org/jira/browse/OFBIZ-3632)



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@930536 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 16:07:18 +00:00
Scott Gray 6109808c8a Tabs to spaces
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@924378 13f79535-47bb-0310-9956-ffa450edef68
2010-03-17 17:28:01 +00:00
David E. Jones d4aa04aee8 Added some documentation about the service definition transaction related attributes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@797962 13f79535-47bb-0310-9956-ffa450edef68
2009-07-26 17:45:24 +00:00
Scott Gray 4acd7cc4f9 Corrected simple method documentation regarding the transaction timeout UOM, added the same to the services xsd and fixed a couple of service defs that appeared
to be specifying milliseconds rather than seconds.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@769205 13f79535-47bb-0310-9956-ffa450edef68
2009-04-27 23:53:40 +00:00
Jacques Le Roux b9c3ddef08 2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty)
Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg)

Of course this effort to remove trailing spaces has no functional implications.

Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135
In the meantime I did some refactoring also in *.java and *.groovy files :
){ => ) {
if( => if (
while( => while (
}else => } else
else{ => else {
switch( => switch (
try{ => try {
}catch => } catch
catch( => catch (
}finally{ => } finally {

So these changes are also in this commit, should not be a problem anyway.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 10:54:51 +00:00
David E. Jones 09825430f1 Added new allow-html tag on the attribute, auto-attribute, and override elements; has 3 options: none, safe, and any; the comments in the XSD file describe what each of these do; the important thing to know is that none is the default meaning no html is allowed; if html is needed use safe and look at the antisamy-esapi.xml file to see policy details; in extreme trust cases use any where any html is allowed; note that many services need updating which should allow at least safe html, and it may take some time to discover all of those and get them handled; please send in issues and requests for service attributes that should allow safe html
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@742352 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 09:34:34 +00:00
David E. Jones 9075027988 Some cleanups, no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@742238 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 03:16:02 +00:00
Adam Heath 2617681b51 Remove svn:executable on a bunch of stuff.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@684389 13f79535-47bb-0310-9956-ffa450edef68
2008-08-10 00:53:43 +00:00
Scott Gray 1eaf3ccd19 Moved a couple of misplaced semaphore attributes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@649478 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 12:09:09 +00:00
David E. Jones 17d28a89cf Applied patch from Adrian Crum in Jira #OFBIZ-1245, fixes some inconsistencies in previous handling of failure and error messages, a handling of failure and error messages and cleanes up some things related to the recent result-to-result changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@591241 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 06:42:53 +00:00
Jacques Le Roux ae76370a04 Replace all www.ofbiz.org by ofbiz.apache.org (mostly links to dtds). Note that there are 2 void links :
http://ofbiz.apache.org/service/
http://ofbiz.apache.org/cgi-bin/http_test.pl

Those links were useless before also

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@586802 13f79535-47bb-0310-9956-ffa450edef68
2007-10-20 21:17:45 +00:00
David E. Jones c5ff0fc828 Added result-to-result feature for seca rules, based on patch from Adrian Crum but changed to be more consistent with context-to-result, AND to only copy over values that are valid for the service that triggered the eca; Jira #OFBIZ-1237
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@579424 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 01:32:37 +00:00
Andrew Zeneski 1ef6a9f731 changed where semaphores are released (in finally block to make sure it is run even in the case of an exception) implemented per-service configurable settings for wait/sleep (sleep in milliseconds; wait in seconds) semaphore-wait-seconds="300" (default) is 5 minutes. The max time a service will wait before failing to run.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@577141 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 04:04:08 +00:00
David E. Jones 4c02885546 Added global-commit-post-run event that gets a context after the service and eca rules run
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@576815 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 10:04:50 +00:00
Andrew Zeneski d4c785dad4 implemented ServiceSemaphore; built in locking to prevent services (when defined) from running at the same time; uses database record to work with a cluser of application servers. Three modes are available:
None - Does no locking
Wait - Waits for the previous service to complete (currently up to 5 minutes)
Fail - Fails when the same service is already running

use the semaphore="none|wait|fail" in the service definition (none is the default when the attribute is not defined)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@575074 13f79535-47bb-0310-9956-ffa450edef68
2007-09-12 20:58:44 +00:00