Commit Graph
556 Commits
Author SHA1 Message Date
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
Jacopo Cappellato c8323e7ab5 Enhanced Groovy Event Handler to support the execution of a method (as an event) inside of a groovy source file (script class): the method can be specified in the "invoke" attribute.
Similarly to Groovy services, the Groovy Events Handler sets the base script class containing helper methods; these helper methods have been enhanced in order to be used by groovy method executed as services or events in a transparent way.
 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298908 13f79535-47bb-0310-9956-ffa450edef68
2012-03-09 16:34:18 +00:00
Adrian Crum 84bfe84794 Remove HTML from CoreEvents.java error messages.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297461 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 13:09:49 +00:00
Sascha Rodekamp b3e7f4fb32 Revert r1297006 because the encoding makes a problem with redirecting from HTTP to HTTPS
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297443 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 12:24:12 +00:00
Sascha Rodekamp e1b53e3d50 No Url encoding for get parameters (https://issues.apache.org/jira/browse/OFBIZ-2628) using the URLEncoder to encode and render URLs with special Chars. The encoding is always UTF-8
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297006 13f79535-47bb-0310-9956-ffa450edef68
2012-03-05 11:13:29 +00:00
Jacques Le Roux d2ccc5b08f A patch from Michael Brohl "return value of currentDelegatorTenantId.trim() ignored in org.ofbiz.webapp.control.LoginWorker.login()" https://issues.apache.org/jira/browse/OFBIZ-
The return value of currentDelegatorTenantId.trim() is not assigned in org.ofbiz.webapp.control.LoginWorker.login() so trim() has no effect.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1244139 13f79535-47bb-0310-9956-ffa450edef68
2012-02-14 18:08:01 +00:00
Jacques Le Roux bb56ad6049 OFBiz SOAP implementation was not handling
* null values in Map
* BigDecimal
* correctly TimeStamp format (we use xsd:dateTime in ModelService.getTypes())
So CXF was not able to unmarshall a List of Maps with those types in them.

It does not introduce any regressions:
* A new specific SOAP null type is introduced using ("nillable","true") and ("xsi:nil","true) attributes. I had also to set the http://www.w3.org/2001/XMLSchema-instance schema on the null node. Because it was impossible to add it in the envelope header, not a big deal anyway.
* I introduced a 'T' in the TimeStamp format. It's is OK, the deserialisation handles it well (we use xsd:dateTime, see  http://www.w3.org/TR/xmlschema-2/#dateTime)/. We don't handle TimeZone...
* BigDecimal was missing and is now correctly handled. I used 10 decimals and half up rounding (ROUND_HALF_UP) 

Also improves the SOAPEventHandler.sendError() method by passing the serviceName in the message

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1243026 13f79535-47bb-0310-9956-ffa450edef68
2012-02-11 10:50:56 +00:00
Hans Bakker f484f7b9d0 revert r1238954 some local changes were added
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238991 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 08:13:21 +00:00
Hans Bakker 204b9eb01a Wrong commit reverted in r1238991
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1238954 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 07:22:12 +00:00
Adrian Crum e22e2923b3 Fixed a bug where code assumed a GenericValue stored in the client session still exists in the database.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1232398 13f79535-47bb-0310-9956-ffa450edef68
2012-01-17 12:40:34 +00:00
Hans Bakker d9414ad2b3 if an override view is specified in a url and it does not exist, it will not generate a 404 return code but will display an error. this change will do this. example url: http://localhost:8080/ecommerce/control/main/aaa
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1225746 13f79535-47bb-0310-9956-ffa450edef68
2011-12-30 03:22:36 +00:00
Erwan de Ferrieres 69d9ecc741 Removing DojoJSONServiceEventHandler.java as dojo is no more used in OFBiz
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1225597 13f79535-47bb-0310-9956-ffa450edef68
2011-12-29 17:26:29 +00:00
Erwan de Ferrieres afa8f33046 Removing JSON handlers as they are deprecated since December 2009. More info @ http://s.apache.org/6zF
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1225242 13f79535-47bb-0310-9956-ffa450edef68
2011-12-28 17:32:16 +00:00
Hans Bakker fc8b73c10c extend the <@ofbizUrl macro with a new parameter: webSiteId to be able to generate url's for a specific website in generated emails
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1211258 13f79535-47bb-0310-9956-ffa450edef68
2011-12-07 01:21:56 +00:00
Hans Bakker e6cc17bed1 Return a 404 error and not redirect to control main in the ecommerce: https://issues.apache.org/jira/browse/OFBIZ-4390
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1208335 13f79535-47bb-0310-9956-ffa450edef68
2011-11-30 09:06:48 +00:00
Jacques Le Roux 6cc1830b30 A patch from Dimitri Unruh https://issues.apache.org/jira/browse/OFBIZ-4471
"Minor API Extension for WebSiteWorker.java"

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1184997 13f79535-47bb-0310-9956-ffa450edef68
2011-10-17 04:54:52 +00:00
Jacques Le Roux d937f0eb19 Better formatting, no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1177927 13f79535-47bb-0310-9956-ffa450edef68
2011-10-01 06:10:42 +00:00
Sascha Rodekamp 2dd668708f FIX: IO stream objects are not closed (https://issues.apache.org/jira/browse/OFBIZ-4420) A patch from Dimitri Unruh: Some methods are creating an IO stream object without closing it, so it could result on a descriptor leak.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1171393 13f79535-47bb-0310-9956-ffa450edef68
2011-09-16 06:04:21 +00:00
Sascha Rodekamp 16607bb1ac UPDATE: Some improvements with Map iterations (https://issues.apache.org/jira/browse/OFBIZ-4415) A patch from Dimitri Unruh which improves some Map Iterations.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1170525 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 10:52:01 +00:00
Sascha Rodekamp 61f78cca06 PATCH: Exception when entering wrong current password on requirePasswordChange (https://issues.apache.org/jira/browse/OFBIZ-4356). A patch from Dimitri Unruh to fix the wrong current password on a required password change.
Orig Msg:
Here is a step-by-step how the error occures:
1) Request a new password by entering your userlogin
2) Login and you will get to the "requirePasswordChange"-Page (depending on properties)
3) If you enter a wrong current password on this page the exception is thrown.
OFBiz tries to call the service "updatePassword" with a bad userLogin and an Exception is thrown:

org.ofbiz.service.ServiceAuthException: User authorization is required for this service: updatePassword [updatePassword::file:/C:/Workspace/apache_ofbiz/framework/common/servicedef/services.xml::Update a UserLogin ...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1170473 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 08:30:33 +00:00
Jacques Le Roux 30b4566a7c Revert r1165076 (at Adrian's right demand)
Actually I hastily did it bad using static instead of caching. Anyway, I checked there are no real needs to change current code in OFBiz for perf.: one instance is in an exception and the other not called OOTB...

Was:  Closes https://issues.apache.org/jira/browse/OFBIZ-4201

"DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance"

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1165084 13f79535-47bb-0310-9956-ffa450edef68
2011-09-04 19:07:16 +00:00
Jacques Le Roux fd92b0eca1 Closes https://issues.apache.org/jira/browse/OFBIZ-4201
"DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance"

jlr: It's not really cache but a static class constant

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1165076 13f79535-47bb-0310-9956-ffa450edef68
2011-09-04 17:08:54 +00:00
Hans Bakker d29adab86a add http/htttps to the request log message
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1154846 13f79535-47bb-0310-9956-ffa450edef68
2011-08-08 05:46:37 +00:00
Hans Bakker 154d6c534b improved implementation of rev 1150271: only add contenturl prefix to javascript includes which do not start with http. Suggestion from Scott G.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1151030 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 09:06:31 +00:00
Jacques Le Roux e8fa497d56 Fixes the protect view feature introduced at r727508 and broken since r741374. Fortunately the fix was pretty simple
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1140469 13f79535-47bb-0310-9956-ffa450edef68
2011-06-28 07:47:40 +00:00
Adam Heath d3469e847e OPTIMIZE: Replace all request/response with httpRequest/httpResponse.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139883 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:59 +00:00
Adam Heath 72a2daa2e0 OPTIMIZE: Remove use of HttpServletResponseWrapper.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139882 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:53 +00:00
Adam Heath 87c32f3239 INDENT: Remove spaces from lines that are only spaces.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139881 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 18:10:47 +00:00
Hans Bakker 7e07ec7ad5 improve log messages (add domainname)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139703 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 03:11:17 +00:00
Jacques Le Roux b4d7f50233 Closes "Login out on a cluster handled by DeltaManager causes a NPE" https://issues.apache.org/jira/browse/OFBIZ-4289
It works locally but not on clusters. You simply get a NPE.

Problem
    When we logout we cross an issue due to Tomcat sessions persistence.
    Because we set distributable to true, to allow sessions failover,
    and use and DeltaManager for replication.
    Delegator and other main Classes (notably Dispatcher) are not serialized in OFBiz. This is the origin of the problem

Tried solutions
By default DeltaManager save active sessions on disk. It uses a private String variable pathname for that (default to "SESSIONS.ser"). You can set it to null, to avoid session persistence, using a context.xml file in the WEB-INF folder with content like below. But I tried it in webtools app on staging qs001 (only) and it did not work (with distributable set to false). And we have no other means to set it from OFBiz (OOTB).

<Context>
     <Manager className="org.apache.catalina.session.DeltatManager" pathname="">
     </Manager>
</Context>



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1132749 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 20:26:35 +00:00
Jacques Le Roux 7ad5584e0d Revert r948761 I introduced for https://issues.apache.org/jira/browse/OFBIZ-3784.
It introduced an issue when you edit a WebsSte and add a content secure prefix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1131396 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 13:37:52 +00:00
Marco Risaliti 1a16c98e54 Removed some javadoc warning (wrong param/return) into webapp component no functional changes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1126744 13f79535-47bb-0310-9956-ffa450edef68
2011-05-23 20:57:44 +00:00
Marco Risaliti dc95bc30f6 Remove some unused import into ContextFilter
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1125958 13f79535-47bb-0310-9956-ffa450edef68
2011-05-22 13:25:31 +00:00
Marco Risaliti cce5004d88 add a @SuppressWarnings("unchecked") due to Freemarker api
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1125953 13f79535-47bb-0310-9956-ffa450edef68
2011-05-22 13:17:38 +00:00
Sascha Rodekamp 6e8d61e42f after session timeout, ajax popup dialogbox shows ofbiz login screen (https://issues.apache.org/jira/browse/OFBIZ-4256).
If the session is timed out the request handler checks weather it is an ajax request or not (The information comes from the request header if the X-Requested-With contains XMLHttpRequest we haven an ajax request.).
If it is an ajax request it don't return the normal "checkLogin" request, i return a a special ajaxCheckLogin request. This request can point to an site which shows the "Please Login Hint".

Orig Msg:
Take the following page (for example) https://localhost/content/control/findContent

field "Data Resource Id" has an icon beside it that creates an ajax dialog pop up. If the session has already timed out. The dialog box would show the login screen.

I suspect that all pages containing this functionality would exhibit the same symptom.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1102615 13f79535-47bb-0310-9956-ffa450edef68
2011-05-13 08:52:15 +00:00
Hans Bakker c136195d23 Using Amazon EC2 loadbalancer which already decrypted to http, content should still be served https so checking for X-Forwarded-Proto request variable too
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1095859 13f79535-47bb-0310-9956-ffa450edef68
2011-04-22 02:40:37 +00:00
Bruno Busco 50b329b865 Fixed the requiredPasswordChange feature.
This feature was not working since rev.741374 because a quick return from the login service was introduced if the user was already logged in.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1090853 13f79535-47bb-0310-9956-ffa450edef68
2011-04-10 17:51:23 +00:00
Jacques Le Roux 85f8b792d1 Cleans imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1088048 13f79535-47bb-0310-9956-ffa450edef68
2011-04-02 15:28:27 +00:00