Commit Graph
10472 Commits
Author SHA1 Message Date
Adrian Crum 0aa028cbce Simplified some code in OfbizUrlTransform.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535270 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 02:45:47 +00:00
Adrian Crum a8109cf259 Added a helpful method to WebAppUtil.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535268 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 02:44:45 +00:00
Adrian Crum ca37709641 Deprecated a method in RequestHandler.java that should not be used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535261 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 01:48:22 +00:00
Adrian Crum 64177b19d7 Eliminated a logged warning in OfbizUrlBuilder - the request-map might not exist because of the various URL rewriting schemes in OFBiz.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535260 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 01:46:56 +00:00
Adrian Crum d28470d4be Code cleanup and JavaDocs in OfbizUrlTransform.java.
If a web site ID is specified, the transform does not require a HttpServletRequest object - so the transform will work in scheduled services.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535246 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 00:45:51 +00:00
Adrian Crum 69b5d92007 Use parameterized return type in FreeMarkerWorker.unwrap method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535245 13f79535-47bb-0310-9956-ffa450edef68
2013-10-24 00:42:12 +00:00
Adrian Crum f569a189a7 Formatted OfbizUrlTransform.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535164 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 20:40:39 +00:00
Adrian Crum b803a32fc9 Some JavaDoc fixups - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535131 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 19:40:05 +00:00
Adrian Crum 501ca548d5 The RequestHandler.makeLink method uses the new URL generation classes.
I tried to preserve the complicated boolean logic in the replaced block of code, but if I got something wrong, just leave a message on the dev mailing list.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535129 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 19:35:17 +00:00
Adrian Crum 86fc2a1c8e Oops, missed a file in my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535128 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 19:32:47 +00:00
Adrian Crum cf3b8d7025 Added a new classes to simplify OFBiz URL generation and eliminate redundant code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1535126 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 19:29:47 +00:00
Jacques Le Roux 1aebfe082b An enhanced patch from Shi Jinghai <<Change GROOVY_SUPPORT position in .classpath to remove "The method getContextPath() is undefined for the type ServletContext" message in Eclipse.>> https://issues.apache.org/jira/browse/OFBIZ-5369
While editing some java files with "request.getSession().getServletContext().getContextPath()" in Eclipse, an error message appears:
"The method getContextPath() is undefined for the type ServletContext".

This error message can be removed by changing GROOVY_SUPPORT position to be after servlet jar in .classpath

jleroux: I needed to also remove the now useless warning message I put in ControlServlet.java

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534989 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 11:28:31 +00:00
Adrian Crum 56e780b97c Fixed a flaw in the RequestHandler.makeLink method: if any exceptions were thrown while generating the URL, the method proceeded as if nothing was wrong and created an invalid URL. Now the method returns null if any exceptions were thrown - it is up to calling code to decide what to do about it.
This commit also makes use of the new WebSiteProperties class to simplify code and improve performance.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534827 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 22:32:56 +00:00
Adrian Crum 0580243b03 Added a new class to simplify OFBiz URL generation and eliminate redundant code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534826 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 22:27:13 +00:00
Jacques Le Roux 7f246614fd Eclipse keeps telling me I should use HttpServletRequest and says "The method getContextPath() is undefined for the type ServletContext" despite https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getContextPath%28%29
I tried to put a @SuppressWarnings("cast") which is also supported by Eclipse http://stackoverflow.com/questions/1205995/what-is-the-list-of-valid-suppresswarnings-warning-names-in-java
But no ways, I gave up and just put a comment there


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534591 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 10:23:26 +00:00
Adrian Crum af23fe0b35 Refactored ConfigXMLReader.java - added exception handling. The class swallowed exceptions like controller.xml file is missing or invalid - making debugging difficult. This commit introduces a WebAppConfigurationException and it propagates that exception farther up the stack.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534517 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 06:50:05 +00:00
Adrian Crum 09bd8a1428 Reformatted ConfigXMLReader.java - no functional change. This is in preparation for some refactoring.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534488 13f79535-47bb-0310-9956-ffa450edef68
2013-10-22 04:17:55 +00:00
Jacques Le Roux 8b081856e2 Revert r1534276 commented with <<No functional change, fixes this message in Eclipse "The method getContextPath() is undefined for the type ServletContext" which does not prevent to compile though. Compiled with Oracle JVM 1.6.0.45">>
As reported by Adrian in dev ML this commit breaks the embedded Catalina startup.

 java.lang.ClassCastException: org.apache.catalina.core.ApplicationContextFacade cannot be cast to javax.servlet.http.HttpServletRequest

Before Oracle JVM 1.6.0.45 you could not even compile, interesting... I wonder what will happen when we will jump in Java 8, which we will need to do a day or another anyway...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534404 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 22:48:29 +00:00
Adrian Crum 185d02da45 ComponentConfig.java refactor - JavaDocs, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534343 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 19:41:27 +00:00
Adrian Crum cd43d99579 ComponentConfig.java refactor - improved thread-safety for the WebappInfo inner class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534331 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 19:22:21 +00:00
Jacques Le Roux 58e427adae No functional change, fixes this message in Eclipse "The method getContextPath() is undefined for the type ServletContext" which does not prevent to compile though. Compiled with Oracle JVM 1.6.0.45
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534276 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 17:01:03 +00:00
Adrian Crum 3183961741 ComponentConfig.java refactor - thread-safety for the ComponentConfig inner classes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534264 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 16:17:26 +00:00
Adrian Crum 618fcfa6cf ComponentConfig.java refactor - thread-safety for the ComponentConfig instance.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534178 13f79535-47bb-0310-9956-ffa450edef68
2013-10-21 14:23:29 +00:00
Adrian Crum b888457923 ComponentConfig.java refactor second pass - thread-safety for the static collections. Also fixed some flawed logic in the getComponentConfig factory method that caused redundant parsing of the XML file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534012 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 23:57:31 +00:00
Adrian Crum 6d6ccf33ff ComponentConfig.java refactor first pass - eliminate Javolution, small code cleanups.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533960 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 20:22:38 +00:00
Adrian Crum 777d1aefa6 Reformatted ComponentConfig.java - no functional change. This is in preparation for some refactoring.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533946 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 18:42:07 +00:00
Adrian Crum 3f673c7bfe Allow JSONWriter to handle Iterators.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533927 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 16:54:32 +00:00
Jacques Le Roux c386f6ab30 Set different ports for testing in a CI environment (e.g. Jenkins) https://issues.apache.org/jira/browse/OFBIZ-4794
*What's for?*
Finally, OOTB the port offset is interesting in 2 cases:
# To eventually run Sonar on OFBiz sources https://issues.apache.org/jira/browse/INFRA-3590
# To simultaneously run the demos without having to change much things, just one parameter (this will need to have the same commited in R13.07... to be discussed...)

Of course, It can be used for other purposes outside of the ASF context...

*How it's done?*
Basically, I just added a portoffset integer parameter to 3 ant targets (of course this JVM param can also be used in a Java call from command line): start, start-pos, start-both,

The portoffset parameter is set to zero by default in ClassLoaderContainer.java. 
If a value is passed, it's then grabed by Config.java and passed to ClassLoaderContainer.java, where it's set to this value.

 The portoffset is then used to change in one shoot all the default ports values defined (in config or hardcoded), and the admin port value
This is done in following classes:
CatalinaContainer
NamingServiceContainer
ServiceEngine through ServiceLocation
RmiServiceContainer
XMLRPCClientEngine
XmlRpcTests

To avoid hardcoding locations in services definitions, I also created 2 service-locations: main-http and main-soap

*To summarize:* these changes will be used to run "ant start" with a portoffset value which will take care of all ports values, including admin port. For running R12.04 demo as stable we will still need to create a patch for the last time. R13.07 could have a similar patch applied since it's not yet released...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533839 13f79535-47bb-0310-9956-ffa450edef68
2013-10-19 22:07:35 +00:00
Adrian Crum a2c1465efd Fixed a bug in the entity tests - JUnit expected and actual arguments were reversed in the testTransactionUtilRollback test.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533542 13f79535-47bb-0310-9956-ffa450edef68
2013-10-18 16:34:09 +00:00
Adrian Crum 4b75f74431 Fixed some flaws in the JDBC password handling code. Improved JavaDocs in updated code.
The original code would provide a null or empty password (depending on code branching) if no password was configured, so I wasn't able to determine what the desired behavior was. Now an exception is thrown if there is no JDBC password, and datasource connection attempts fail gracefully.

If we want to support 'authenticationless' JDBC connections, then this will need to be looked at again.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533202 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 18:33:49 +00:00
Adrian Crum 047036654c Added some convenience methods to GenericHelperInfo.java that will help simplify client code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533171 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 17:27:51 +00:00
Adrian Crum 4dd795cb50 Code cleanup and small optimization in GenericHelperInfo.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533147 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 16:42:42 +00:00
Jacques Le Roux 3a116293a3 A slightly modified patch from Gareth Carter for "Fixes for some xml/groovy files" https://issues.apache.org/jira/browse/OFBIZ-5349
Validated all xml files and compiled all groovy files and found a few errors. Look at patch for details

jleroux: For webapptests.xml, I prefered to revert it from r959261 (I saw an issue in my xml editor, did not check more)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1532366 13f79535-47bb-0310-9956-ffa450edef68
2013-10-15 14:51:57 +00:00
Adrian Crum 8615235194 Refactored SecurityFactory implementation - make OFBizSecurity an inner private class, plus some code cleanup.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531602 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 22:24:13 +00:00
Adrian Crum 6c45957573 Oops, I forgot to remove a debug statement from my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531578 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 18:58:59 +00:00
Adrian Crum 57816747d7 Refactored SecurityFactory implementation - use Java's ServiceLoader to discover Security implementations, instead of using configuration files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531577 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 18:54:59 +00:00
Adrian Crum 54d2cdba1a Removed unused META-INF folder from security component.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531576 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 18:52:39 +00:00
Jacques Le Roux 0381244267 This completes r1530237 where fieldtypepostnew.xml has been removed.
* Removes useless commented out blocks of <group-maps in <delegators definitions
* Removes now useless localpostnew <datasource definition
* Default the result-fetch-size attribute to 50, and comment about older unsupported versions of jdbc drivers

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531269 13f79535-47bb-0310-9956-ffa450edef68
2013-10-11 12:21:51 +00:00
Adrian Crum 771000f8f0 Allow redefinition of view entities. XML schema change only - implementation exists already.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530976 13f79535-47bb-0310-9956-ffa450edef68
2013-10-10 13:41:45 +00:00
Adrian Crum e41bb48e71 Added XML schema location to UI label file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530825 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 22:59:17 +00:00
Jacques Le Roux 6e93e48ea3 Renames owasp-esapi-full-java-1.4.jar to owasp-esapi-full-java-1.4-patched-by-OFBIZ-3135.jar to reflect the reality
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530678 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 15:31:16 +00:00
Adrian Crum 27f77678ef New feature - add placeholder to form widget. Patch contributed by Sumit Pandit.
https://issues.apache.org/jira/browse/OFBIZ-5341


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530656 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 14:54:40 +00:00
Adrian Crum 53be886210 Some work on the Security component:
1. Some code cleanup and optimization in OFBizSecurity.java. We can use the entity condition cache now that the cache has been fixed.

2. Added @Override annotations to methods that implement the interface.

3. Flagged some Security interface methods as deprecated because they are implementation-specific. If the idea is to have a pluggable Security implementation, then the interface should not reference the entity-engine-based implementation - because a replacement implementation might not use the entity engine.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530471 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 00:50:22 +00:00
Jacques Le Roux c8ce55ecc9 A patch from Anahita Goljahani for Fixed mispelling of "occurred" https://issues.apache.org/jira/browse/OFBIZ-5342
jleroux: this includes a safe change in jquery.validate.js and jquery.validate.min.js

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530341 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 16:35:40 +00:00
Jacques Le Roux e5791f84bf SAP changes for CC date type was missing at r1530235
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530238 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:40:22 +00:00
Jacques Le Roux d7de823054 As suggested on dev ML: merges fieldtypepostgres.xml and fieldtypepostnew.xml and finally removes fieldtypepostnew.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530237 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:39:08 +00:00
Jacques Le Roux 8fcd9e7ad7 Fix a bug reported by Anahita Goljahani on dev ML
At r1529674 I forgot that CC numbers are encoded in DB and CC dates are not 4 (1013) but 7 chars (10/2013)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530235 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:36:07 +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 0a48201604 There is some confusion over maximum email address length due to conflicting RFCs. So, we will accept the longest length specified and let the email servers decide what they will accept.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529838 13f79535-47bb-0310-9956-ffa450edef68
2013-10-07 13:31:55 +00:00
Jacques Le Roux 3ca4b45d8f Same restriction for email addresses than recently done for url. An email address is now definitively no more than 254 characters:
https://en.wikipedia.org/wiki/Email_address#Syntax
http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address#answer-574698
Also a CC number and date are respectively no more than 19 and 4 digits: https://en.wikipedia.org/wiki/ISO/IEC_7813

I decided to not limit the tel numbers (now 60 chars seems plenty enough), maybe someone will even needs to increase in a far future :)

While at it, normalises fieldtypepostnew.xml:
* Removes confusing comment in header
* Restricts most types like in fieldtypepostgres.xml (no needs to have them longer), but keep unlimited (actually 2GB max): comment, description


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529674 13f79535-47bb-0310-9956-ffa450edef68
2013-10-06 20:03:12 +00:00