Commit Graph
27737 Commits
Author SHA1 Message Date
Adrian Crum 762466f309 Fix type-unsafe casts in ContextHelper.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300889 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 10:37:38 +00:00
Adrian Crum 057bd2595e Fixed a static field that was initialized to the wrong class name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300847 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 08:47:00 +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
Hans Bakker 12326f72c1 OFBIZ-4729: defaultValue in EntityUtilProperties.getPropertyValue(String resource, String name, String defaultValue, Delegator delegator) method is forgotten. contributed by Leon
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300815 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 06:15:22 +00:00
Erwan de Ferrieres 86abf0df4d Replacement of iterators with for each loops
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300812 13f79535-47bb-0310-9956-ffa450edef68
2012-03-15 05:30:33 +00:00
David E. Jones d9ff4288bf Fixed bug when there is a view-entity having-condition and no having condition passed to the find method
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300747 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 21:58:37 +00:00
Hans Bakker 6d090b8bcd unwanted change in previous commit
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300497 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 10:30:38 +00:00
Hans Bakker a2c5814eca fix the setup component, move some paypal gateway code back to seed again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300496 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 10:24:05 +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
Adrian Crum 203f5ee73d Improved JavaScriptTest.js file:
1. Fixed reference to application-level entity.
2. Made the behavior of the test function different from the behavior of global code - so the distinctions are clear in the service results.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300469 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 06:40:55 +00:00
Ashish Vijaywargiya eb372bb2ba 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. :-)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300463 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 06:07:52 +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
Jacopo Cappellato 4845c553ac The scripthelper object was created too early when the bindings were not set in the context; this caused the wrong scriptType to be set in the ContextHelper.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300202 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 15:47:50 +00:00
Jacopo Cappellato 2dbf4c0e6e If a ScriptException is thrown while running a script that implements a service then a result map with the error message is automatically returned by the engine: this default error handling mechanism is similar to the one provided by Minilang and allows to delegate to the engine most of the most common error handling logic.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300117 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 13:33:55 +00:00
Sascha Rodekamp dd3c285da8 JCR container definition was placed between the cataline container definition description and th definition itself. That doesn't looked good.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1300014 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 09:00:43 +00:00
Hans Bakker 0372daa663 OFBIZ-4638: make ofbiz run with openjdk7,6. Contribution of Chattree
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299985 13f79535-47bb-0310-9956-ffa450edef68
2012-03-13 06:50:41 +00:00
Adrian Crum fda9bad4cf More JSR-223 work - added a ScriptHelper object to the bindings. Also added a demonstration to the JavaScript test service.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299924 13f79535-47bb-0310-9956-ffa450edef68
2012-03-12 23:20:55 +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
Jacques Le Roux 88c36b6f38 Commenting this whole block, it does not make sense to me and prevent to prevents to show products of a sub-category, just try:
https://demo-trunk.ofbiz.apache.org/ordermgr/control/category?category_id=202/~pcategory=200 

You will get: Category not found for Category ID 202/~pcategory=200!

I kept the same in product component: the screen does not seems to be used anymore

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299171 13f79535-47bb-0310-9956-ffa450edef68
2012-03-10 09:38:58 +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
Adrian Crum 7f15204b03 JSR-223 bug fixes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299121 13f79535-47bb-0310-9956-ffa450edef68
2012-03-10 00:46:54 +00:00
Adrian Crum 484f0e6999 More JSR-223 work - added the ability to protect the bindings, plus some minor code formatting changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1299040 13f79535-47bb-0310-9956-ffa450edef68
2012-03-09 20:41:18 +00:00
Jacques Le Roux fcd911834b A patch from Markus M. May "Typo in CatalogScreens.xml - productCatagories" https://issues.apache.org/jira/browse/OFBIZ-4727
In the CatalogScreens.xml one screen is called productCatagories. Should be spelled productCategories

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298963 13f79535-47bb-0310-9956-ffa450edef68
2012-03-09 18:27:44 +00:00
Ashish Vijaywargiya 1974f30849 Applied patch from jira issue OFBIZ-4722 - The completePack service times out for large orders. Though the code should be looked for possible optimizations, but increasing timeout value is also required.
Thanks Atul!

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298945 13f79535-47bb-0310-9956-ffa450edef68
2012-03-09 17:48:53 +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
Jacopo Cappellato 9986094080 Updated all the controller entries for Groovy event to consistently use the same way to define the location for the script file. Now the path and filename are always in the "path" attribute and the "invoke" attribute is reserved for the execution of a method in the file (I am going to add support for this feature in my next commit); if the invoke element is not specified then the whole script is executed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298904 13f79535-47bb-0310-9956-ffa450edef68
2012-03-09 16:17:12 +00:00
Jacopo Cappellato da59ea40b4 Enhanced Groovy service engine to inject a (configurable) script base class that provides a basic DSL language to the Groovy services; the DSL is still a work in progress but it is already enough to implement several services in Groovy following a programming style very close to Minilang.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298461 13f79535-47bb-0310-9956-ffa450edef68
2012-03-08 16:36:18 +00:00
Sascha Rodekamp deced8bce4 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. Fixed Patch without the HTTPS redirect bug.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298454 13f79535-47bb-0310-9956-ffa450edef68
2012-03-08 16:15:25 +00:00
Jacopo Cappellato 77a06931a3 Minor cleanup to improve readability; no fuctional changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298430 13f79535-47bb-0310-9956-ffa450edef68
2012-03-08 15:30:54 +00:00
Adrian Crum d9f7ea2cd4 Restore service definition that was unintentionally removed in my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298269 13f79535-47bb-0310-9956-ffa450edef68
2012-03-08 04:40:20 +00:00
Hans Bakker aa355b8fb5 Upgrade tomcat to 7.0.26: solve javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found problem when OFBiz started. A contribution of Chattree
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1298261 13f79535-47bb-0310-9956-ffa450edef68
2012-03-08 02:38:40 +00:00
Jacopo Cappellato 1929a81b25 Removed unused and duplicated file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297620 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 18:01:02 +00:00
Adrian Crum 2ba7468eff More JSR-223 work - added a bsh engine so that bsh-specific code can be eliminated. Bsh is now invoked using JSR-223.
The engine comes from http://java.net/projects/scripting. I had to modify the code slightly because the BshScriptEngine class implemented Compilable - but the Compilable methods were not implemented. So I removed implements Compilable. I renamed the jar to signify that the code has been modified.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297478 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 14:06:13 +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
Scott Gray 05bf68608a Demo data bugfix: productTypeId is a required field of Product and records shouldn't be put into the db without supplying a value for it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297416 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 10:54:36 +00:00
Adrian Crum 85b968b883 Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297325 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 02:26:14 +00:00
Adrian Crum 0a0903efb8 More JSR-223 work - added a generic script service engine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297323 13f79535-47bb-0310-9956-ffa450edef68
2012-03-06 02:16:29 +00:00
Adrian Crum dd56fdd30d Fixed Groovy test script. String constants were being returned as org.codehaus.groovy.runtime.GStringImpl instead of java.lang.String.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297214 13f79535-47bb-0310-9956-ffa450edef68
2012-03-05 20:21:19 +00:00
Erwan de Ferrieres 23798e02cc Upgrade to sonar ant task 1.3
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297040 13f79535-47bb-0310-9956-ffa450edef68
2012-03-05 12:59:22 +00:00
Hans Bakker 30341d3d54 reverting 1295029 on request from jacopo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1297007 13f79535-47bb-0310-9956-ffa450edef68
2012-03-05 11:16:35 +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
Adrian Crum 340e6c9d0a Added a helpful startup message to ScriptUtil.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296978 13f79535-47bb-0310-9956-ffa450edef68
2012-03-05 09:43:54 +00:00
Adrian Crum deac392f10 Refactored ScriptUtil.java to use the javax.script package (JSR-223).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296897 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 23:43:27 +00:00
Jacques Le Roux 819cd54f92 A patch from Shi Jinghai "out of range index exception in ShoppingCart.getAdjustmentPromoIndex()" https://issues.apache.org/jira/browse/OFBIZ-4720
This has obviously never been tested. Incrementing a positive or 0 value with only a test on being > 0 can only end with and out of range index exception :/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296875 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 21:13:15 +00:00
Jacques Le Roux c6288f1d46 A patch from Wai "widget <image> tag to use css for resizing" https://issues.apache.org/jira/browse/OFBIZ-4678
Summary: The purpose of this patch is to address the following:
1. Provide a standardized set of image width and height specs for page layout in ofbiz. This gives ofbiz a uniform look throughout as it applies to image display.
2. Preserve the aspect ratio of the image when using these standardized image sizes.
3. One place to make styling modifications (eg. css file).
4. Decouple styling from code (eg. java,ftl,xml,html,jsp,etc).

Regarding including the real image size, the width/height attributes in <img> specifies the boundary of the image when shown on the page. If you need to specify the real size of the image, the server code would have to perform the determination. Afterwards, you can include the actual dimensions of the image in the title attribute of <img>

Details:
Manually specifying the image width and height does help with preserving the layout of a page regardless of the image size to be shown. The challenge with this method is that the image shown on the page in question may be distorted if the aspect ratio of the image differed from that of the width and height attributes of <img>. This basically forces the person uploading the image to be more vigilant about image aspect ratios.
The purpose is to harmonize on the display size of images with a standardized set of width/height constraints in which an image must fit and preserve the aspect ratio of images.

Currently the source files (eg. ftl, xml) either manually specifies the width or height of a displayed image (ie widget <image> and html <img> tag). The problem with specifying only one constraint is that an image can affect the layout of the page if the user uploads an image where the aspect ratio could be large.

Some ftl and xml files specify both the width and the height. The problem with this is that if the aspect ratio of the image in question does not match that of the width and height of the <img> tag, the image would be displayed distorted.

The solution was to create a standardized set of CSS styles that both configure the displayed image size and preserve the image aspect ratio (eg. thumbnail size, medium size and large size). Of course, the developers can further define or modify the styles to suit their need.

By using CSS, one can change the size of displayed images without having to tamper with the ftl and/or xml files. This helps to reduce potential bugs that come with modifying the ftl and xml files. The existing way of doing things is to go through each ftl or xml file in question and manually modify the width and/or height of the <image> and/or <img> tag.

The question about the "border" around images. If you do not wish to have a border around the image, just remove it from the CSS style. It's that easy No need to change anything else. Ie. configuration to the image is done on the CSS style and not on the <image>, <img> tag.

NB: The current patch does not apply to all displayed images. I have only made appropriate modifications to widget <image> and html <img> tags that have either specified the width and/or height. There are numerous <image> and <img> tags spread all over the project that do not specify dimensions. I would have to modify them as I encountered them when I could see where and how they are displayed on the screen. Note that these images would not be affect by this patch.

jleroux: despite my efforts I was not able to check all screens. But I think it's ok

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296782 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 11:54:13 +00:00
Adrian Crum 6cb4c34e22 Minor changes to ScriptUtil.java: add private constructor, make class final, code format changes. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296771 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 09:02:07 +00:00
Jacopo Cappellato f18d49458f First pass in the direction of the implementation of a more flexible mechanism to plugin different scripting technologies and in the same time being able to get rid of a lot of framework related custom code to support them.
In particular these chenges should make it easier to implement JSR-223 (even if I think that we should still treat Groovy in a special way).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296762 13f79535-47bb-0310-9956-ffa450edef68
2012-03-04 07:24:47 +00:00
Jacques Le Roux 21fe6fb550 Fixes https://issues.apache.org/jira/browse/OFBIZ-4719 "Error "org.ofbiz.webapp.event.EventHandlerException: Service invocation error (null)"
Took me a moment to decide to commit this changes. But after many researches and tries I could not find a better solution. 

So simply avoid possible NPE there if a wrong paymentId is entered in createPaymentApplication screen.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1296697 13f79535-47bb-0310-9956-ffa450edef68
2012-03-03 20:46:47 +00:00