Commit Graph
43 Commits
Author SHA1 Message Date
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 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
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
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
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
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
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
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
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
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
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
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
David E. Jones 1d6d5edea5 Refactor of service def attribute default-value stuff, fixes the corner case found in OFBIZ-1226; was able to get through test case that previously erred out
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@573140 13f79535-47bb-0310-9956-ffa450edef68
2007-09-06 03:25:29 +00:00
David E. Jones e3feec113a Fixed issue reported by Si in #OFBIZ-1226, and added comment to services.xsd to explain how this is used; BTW, the commit that caused this problem broke rule #1 of first do no harm, that broke existing functionality to add something new that didn't work either
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@573126 13f79535-47bb-0310-9956-ffa450edef68
2007-09-06 00:47:47 +00:00
Andrew Zeneski e63fc39ea4 implemented internal email notifications for service invocations; configure groups for notifications, setup templates, email addresses and assign services to groups (serviceengine.xml) all services belong to the default group, in case you want to monitor all errors, failures and/or success
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@523801 13f79535-47bb-0310-9956-ffa450edef68
2007-03-29 19:12:10 +00:00
David E. Jones 8bc8a3f460 Changed default for the optional attribute on the implements element from false to true, because as is ALL attributes are being set to optional, which I think is not normally what is wanted and I bet there have been a few surprises and frustrations from this
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@514243 13f79535-47bb-0310-9956-ffa450edef68
2007-03-03 21:13:17 +00:00
Jacques Le Roux dad67935f7 A (large) patch from Scott Gray "Update ASL header" (https://issues.apache.org/jira/browse/OFBIZ-637).
I put also some svn:ignore for shark build and lib diretories and assetmaint/build 

I did some by hand lately, too much to remember. They were files with old header but without copyright. A 1st attempt I suppose, will have to check this after this commit.

I add some problems to commit this patch in one piece because it's so huge (specially with Eclipse I had to turn to Tortoise) !

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@499486 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 17:15:54 +00:00
David E. Jones c8ffca7540 Added resource-description attribute to permission-service element, which if not specified will default to the service-name for the main service; this is then passed to the permission service for use in error messages, etc; added example to this in the example component; also updated the header on the ExamplePermissionServices.xml file to make it more consistent
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@494762 13f79535-47bb-0310-9956-ffa450edef68
2007-01-10 08:18:50 +00:00
Andrew Zeneski 45cf1f4ea1 implemented new service based permission; removed the ServiceSecurity interface which this now replacess
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@494718 13f79535-47bb-0310-9956-ffa450edef68
2007-01-10 05:29:30 +00:00
Andrew Zeneski a8968a03cf implemeted:
1) default values for service parameters; when default-value is set, it becomes optional, if no value is passed, the defined default value is used.

2) implemented new interface for custom service security

Changed JobManager finalize() method to shutdown() since calling finalize() is not recommended in java


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@493185 13f79535-47bb-0310-9956-ffa450edef68
2007-01-05 20:42:51 +00:00
Andrew Zeneski ff901cfd8c refactor of service groups; implemented in-line group definition in standard service defs, this removes the need to create two definitions for a service group. Old group definition files are still supported, but need to be updated to change 'service' to 'invoke'. Update to existing group files will follow in next commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@493117 13f79535-47bb-0310-9956-ffa450edef68
2007-01-05 18:26:51 +00:00
Andrew Zeneski 3dcd312c08 changed which implement other services to specifiy if the parameters should be optional or default to the inherited service; rather than always being optional.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@492815 13f79535-47bb-0310-9956-ffa450edef68
2007-01-04 23:45:08 +00:00
Andrew Zeneski 47346f6abf implement field override for eca services; you can now use :
<set field-name="[name of context field]" value="RAW_VALUE"/>
or
<set field-name="[name of context field]" env-name="[another field name]"/>

There are also format options, see the updated XSD for options.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@492770 13f79535-47bb-0310-9956-ffa450edef68
2007-01-04 21:56:22 +00:00
Jacopo Cappellato de1b33bba9 License change from MIT to ASL2.0 for the files of the service component.
Thanks to Scott Gray for the patch (Apache OFBIZ-87).

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@423866 13f79535-47bb-0310-9956-ffa450edef68
2006-07-20 10:19:51 +00:00
David E. Jones 94fe6d1cda Initial OFBiz import from revision 7923 of the old svn.ofbiz.org SVN repository.
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@418498 13f79535-47bb-0310-9956-ffa450edef68
2006-07-01 19:05:20 +00:00