Commit Graph
1143 Commits
Author SHA1 Message Date
Jacopo Cappellato 955ae9eee1 A rather important refactoring of service related code:
* new factory interface for LocalDispatcher objects
* new factory implementation of GenericDispatcher
* new ServiceContainer container that initializes the factory (based on a configuration parameter)
* moved the getLocalDispatcher method out of GenericDispatcher and refactored (in a thread safe way) into ServiceContainer/GenericDispatcherFactory
* ServiceContainer also maintains the cache of LocalDispatchers that was managed by GenericDispatcher
* added code to ServiceContainer to deregister LocalDispatchers at shutdown: this finally fix the current code that was broken because the thread pool maintained by the JobPoller was never closed because of an issue with LocalDispatchers not being deregistered when not started by the ContextFilter
* change all code to call the ServiceContainer rather than GenericContainer to get a LocalDispatcher: now the implementation is no more directly referenced by calling code


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364952 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 09:16:26 +00:00
Jacopo Cappellato e3ad85e49f First pass of a rather relevant cleanup of service related code:
* removed the support for serviceReaderUrls for local services specified in the WEB-INF folder; this feature was not used in years and OFBiz has better mechanisms to define services in components;
* as a consequence of the previous point, a lot of code has been cleaned in the DispatchContext class; in this refactoring, I have fixed some non thread safe code (but this is only a first step and this class needs to be enhanced under this aspect)
* greatly simplified the static instance creator and constructors of ServiceDispatcher and  GenericDispatcher to reflect the changes in DispatchContext but also removed old unused code, simplified code for readability, added some comments to better document it


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364222 13f79535-47bb-0310-9956-ffa450edef68
2012-07-22 07:33:48 +00:00
Jacques Le Roux e3d7c51870 A patch from Leon for "IndexOutOfBoundsException thrown by ServerHitBin.countHit" https://issues.apache.org/jira/browse/OFBIZ-4969
This exception thrown out when initiated a "json" request.

    229156224 [http-bio-0.0.0.0-443-exec-6138] ERROR org.ofbiz.webapp.control.ControlServlet -
    ---- runtime exception report --------------------------------------------------
    Error in request handler:
    Exception: java.lang.IndexOutOfBoundsException
    Message: index: 0
    ---- stack trace ---------------------------------------------------------------
    java.lang.IndexOutOfBoundsException: index: 0
    javolution.util.FastList.add(FastList.java:228)
    org.ofbiz.webapp.stats.ServerHitBin.countHit(ServerHitBin.java:210)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364046 13f79535-47bb-0310-9956-ffa450edef68
2012-07-21 08:43:19 +00:00
Jacopo Cappellato bfbf80afdb Small enhancements to log messages
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363699 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 09:58:08 +00:00
Jacopo Cappellato 7d473126d3 removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363698 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 09:57:13 +00:00
Jacopo Cappellato 59aed51931 Removed some Geronimo/RMI specific code that was causing issues during system shutdown (several attempts to shutdown the RMIContainer); the code had also some tweaks that made the classes less readable; the static containerMap in ContainerLoader was breaking thread safety because the put operations were not atomic with the related add operations of the loadedContainers list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363656 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 05:41:27 +00:00
Jacques Le Roux 188353ef90 Tiny improvement in doc
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361946 13f79535-47bb-0310-9956-ffa450edef68
2012-07-16 09:16:57 +00:00
Adrian Crum 115e96c2f6 New feature - performance metrics. Web application integration.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361727 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 16:11:44 +00:00
Jacopo Cappellato 3aa85842f2 Moved the "birt" component out of framework to specialpurpose; moved all the birt reports from the applications to the birt component itself, where the application webapps are overriden to inject the reports; the end result is the same but since all these birt reports are simply a proof of concepts that cannot be used in production (for example they use hardcoded userlogin for authentication) the birt component should be probably disabled by default (but this will be discussed in the dev list).
Now it will be very easy to extract the birt component (for OFBiz Extras) or to disable it when deploying to production or when interested in sparing some hardware resources. I did some cursory tests but since the work has been challenging and rather complex I would appreciate testing help and also reviews to finds chunks of code that I could have missed and that could be moved out as well.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361130 13f79535-47bb-0310-9956-ffa450edef68
2012-07-13 09:48:32 +00:00
Adrian Crum a17298a06e Removed unused "authz" security code - https://issues.apache.org/jira/browse/OFBIZ-4839.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1360283 13f79535-47bb-0310-9956-ffa450edef68
2012-07-11 16:34:26 +00:00
Jacopo Cappellato d7d999966c Fixed a few wrong attribute names: authorization --> authz
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353686 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 18:00:01 +00:00
Jacopo Cappellato 3756ed0294 Cleaned up some code that was adding the delegator/dispatcher/security/auth objects in the user session rather than the request;
1) removed the request-maps for changeDelegator from components' controller.xml files: they were not used
2) removed CoreEvents.changeDelegator(...): not used (apart from the request-maps removed at #1)
3) removed CoreEvents.changeDispatcher(...): not used
4) cleaned up some code (related to multitenant development): now the objects are set in the request rather than the session

PS: as a consequence this will also fix the issue reported in OFBIZ-4289


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353681 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 17:46:07 +00:00
Jacques Le Roux 2cf0faf52c Closes "Login out on a cluster handled by DeltaManager causes a NPE" https://issues.apache.org/jira/browse/OFBIZ-4289
Removes all changes related to this issue. We will see later if ever it proves to be a real issue.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353135 13f79535-47bb-0310-9956-ffa450edef68
2012-06-23 14:57:18 +00:00
Jacopo Cappellato a9a1bc5f24 When an IOException error happens while communicating with the browser (for example when the user closes the browser window before the page is returned) there is no need to attempt to render the error page; this was causing two error stack traces in the logs every time a connection was aborted; improved logging for this event.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351999 13f79535-47bb-0310-9956-ffa450edef68
2012-06-20 09:00:26 +00:00
Jacopo Cappellato 3688639a2d Fixed typo in comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351955 13f79535-47bb-0310-9956-ffa450edef68
2012-06-20 07:03:21 +00:00
Jacopo Cappellato 3c0b58d8e6 Setting a default value of DeltaManager was causing a side effect: the method setWebContextObjects was always invoked with the persistSerialized argument set to false; this was causing a series of issues (including one reported recently happening when two users login/logout to the same application from the same browser and visit another application).
The commit when this bug was introduced is:
 
 Author: jleroux
 Date: Mon Jun  6 20:26:35 2011
 New Revision: 1132749
 
 and unfortunately the revision was backported to the release branches; the commit may have introduced other issues but I can't review it now.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351778 13f79535-47bb-0310-9956-ffa450edef68
2012-06-19 17:14:14 +00:00
Jacopo Cappellato 0faee1b07e Trivial change to make to avoid to perform a series of useless method calls when the security object is not in the context.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351777 13f79535-47bb-0310-9956-ffa450edef68
2012-06-19 16:53:03 +00:00
Jacques Le Roux 5cf7578d86 Small improvement:
* Adds "cross-redirect"
* Improve doc for 
  ** request-redirect
  ** request-redirect-noparam
  ** url
  


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1347762 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 19:25:30 +00:00
Hans Bakker 8f0c926dbb allow the fop configuration to be different between tenants
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1345849 13f79535-47bb-0310-9956-ffa450edef68
2012-06-04 07:33:24 +00:00
Jacopo Cappellato 2130bc14e8 Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* removed unnecessary synchronization



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343724 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 13:46:49 +00:00
Jacopo Cappellato c4c79f58e8 Improved code that manages the cache:
* removed unnecessary synchronization
* protected the UtilCache object (static field) by making it private and final



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 10:54:16 +00:00
Adam Heath 1aa422773b DEPRECATION: framework: getRelatedOne variants replaced with a getRelatedOne variant that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343478 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 04:11:19 +00:00
Jacopo Cappellato 733bb64592 Improved code that manages the cache:
* removed unnecessary synchronization  
 * protected the UtilCache object (static field) by making it private and final


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343277 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 15:02:39 +00:00
Jacques Le Roux c62a93044a Forget to document the value option for redirect-parameter (not a big deal, pretty obvious, so I don't backport)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1342567 13f79535-47bb-0310-9956-ffa450edef68
2012-05-25 10:47:00 +00:00
Adam Heath 2e5e25fdce OPTIMIZE: In v1340631, the new FreeMarkerImport was placed in the wrong
block of imports, this change fixes it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341052 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 14:39:51 +00:00
Adam Heath a76bc2e73b FIX: In v1340631, a change was introduced in a comment; however, that
referenced a public static variable, it really should have called the
public static method introduced in that same commit.  This happened
because the change wasn't reviewed before it was committed.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341051 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 14:39:44 +00:00
Jacques Le Roux db3f521441 Typo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340944 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 09:21:41 +00:00
Jacques Le Roux ec604e54eb Forgot this trick, thanks to Si Chen cookbook...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340943 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 09:20:58 +00:00
Jacques Le Roux 2c6ad14046 Closes "Improve site-conf.xsd" https://issues.apache.org/jira/browse/OFBIZ-4874
I always wondered why the controller syntax was poorly documented. I tried to improve that...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340774 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 17:36:26 +00:00
Jacopo Cappellato 748dd94841 Removed unused imports.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340637 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 08:21:18 +00:00
Jacopo Cappellato 79ae52492a Refactored code to use the default BeansWrapper defined by FreemarkerWorker; this is important according to comment from one of the Freemarker committers:
"As of creating new BeansWrapper, be sure you create it only once during the application life-cycle and then reuse the same instance, or else it will have to rebuild the class introspection cache again and again."

Thanks to Adam Heath for the comment.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340631 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 07:49:45 +00:00
Adam Heath 9e5f405a4d DEPRECATION: framework: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338403 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 20:59:54 +00:00
Adam Heath 64a9662c25 DEPRECATION: framework: findByPrimaryKey variants replaced with findOne
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-12 21:17:55 +00:00
Ashish Vijaywargiya b256c3d7cc Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337024 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 04:46:26 +00:00
Ashish Vijaywargiya e0971b304c Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-09 05:28:17 +00:00
Adrian Crum 8c35d76140 More work on the Mini-language <simple-method> element: Simplified script caching. This prepares the way to have simple methods cached individually, instead of caching the entire file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334427 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 15:05:40 +00:00
Sascha Rodekamp eb3d943fe5 Trying to cache Visit, but Visit has neverCache-option set (https://issues.apache.org/jira/browse/OFBIZ-4846) A patch from Sebastian Leitner: The Visit-entity has the neverCache-option set, but ServerHitBin is trying to cache it anyway. This should be avoided. I will attach a patch for this (rather trivial change).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1330768 13f79535-47bb-0310-9956-ffa450edef68
2012-04-26 10:56:21 +00:00
Adrian Crum 500a2b4ec4 Added exception handling to the mini-language API. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328222 13f79535-47bb-0310-9956-ffa450edef68
2012-04-20 06:53:41 +00:00
Jacopo Cappellato c04a9b280d Modified Groovy service engine and Groovy event handler to act in the same way of the "Script" (JSR 223) engine and handler: now they can execute the same exact Grrovy services and events.
In order to use these engine and event rather than the one that uses JSR223:
   * for services (service definition): set the engine to "groovy" rather than "script"
   * for events (event element in the controller): set the event type to "groovy" rather than "script"
 The main advantage of using them is that it is possible to attach a debugger to the Groovy methods.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1325253 13f79535-47bb-0310-9956-ffa450edef68
2012-04-12 13:42:57 +00:00
Jacques Le Roux 6f0bac1487 A patch from Deepak Dixit for "Auto-completer request should be async." https://issues.apache.org/jira/browse/OFBIZ-4780
Currently auto-completer uses sync call to prepare auto-completer source (result list).
Due to this user can't perform any other operation on lookup field and user should have to wait until response came.
In general, synchronous requests should never be used because they tend to block the execution of anything else on the page (or even the entire browser UI), which isn't good.
Also ajax-loader image not display on google chrome browser due to sync request.

Need to use async request for auto-completer.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1308751 13f79535-47bb-0310-9956-ffa450edef68
2012-04-03 08:41:06 +00:00
Hans Bakker 2874803c43 property to either show currency decimals when zero or not
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1307303 13f79535-47bb-0310-9956-ffa450edef68
2012-03-30 08:29:28 +00:00
Jacopo Cappellato 4dfcf989fb Implemented new Freemarker transform to set a context variable.
The transform is now used to pass the "postalAddress" to the context of the postal address formatter screen.
This should fix the issue, reported by Chatree, that prevented to render the localized address when the screen was rendered from the send mail service (no request object was available).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1307288 13f79535-47bb-0310-9956-ffa450edef68
2012-03-30 07:28:39 +00:00
Jacques Le Roux 9fc15eeb1b A patch from Kiran Gawde "StringIndexOutOfBoundsException in OfbizContentTransform" https://issues.apache.org/jira/browse/OFBIZ-4464
Fixes this bug:
---- exception report ----------------------------------------------------------
Error in request handler:
Exception: org.ofbiz.widget.screen.ScreenRenderException
Message: Error rendering screen component://ecommerce/widget/CommonScreens.xml#main-decorator: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 (String index out of range: 0)
---- cause ---------------------------------------------------------------------
Exception: java.lang.StringIndexOutOfBoundsException
Message: String index out of range: 0
---- stack trace ---------------------------------------------------------------
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
java.lang.String.charAt(String.java:686)
org.ofbiz.webapp.ftl.OfbizContentTransform$1.close(OfbizContentTransform.java:97)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1304200 13f79535-47bb-0310-9956-ffa450edef68
2012-03-23 06:26:22 +00:00
Hans Bakker 69d3195fc1 replace UtilProperties with EntityUtilProperties and pass delegator to checkSecureParameter
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1304197 13f79535-47bb-0310-9956-ffa450edef68
2012-03-23 06:14:02 +00:00
Hans Bakker 25c5483493 make the currencyRounding a property variable, using the value which is hardcoded now. contribution of 'Tor'
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300817 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 06:31:32 +00:00
Jacopo Cappellato 66db37dc11 Services and events methods are defined with a methods without arguments (or a script): as usual the input fields are available in the context (Bindings)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300473 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 07:40:31 +00:00
Jacopo Cappellato 66656fb4ac Now the Script Event Handler properly set the success/error messages returned by the events as request attributes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300268 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 18:23:09 +00:00
Adrian Crum 1c162eb3d7 JSR-223 bug fix, added String constants for commonly used binding keys.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299636 13f79535-47bb-0310-9956-ffa450edef68
2012-03-12 11:41:03 +00:00
Adrian Crum e3c333acdb Small fix for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299134 13f79535-47bb-0310-9956-ffa450edef68
2012-03-10 01:42:27 +00:00
Adrian Crum 7f741eb700 Added a JSR-223 event handler.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299131 13f79535-47bb-0310-9956-ffa450edef68
2012-03-10 01:38:15 +00:00