Modified: ofbiz/branches/jackrabbit20100709/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/build.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/build.xml (original) +++ ofbiz/branches/jackrabbit20100709/build.xml Wed Aug 3 16:12:58 2011 @@ -75,6 +75,7 @@ under the License. <antcall target="clean-catalina"/> <antcall target="clean-cache"/> <antcall target="clean-tempfiles"/> + <antcall target="clean-downloads"/> <antcall target="clean"/> </target> @@ -679,8 +680,8 @@ under the License. <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/> </java> </target> - <target name="run-tests" depends="download-cobertura, build" - description="Run OFBiz default tests, execute ant run-install before and see results in runtime/logs/test-results/html/all-tests.html. You will need a valid Internet connection to download cobertura"> + <target name="run-tests" depends="build" + description="Run OFBiz default tests, execute ant run-install before and see results in runtime/logs/test-results/html/all-tests.html."> <java jar="ofbiz.jar" fork="true" resultproperty="test.result"> <jvmarg value="${memory.initial.param}"/> <jvmarg value="${memory.max.param}"/> @@ -704,6 +705,9 @@ under the License. </fail> </target> + <target name="run-tests-with-cobertura" depends="download-cobertura, run-tests" + description="Same as run-tests but downloads cobertura and performs code coverage. You will need a valid Internet connection to download cobertura"/> + <target name="_check-separated-tests-already-setup"> <available file="runtime/test-list-build.xml" property="_separated-tests-already-setup"/> </target> @@ -718,7 +722,7 @@ under the License. <env key="LC_ALL" value="C"/> </java> </target> - <target name="run-single-test" depends="download-cobertura, build" + <target name="run-single-test" depends="build" description="Run a single test, syntax eg: ant run-single-test -Dtest.component=service -Dtest.case=service-soap-tests"> <java jar="ofbiz.jar" fork="true" resultproperty="test.result"> <jvmarg value="${memory.initial.param}"/> @@ -742,7 +746,7 @@ under the License. </condition> </fail> </target> - <target name="run-single-test-suite" depends="download-cobertura, build" + <target name="run-single-test-suite" depends="build" description="Run a single test suite, syntax eg: ant run-single-test-suite -Dtest.component=mycomponent -Dtest.suiteName=mytests"> <java jar="ofbiz.jar" fork="true" resultproperty="test.result"> <jvmarg value="${memory.initial.param}"/> @@ -974,6 +978,8 @@ under the License. <mkdir dir="${basedir}/hot-deploy/${component-name}/entitydef"/> <mkdir dir="${basedir}/hot-deploy/${component-name}/lib"/> <mkdir dir="${basedir}/hot-deploy/${component-name}/patches"/> + <mkdir dir="${basedir}/hot-deploy/${component-name}/patches/staging"/> + <mkdir dir="${basedir}/hot-deploy/${component-name}/patches/production"/> <mkdir dir="${basedir}/hot-deploy/${component-name}/script"/> <mkdir dir="${basedir}/hot-deploy/${component-name}/servicedef"/> <mkdir dir="${basedir}/hot-deploy/${component-name}/src"/> Modified: ofbiz/branches/jackrabbit20100709/framework/base/config/log4j.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/config/log4j.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/config/log4j.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/config/log4j.xml Wed Aug 3 16:12:58 2011 @@ -153,6 +153,18 @@ <priority value="warn"/> </category> + <category name="org.apache.coyote"> + <priority value="warn"/> + </category> + + <category name="org.apache.jasper"> + <priority value="warn"/> + </category> + + <category name="org.apache.jk"> + <priority value="warn"/> + </category> + <!-- log4j category --> <category name="org.apache.log4j"> <priority value="warn"/> Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java Wed Aug 3 16:12:58 2011 @@ -19,28 +19,40 @@ package org.ofbiz.base.concurrent; import java.lang.management.ManagementFactory; +import java.util.Collection; import java.util.Iterator; +import java.util.List; import java.util.concurrent.Delayed; import java.util.concurrent.DelayQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; +import javolution.util.FastList; + import org.ofbiz.base.lang.SourceMonitored; +import org.ofbiz.base.util.Debug; @SourceMonitored public final class ExecutionPool { + public static final String module = ExecutionPool.class.getName(); + public static final ScheduledExecutorService GLOBAL_EXECUTOR = getExecutor(null, "ofbiz-config", -1, true); + protected static class ExecutionPoolThreadFactory implements ThreadFactory { + private final ThreadGroup group; private final String namePrefix; private int count = 0; - protected ExecutionPoolThreadFactory(String namePrefix) { + protected ExecutionPoolThreadFactory(ThreadGroup group, String namePrefix) { + this.group = group; this.namePrefix = namePrefix; } public Thread newThread(Runnable r) { - Thread t = new Thread(r); + Thread t = new Thread(group, r); t.setDaemon(true); t.setPriority(Thread.NORM_PRIORITY); t.setName(namePrefix + "-" + count++); @@ -48,23 +60,57 @@ public final class ExecutionPool { } } + @Deprecated public static ThreadFactory createThreadFactory(String namePrefix) { - return new ExecutionPoolThreadFactory(namePrefix); + return createThreadFactory(null, namePrefix); + } + + public static ThreadFactory createThreadFactory(ThreadGroup group, String namePrefix) { + return new ExecutionPoolThreadFactory(group, namePrefix); } + @Deprecated public static ScheduledExecutorService getExecutor(String namePrefix, int threadCount) { - ExecutionPoolThreadFactory threadFactory = new ExecutionPoolThreadFactory(namePrefix); + return getExecutor(null, namePrefix, threadCount, true); + } + + public static ScheduledExecutorService getExecutor(ThreadGroup group, String namePrefix, int threadCount, boolean preStart) { + if (threadCount == 0) { + threadCount = 1; + } else if (threadCount < 0) { + int numCpus = ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors(); + threadCount = Math.abs(threadCount) * numCpus; + } + ThreadFactory threadFactory = createThreadFactory(group, namePrefix); ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(threadCount, threadFactory); - executor.prestartAllCoreThreads(); + if (preStart) { + executor.prestartAllCoreThreads(); + } return executor; } + @Deprecated public static ScheduledExecutorService getNewExactExecutor(String namePrefix) { - return getExecutor(namePrefix, ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors()); + return getExecutor(null, namePrefix, -1, true); } + @Deprecated public static ScheduledExecutorService getNewOptimalExecutor(String namePrefix) { - return getExecutor(namePrefix, ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors() * 2); + return getExecutor(null, namePrefix, -2, true); + } + + public static <F> List<F> getAllFutures(Collection<Future<F>> futureList) { + List<F> result = FastList.newInstance(); + for (Future<F> future: futureList) { + try { + result.add(future.get()); + } catch (ExecutionException e) { + Debug.logError(e, module); + } catch (InterruptedException e) { + Debug.logError(e, module); + } + } + return result; } public static void addPulse(Pulse pulse) { Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/TTLObject.java Wed Aug 3 16:12:58 2011 @@ -33,7 +33,7 @@ import org.ofbiz.base.util.UtilGenerics; @SourceMonitored public abstract class TTLObject<T> implements ObjectWrapper<T> { - private static final ScheduledExecutorService updateExecutor = ExecutionPool.getNewOptimalExecutor("TTLObject(async-update)"); + private static final ScheduledExecutorService updateExecutor = ExecutionPool.getExecutor(new ThreadGroup("TTLObject"), "TTLObject(async-update)", -2, true); private static final <T> T getConfigForClass(ConcurrentHashMap<String, T> config, Class<?> c) { Class<?> ptr = c; @@ -82,6 +82,8 @@ public abstract class TTLObject<T> imple } public enum State { INVALID, REGEN, REGENERATING, GENERATE, GENERATING, GENERATING_INITIAL, VALID, ERROR, ERROR_INITIAL, SET } + // DO NOT REMOVE THIS VARIABLE: to dumb smart editors it looks unused; it's actually only referenced thru the field updater. + private volatile ValueAndState<T> object = new StandardValueAndState<T>(this, null, null, State.INVALID, 0, null, null); @SuppressWarnings("unchecked") private static final AtomicReferenceFieldUpdater<TTLObject<?>, ValueAndState> objectAccessor = UtilGenerics.cast(AtomicReferenceFieldUpdater.newUpdater(TTLObject.class, ValueAndState.class, "object")); private static final AtomicIntegerFieldUpdater<TTLObject<?>> serialAccessor = UtilGenerics.cast(AtomicIntegerFieldUpdater.newUpdater(TTLObject.class, "serial")); Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/DependencyPoolTests.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/DependencyPoolTests.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/DependencyPoolTests.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/DependencyPoolTests.java Wed Aug 3 16:12:58 2011 @@ -36,7 +36,7 @@ public class DependencyPoolTests extends public void testDependencyPool() throws Exception { // always use more threads than cpus, so that the single-cpu case can be tested - ScheduledExecutorService executor = ExecutionPool.getNewOptimalExecutor(getName()); + ScheduledExecutorService executor = ExecutionPool.getExecutor(new ThreadGroup("DependencyPoolTests"), getName(), -2, true); DependencyPool<Integer, TestItem, String> pool = new DependencyPool<Integer, TestItem, String>(executor); int itemSize = 100, depMax = 5, subMax = 3; List<TestItem> items = new ArrayList<TestItem>(itemSize); Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/TTLObjectTest.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/TTLObjectTest.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/TTLObjectTest.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/concurrent/test/TTLObjectTest.java Wed Aug 3 16:12:58 2011 @@ -53,7 +53,7 @@ public abstract class TTLObjectTest exte @Override protected void setUp() throws InterruptedException { - executor = ExecutionPool.getNewExactExecutor(getName()); + executor = ExecutionPool.getExecutor(new ThreadGroup("TTLObjectTest"), getName(), -1, true); } @Override Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/Debug.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/Debug.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/Debug.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/Debug.java Wed Aug 3 16:12:58 2011 @@ -23,6 +23,7 @@ import java.io.PrintStream; import java.io.PrintWriter; import java.text.DateFormat; import java.util.Enumeration; +import java.util.Formatter; import java.util.HashMap; import java.util.Map; @@ -42,6 +43,7 @@ public final class Debug { public static final boolean useLog4J = true; public static final String noModuleModule = "NoModule"; // set to null for previous behavior + public static final Object[] emptyParams = new Object[0]; static DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM); @@ -146,11 +148,25 @@ public final class Debug { } public static void log(int level, Throwable t, String msg, String module) { - log(level, t, msg, module, "org.ofbiz.base.util.Debug"); + log(level, t, msg, module, "org.ofbiz.base.util.Debug", emptyParams); + } + + public static void log(int level, Throwable t, String msg, String module, Object... params) { + log(level, t, msg, module, "org.ofbiz.base.util.Debug", params); } public static void log(int level, Throwable t, String msg, String module, String callingClass) { + log(level, t, msg, module, callingClass, new Object[0]); + } + + public static void log(int level, Throwable t, String msg, String module, String callingClass, Object... params) { if (isOn(level)) { + if (msg != null && params.length > 0) { + StringBuilder sb = new StringBuilder(); + Formatter formatter = new Formatter(sb); + formatter.format(msg, params); + msg = sb.toString(); + } // pack the exception if (packException && t != null) { msg = System.getProperty("line.separator") + ExceptionHelper.packException(msg, t, true); @@ -199,23 +215,35 @@ public final class Debug { // leaving these here public static void log(String msg) { - log(Debug.ALWAYS, null, msg, noModuleModule); + log(Debug.ALWAYS, null, msg, noModuleModule, emptyParams); } + + public static void log(String msg, Object... params) { + log(Debug.ALWAYS, null, msg, noModuleModule, params); + } + public static void log(Throwable t) { - log(Debug.ALWAYS, t, null, noModuleModule); + log(Debug.ALWAYS, t, null, noModuleModule, emptyParams); } public static void log(String msg, String module) { - log(Debug.ALWAYS, null, msg, module); + log(Debug.ALWAYS, null, msg, module, emptyParams); } + public static void log(String msg, String module, Object... params) { + log(Debug.ALWAYS, null, msg, module, params); + } public static void log(Throwable t, String module) { - log(Debug.ALWAYS, t, null, module); + log(Debug.ALWAYS, t, null, module, emptyParams); } public static void log(Throwable t, String msg, String module) { - log(Debug.ALWAYS, t, msg, module); + log(Debug.ALWAYS, t, msg, module, emptyParams); + } + + public static void log(Throwable t, String msg, String module, Object... params) { + log(Debug.ALWAYS, t, msg, module, params); } public static boolean verboseOn() { @@ -223,15 +251,23 @@ public final class Debug { } public static void logVerbose(String msg, String module) { - log(Debug.VERBOSE, null, msg, module); + log(Debug.VERBOSE, null, msg, module, emptyParams); + } + + public static void logVerbose(String msg, String module, Object... params) { + log(Debug.VERBOSE, null, msg, module, params); } public static void logVerbose(Throwable t, String module) { - log(Debug.VERBOSE, t, null, module); + log(Debug.VERBOSE, t, null, module, emptyParams); } public static void logVerbose(Throwable t, String msg, String module) { - log(Debug.VERBOSE, t, msg, module); + log(Debug.VERBOSE, t, msg, module, emptyParams); + } + + public static void logVerbose(Throwable t, String msg, String module, Object... params) { + log(Debug.VERBOSE, t, msg, module, params); } public static boolean timingOn() { @@ -239,15 +275,23 @@ public final class Debug { } public static void logTiming(String msg, String module) { - log(Debug.TIMING, null, msg, module); + log(Debug.TIMING, null, msg, module, emptyParams); + } + + public static void logTiming(String msg, String module, Object... params) { + log(Debug.TIMING, null, msg, module, params); } public static void logTiming(Throwable t, String module) { - log(Debug.TIMING, t, null, module); + log(Debug.TIMING, t, null, module, emptyParams); } public static void logTiming(Throwable t, String msg, String module) { - log(Debug.TIMING, t, msg, module); + log(Debug.TIMING, t, msg, module, emptyParams); + } + + public static void logTiming(Throwable t, String msg, String module, Object... params) { + log(Debug.TIMING, t, msg, module, params); } public static boolean infoOn() { @@ -255,15 +299,23 @@ public final class Debug { } public static void logInfo(String msg, String module) { - log(Debug.INFO, null, msg, module); + log(Debug.INFO, null, msg, module, emptyParams); + } + + public static void logInfo(String msg, String module, Object... params) { + log(Debug.INFO, null, msg, module, params); } public static void logInfo(Throwable t, String module) { - log(Debug.INFO, t, null, module); + log(Debug.INFO, t, null, module, emptyParams); } public static void logInfo(Throwable t, String msg, String module) { - log(Debug.INFO, t, msg, module); + log(Debug.INFO, t, msg, module, emptyParams); + } + + public static void logInfo(Throwable t, String msg, String module, Object... params) { + log(Debug.INFO, t, msg, module, params); } public static boolean importantOn() { @@ -271,15 +323,23 @@ public final class Debug { } public static void logImportant(String msg, String module) { - log(Debug.IMPORTANT, null, msg, module); + log(Debug.IMPORTANT, null, msg, module, emptyParams); + } + + public static void logImportant(String msg, String module, Object... params) { + log(Debug.IMPORTANT, null, msg, module, params); } public static void logImportant(Throwable t, String module) { - log(Debug.IMPORTANT, t, null, module); + log(Debug.IMPORTANT, t, null, module, emptyParams); } public static void logImportant(Throwable t, String msg, String module) { - log(Debug.IMPORTANT, t, msg, module); + log(Debug.IMPORTANT, t, msg, module, emptyParams); + } + + public static void logImportant(Throwable t, String msg, String module, Object... params) { + log(Debug.IMPORTANT, t, msg, module, params); } public static boolean warningOn() { @@ -287,15 +347,23 @@ public final class Debug { } public static void logWarning(String msg, String module) { - log(Debug.WARNING, null, msg, module); + log(Debug.WARNING, null, msg, module, emptyParams); + } + + public static void logWarning(String msg, String module, Object... params) { + log(Debug.WARNING, null, msg, module, params); } public static void logWarning(Throwable t, String module) { - log(Debug.WARNING, t, null, module); + log(Debug.WARNING, t, null, module, emptyParams); } public static void logWarning(Throwable t, String msg, String module) { - log(Debug.WARNING, t, msg, module); + log(Debug.WARNING, t, msg, module, emptyParams); + } + + public static void logWarning(Throwable t, String msg, String module, Object... params) { + log(Debug.WARNING, t, msg, module, params); } public static boolean errorOn() { @@ -303,15 +371,23 @@ public final class Debug { } public static void logError(String msg, String module) { - log(Debug.ERROR, null, msg, module); + log(Debug.ERROR, null, msg, module, emptyParams); + } + + public static void logError(String msg, String module, Object... params) { + log(Debug.ERROR, null, msg, module, params); } public static void logError(Throwable t, String module) { - log(Debug.ERROR, t, null, module); + log(Debug.ERROR, t, null, module, emptyParams); } public static void logError(Throwable t, String msg, String module) { - log(Debug.ERROR, t, msg, module); + log(Debug.ERROR, t, msg, module, emptyParams); + } + + public static void logError(Throwable t, String msg, String module, Object... params) { + log(Debug.ERROR, t, msg, module, params); } public static boolean fatalOn() { @@ -319,27 +395,43 @@ public final class Debug { } public static void logFatal(String msg, String module) { - log(Debug.FATAL, null, msg, module); + log(Debug.FATAL, null, msg, module, emptyParams); + } + + public static void logFatal(String msg, String module, Object... params) { + log(Debug.FATAL, null, msg, module, params); } public static void logFatal(Throwable t, String module) { - log(Debug.FATAL, t, null, module); + log(Debug.FATAL, t, null, module, emptyParams); } public static void logFatal(Throwable t, String msg, String module) { - log(Debug.FATAL, t, msg, module); + log(Debug.FATAL, t, msg, module, emptyParams); + } + + public static void logFatal(Throwable t, String msg, String module, Object... params) { + log(Debug.FATAL, t, msg, module, params); } public static void logNotify(String msg, String module) { - log(Debug.NOTIFY, null, msg, module); + log(Debug.NOTIFY, null, msg, module, emptyParams); + } + + public static void logNotify(String msg, String module, Object... params) { + log(Debug.NOTIFY, null, msg, module, params); } public static void logNotify(Throwable t, String module) { - log(Debug.NOTIFY, t, null, module); + log(Debug.NOTIFY, t, null, module, emptyParams); } public static void logNotify(Throwable t, String msg, String module) { - log(Debug.NOTIFY, t, msg, module); + log(Debug.NOTIFY, t, msg, module, emptyParams); + } + + public static void logNotify(Throwable t, String msg, String module, Object... params) { + log(Debug.NOTIFY, t, msg, module, params); } public static void set(int level, boolean on) { Modified: ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/HttpClient.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/HttpClient.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/HttpClient.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/base/src/org/ofbiz/base/util/HttpClient.java Wed Aug 3 16:12:58 2011 @@ -19,10 +19,10 @@ package org.ofbiz.base.util; import java.io.BufferedReader; -import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; @@ -48,6 +48,7 @@ public class HttpClient { private boolean keepAlive = false; private String contentType = null; + private String streamCharset = null; private String url = null; private String rawStream = null; private String clientCertAlias = null; @@ -182,6 +183,16 @@ public class HttpClient { public String getContentType() { return this.contentType; } + + /** Sets the scream charset */ + public void setStreamCharset(String streamCharset) { + this.streamCharset = streamCharset; + } + + /** Returns the stream charset */ + public String getStreamCharset() { + return this.streamCharset; + } /** Toggle keep-alive setting */ public void setKeepAlive(boolean keepAlive) { @@ -464,11 +475,11 @@ public class HttpClient { } if (method.equalsIgnoreCase("post")) { - DataOutputStream out = new DataOutputStream(con.getOutputStream()); + OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream(), this.streamCharset != null ? this.streamCharset : "UTF-8"); if (Debug.verboseOn() || debug) Debug.log("Opened output stream", module); if (arguments != null) { - out.writeBytes(arguments); + out.write(arguments); if (Debug.verboseOn() || debug) Debug.log("Wrote arguements (parameters) : " + arguments, module); } Modified: ofbiz/branches/jackrabbit20100709/framework/build.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/build.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/build.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/build.xml Wed Aug 3 16:12:58 2011 @@ -33,7 +33,7 @@ under the License. testtools/build.xml, appserver/build.xml,webtools/build.xml,example/build.xml"/> - <filelist id="test-builds" dir="." files="base/build.xml,entity/build.xml"/> + <filelist id="test-builds" dir="." files="base/build.xml,sql/build.xml,entity/build.xml"/> <property name="memory.max.param" value="-Xmx384M"/> Modified: ofbiz/branches/jackrabbit20100709/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Wed Aug 3 16:12:58 2011 @@ -25,6 +25,9 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -60,6 +63,7 @@ import org.apache.catalina.valves.Reques import org.apache.coyote.ProtocolHandler; import org.apache.coyote.http11.Http11Protocol; import org.ofbiz.base.component.ComponentConfig; +import org.ofbiz.base.concurrent.ExecutionPool; import org.ofbiz.base.container.ClassLoaderContainer; import org.ofbiz.base.container.Container; import org.ofbiz.base.container.ContainerConfig; @@ -136,6 +140,7 @@ public class CatalinaContainer implement public static final String J2EE_APP = "OFBiz"; public static final String module = CatalinaContainer.class.getName(); protected static Map<String, String> mimeTypes = new HashMap<String, String>(); + private static final ThreadGroup CATALINA_THREAD_GROUP = new ThreadGroup("CatalinaContainer"); // load the JSSE propertes (set the trust store) static { @@ -202,9 +207,6 @@ public class CatalinaContainer implement createEngine(engineProp); } - // load the web applications - loadComponents(); - // create the connectors List<ContainerConfig.Container.Property> connectorProps = cc.getPropertiesWithValue("connector"); if (UtilValidate.isEmpty(connectorProps)) { @@ -229,6 +231,9 @@ public class CatalinaContainer implement throw new ContainerException(e); } + // load the web applications + loadComponents(); + for (Connector con: embedded.findConnectors()) { ProtocolHandler ph = con.getProtocolHandler(); if (ph instanceof Http11Protocol) { @@ -361,13 +366,15 @@ public class CatalinaContainer implement } protected Host createHost(Engine engine, String hostName) throws ContainerException { + Debug.logInfo("createHost(" + engine + ", " + hostName + ")", module); if (embedded == null) { throw new ContainerException("Cannot create Host without Embedded instance!"); } Host host = embedded.createHost(hostName, CATALINA_HOSTS_HOME); - host.setDeployOnStartup(true); - host.setAutoDeploy(true); + host.setDeployOnStartup(false); + host.setBackgroundProcessorDelay(5); + host.setAutoDeploy(false); host.setRealm(engine.getRealm()); engine.addChild(host); hosts.put(engine.getName() + hostName, host); @@ -499,15 +506,51 @@ public class CatalinaContainer implement return connector; } - protected Context createContext(ComponentConfig.WebappInfo appInfo) throws ContainerException { - // webapp settings - Map<String, String> initParameters = appInfo.getInitParameters(); - List<String> virtualHosts = appInfo.getVirtualHosts(); - Engine engine = engines.get(appInfo.server); + protected Callable<Context> createContext(final ComponentConfig.WebappInfo appInfo) throws ContainerException { + Debug.logInfo("createContext(" + appInfo.name + ")", module); + final Engine engine = engines.get(appInfo.server); if (engine == null) { Debug.logWarning("Server with name [" + appInfo.server + "] not found; not mounting [" + appInfo.name + "]", module); return null; } + List<String> virtualHosts = appInfo.getVirtualHosts(); + final Host host; + if (UtilValidate.isEmpty(virtualHosts)) { + host = hosts.get(engine.getName() + "._DEFAULT"); + } else { + // assume that the first virtual-host will be the default; additional virtual-hosts will be aliases + Iterator<String> vhi = virtualHosts.iterator(); + String hostName = vhi.next(); + + boolean newHost = false; + if (hosts.containsKey(engine.getName() + "." + hostName)) { + host = hosts.get(engine.getName() + "." + hostName); + } else { + host = createHost(engine, hostName); + newHost = true; + } + while (vhi.hasNext()) { + host.addAlias(vhi.next()); + } + + if (newHost) { + hosts.put(engine.getName() + "." + hostName, host); + } + } + + return new Callable<Context>() { + public Context call() throws ContainerException, LifecycleException { + StandardContext context = configureContext(engine, host, appInfo); + context.setParent(host); + context.start(); + return context; + } + }; + } + + private StandardContext configureContext(Engine engine, Host host, ComponentConfig.WebappInfo appInfo) throws ContainerException { + // webapp settings + Map<String, String> initParameters = appInfo.getInitParameters(); // set the root location (make sure we set the paths correctly) String location = appInfo.componentConfig.getRootLocation() + appInfo.location; @@ -539,6 +582,9 @@ public class CatalinaContainer implement // create the web application context StandardContext context = (StandardContext) embedded.createContext(mount, location); + Debug.logInfo("host[" + host + "].addChild(" + context + ")", module); + //context.setDeployOnStartup(false); + //context.setBackgroundProcessorDelay(5); context.setJ2EEApplication(J2EE_APP); context.setJ2EEServer(J2EE_SERVER); context.setLoader(embedded.createLoader(ClassLoaderContainer.getClassLoader())); @@ -589,33 +635,9 @@ public class CatalinaContainer implement context.addParameter(entry.getKey(), entry.getValue()); } - if (UtilValidate.isEmpty(virtualHosts)) { - Host host = hosts.get(engine.getName() + "._DEFAULT"); - context.setRealm(host.getRealm()); - host.addChild(context); - context.getMapper().setDefaultHostName(host.getName()); - } else { - // assume that the first virtual-host will be the default; additional virtual-hosts will be aliases - Iterator<String> vhi = virtualHosts.iterator(); - String hostName = vhi.next(); - - boolean newHost = false; - Host host = hosts.get(engine.getName() + "." + hostName); - if (host == null) { - host = createHost(engine, hostName); - newHost = true; - } - while (vhi.hasNext()) { - host.addAlias(vhi.next()); - } - context.setRealm(host.getRealm()); - host.addChild(context); - context.getMapper().setDefaultHostName(host.getName()); - - if (newHost) { - hosts.put(engine.getName() + "." + hostName, host); - } - } + context.setRealm(host.getRealm()); + host.addChild(context); + context.getMapper().setDefaultHostName(host.getName()); return context; } @@ -628,19 +650,43 @@ public class CatalinaContainer implement // load the applications List<ComponentConfig.WebappInfo> webResourceInfos = ComponentConfig.getAllWebappResourceInfos(); List<String> loadedMounts = FastList.newInstance(); - if (webResourceInfos != null) { + if (webResourceInfos == null) { + return; + } + + ScheduledExecutorService executor = ExecutionPool.getExecutor(CATALINA_THREAD_GROUP, "catalina-startup", -1, true); + try { + List<Future<Context>> futures = FastList.newInstance(); + for (int i = webResourceInfos.size(); i > 0; i--) { ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1); - String mount = appInfo.getContextRoot(); + String engineName = appInfo.server; List<String> virtualHosts = appInfo.getVirtualHosts(); - if (!loadedMounts.contains(mount) || UtilValidate.isNotEmpty(virtualHosts)) { - createContext(appInfo); - loadedMounts.add(mount); + String mount = appInfo.getContextRoot(); + List<String> keys = FastList.newInstance(); + if (UtilValidate.isEmpty(virtualHosts)) { + keys.add(engineName + ":DEFAULT:" + mount); + } else { + for (String virtualHost: virtualHosts) { + keys.add(engineName + ":" + virtualHost + ":" + mount); + } + } + if (!keys.removeAll(loadedMounts)) { + // nothing was removed from the new list of keys; this + // means there are no existing loaded entries that overlap + // with the new set + if (appInfo.location != null) { + futures.add(executor.submit(createContext(appInfo))); + } + loadedMounts.addAll(keys); } else { appInfo.appBarDisplay = false; // disable app bar display on overrided apps Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module); } } + ExecutionPool.getAllFutures(futures); + } finally { + executor.shutdown(); } } Modified: ofbiz/branches/jackrabbit20100709/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/config/CommonUiLabels.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/config/CommonUiLabels.xml Wed Aug 3 16:12:58 2011 @@ -3211,7 +3211,7 @@ <value xml:lang="ar">اÙÙÙ Ø·: Ù Ù-Ø´ Ø´-ع ع ع ع</value> <value xml:lang="en">Format: yyyy-MM-dd</value> <value xml:lang="es">Formato: aaaa-MM-dd (año-mes-dÃa)</value> - <value xml:lang="fr">Format: AAAA-MM-JJ</value> + <value xml:lang="fr">Format: JJ/MM/AAAA</value> <value xml:lang="hi_IN">पà¥à¤°à¤¾à¤°à¥à¤ª: yyyy-MM-dd</value> <value xml:lang="it">Formato: AAAA-MM-gg</value> <value xml:lang="pt">Format: yyyy-MM-dd</value> @@ -3226,7 +3226,7 @@ <value xml:lang="de">Der Inhalt eines Datumfeldes ist fehlerhaft. Das Eingabeformat lautet tt-MM-JJJJ HH:mm:ss</value> <value xml:lang="en">One of the date fields is incorrect, format must be yyyy-MM-dd HH:mm:ss.SSS</value> <value xml:lang="es">Uno de los campos de fecha es incorrecto; el formato debe ser AAA-mm-dd HH:mm:ss</value> - <value xml:lang="fr">La saisie d'un champ de date est incorrecte, le format doit-être AAAA-mm-jj HH:mm:ss</value> + <value xml:lang="fr">La saisie d'un champ de date est incorrecte, le format doit-être JJ/MM/AAAA hh:mm:ss</value> <value xml:lang="hi_IN">à¤à¤ दिनाà¤à¤ à¤à¥à¤·à¥à¤¤à¥à¤° à¤à¤²à¤¤ हà¥, पà¥à¤°à¤¾à¤°à¥à¤ª yyyy-MM-dd HH: mm: ss.SSS हà¥à¤¨à¤¾ à¤à¤¾à¤¹à¤¿à¤</value> <value xml:lang="it">Uno dei campi data non è corretto, il formato deve essere AAAA-mm-gg HH:mm:ss</value> <value xml:lang="nl">Een van de datumvelden in niet juist, het formaat moet JJJJ-mm-dd HH:mm:ss zijn</value> @@ -3244,7 +3244,7 @@ <value xml:lang="de">tt-MM-JJJJ HH:mm:ss</value> <value xml:lang="en">Format: yyyy-MM-dd HH:mm:ss.SSS</value> <value xml:lang="es">AAAA-MM-DD hh:mm:ss</value> - <value xml:lang="fr">Format: AAAA-MM-JJ hh:mm:ss.sss</value> + <value xml:lang="fr">Format: JJ/MM/AAAA hh:mm:ss.sss</value> <value xml:lang="hi_IN">पà¥à¤°à¤¾à¤°à¥à¤ª:yyyy-MM-dd HH: mm: ss.SSS</value> <value xml:lang="it">Formato: YYYY-MM-DD hh:mm:ss</value> <value xml:lang="nl">JJJJ-MM-DD hh:mm:ss</value> @@ -6361,7 +6361,7 @@ </property> <property key="CommonPortalPagesForApplication"> <value xml:lang="en">Portal pages for application</value> - <value xml:lang="fr">Pages portail pour application</value> + <value xml:lang="fr">Pages portail pour l'application</value> <value xml:lang="hi_IN">à¤à¤µà¥à¤¦à¤¨ à¤à¥ लिठपà¥à¤°à¥à¤à¤² पà¥à¤·à¥à¤ </value> <value xml:lang="it">Pagine portale per applicazione</value> <value xml:lang="pt_BR">As páginas do portal para o aplicativo</value> Modified: ofbiz/branches/jackrabbit20100709/framework/common/config/general.properties URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/config/general.properties?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/config/general.properties (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/config/general.properties Wed Aug 3 16:12:58 2011 @@ -26,7 +26,7 @@ currency.uom.id.default=USD # These values override the _NA_ DEFAULT values in user preferences for the GLOBAL_PREFERENCES userPrefGroupTypeId # -- the default organizationPartyId for used in dropdowns and reports ORGANIZATION_PARTY=Company -# ID of the VisualTheme to use if there VISUAL_THEME UserPreference record for the current user supported values: FLAT_GREY and BIZZNESS_TIME and BLUELIGHT +# ID of the VisualTheme to use if there is no VISUAL_THEME UserPreference record for the current user (ie default value) VISUAL_THEME=TOMAHAWK # -- the default decimal format for currency (used in UtilFormatOut.java) @@ -130,3 +130,7 @@ http.localhost=ABQIAAAAtt0d8djaYFkk8N5LJ # -- Y if you want to display the multi-tenant textbox in the login page multitenant=N + +# -- Y if you use a cluster. Most of the time this should not be needed. Setting distributed-cache-clear-enabled="true" is enough +# -- to guarantee no sequenceIds duplicates. See OFBIZ-2353 for details +cluster=N Modified: ofbiz/branches/jackrabbit20100709/framework/common/data/GeoData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/data/GeoData.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/data/GeoData.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/data/GeoData.xml Wed Aug 3 16:12:58 2011 @@ -272,7 +272,7 @@ under the License. <Geo abbreviation="YUG" geoCode="YU" geoId="YUG" geoName="Yugoslavia" geoSecCode="891" geoTypeId="COUNTRY"/> <Geo abbreviation="ZMB" geoCode="ZM" geoId="ZMB" geoName="Zambia" geoSecCode="894" geoTypeId="COUNTRY"/> <Geo abbreviation="ZWE" geoCode="ZW" geoId="ZWE" geoName="Zimbabwe" geoSecCode="716" geoTypeId="COUNTRY"/> - + <Geo abbreviation="EU" geoCode="EU" geoTypeId="GROUP" geoId="EU" geoName="European Union"/> <GeoAssoc geoAssocTypeId="GROUP_MEMBER" geoIdTo="EU" geoId="DEU"/> <GeoAssoc geoAssocTypeId="GROUP_MEMBER" geoIdTo="EU" geoId="AUT"/> @@ -307,4 +307,24 @@ under the License. <GeoAssoc geoAssocTypeId="GROUP_MEMBER" geoIdTo="GBR" geoId="ENGL"/> <GeoAssoc geoAssocTypeId="GROUP_MEMBER" geoIdTo="GBR" geoId="NIRL"/> <GeoAssoc geoAssocTypeId="GROUP_MEMBER" geoIdTo="GBR" geoId="WALS"/> + + <CountryAddressFormat geoId="DEU" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="GBR" stateProvinceGeoAssocTypeId="GROUP_MEMBER" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="ENGL" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="NIRL" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="WALS" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="SCOT" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="USA" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="CAN" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="AUS" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="BGR" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="BRA" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="CHN" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="COL" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="MEX" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="NLD" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="POL" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="IND" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="ITA" stateProvinceGeoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> + <CountryAddressFormat geoId="FRA" stateProvinceGeoAssocTypeId="null" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/> </entity-engine-xml> Modified: ofbiz/branches/jackrabbit20100709/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/entitydef/entitymodel.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/entitydef/entitymodel.xml Wed Aug 3 16:12:58 2011 @@ -164,6 +164,24 @@ under the License. <key-map field-name="countryCode"/> </view-link> </view-entity> + <entity entity-name="CountryAddressFormat" package-name="org.ofbiz.common.geo" default-resource-name="CommonEntityLabels" + title=""> + <field name="geoId" type="id-ne"></field> + <field name="stateProvinceGeoAssocTypeId" type="id"></field> + <field name="requireStateProvinceId" type="id"></field> + <field name="requirePostalCode" type="indicator"></field> + <field name="postalCodeRegex" type="long-varchar"></field> + <field name="hasPostalCodeExt" type="indicator"></field> + <field name="requirePostalCodeExt" type="indicator"></field> + <field name="addressFormat" type="long-varchar"></field> + <prim-key field="geoId"/> + <relation rel-entity-name="Geo" type="one"> + <key-map field-name="geoId"/> + </relation> + <relation type="one" fk-name="CNY_ADR_GEO_TYPE" rel-entity-name="GeoAssocType" > + <key-map field-name="geoAssocTypeId" rel-field-name="stateProvinceGeoAssocTypeId"/> + </relation> + </entity> <entity entity-name="Geo" package-name="org.ofbiz.common.geo" default-resource-name="CommonEntityLabels" title="Geographic Boundary Entity"> <field name="geoId" type="id-ne"></field> @@ -215,6 +233,21 @@ under the License. <key-map field-name="geoIdTo" rel-field-name="geoId"/> </view-link> </view-entity> + <view-entity entity-name="GeoAssocAndGeoToWithState" package-name="org.ofbiz.common.geo"> + <member-entity entity-alias="GA" entity-name="GeoAssoc"/> + <member-entity entity-alias="GTO" entity-name="Geo"/> + <member-entity entity-alias="GWS" entity-name="CountryAddressFormat"/> + <alias-all entity-alias="GTO"/> + <alias entity-alias="GA" name="geoIdFrom" field="geoId"/> + <alias entity-alias="GA" name="geoAssocTypeId"/> + <view-link entity-alias="GA" rel-entity-alias="GTO"> + <key-map field-name="geoIdTo" rel-field-name="geoId"/> + </view-link> + <view-link entity-alias="GA" rel-entity-alias="GWS"> + <key-map field-name="geoId" rel-field-name="geoId"/> + <key-map field-name="geoAssocTypeId" rel-field-name="stateProvinceGeoAssocTypeId"/> + </view-link> + </view-entity> <entity entity-name="GeoAssocType" package-name="org.ofbiz.common.geo" title="Geographic Boundary Association Entity"> <field name="geoAssocTypeId" type="id-ne"></field> Modified: ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/CommonWorkers.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/CommonWorkers.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/CommonWorkers.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/CommonWorkers.java Wed Aug 3 16:12:58 2011 @@ -89,9 +89,8 @@ public class CommonWorkers { public static List<GenericValue> getStateList(Delegator delegator) { List<GenericValue> geoList = FastList.newInstance(); - EntityCondition condition = EntityCondition.makeCondition(EntityOperator.OR, - EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), - EntityCondition.makeCondition("geoTypeId", "TERRITORY"), EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY")); + EntityCondition condition = EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), EntityCondition.makeCondition("geoTypeId", "TERRITORY"), + EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY")); List<String> sortList = UtilMisc.toList("geoName"); try { geoList = delegator.findList("Geo", condition, null, sortList, null, true); @@ -113,14 +112,6 @@ public class CommonWorkers { // Load the system default country country = UtilProperties.getPropertyValue("general.properties", "country.geo.id.default"); } - EntityCondition stateProvinceFindCond = EntityCondition.makeCondition( - EntityCondition.makeCondition("geoIdFrom", country), - EntityCondition.makeCondition("geoAssocTypeId", "REGIONS"), - EntityCondition.makeCondition(EntityOperator.OR, - EntityCondition.makeCondition("geoTypeId", "STATE"), - EntityCondition.makeCondition("geoTypeId", "PROVINCE"), - EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY"), - EntityCondition.makeCondition("geoTypeId", "COUNTY"))); if (UtilValidate.isEmpty(listOrderBy)) { listOrderBy = "geoId"; @@ -129,7 +120,26 @@ public class CommonWorkers { List<GenericValue> geoList = FastList.newInstance(); try { - geoList = delegator.findList("GeoAssocAndGeoTo", stateProvinceFindCond, null, sortList, null, true); + // Check if the country is a country group and get recursively the + // states + EntityCondition stateRegionFindCond = EntityCondition.makeCondition(EntityCondition.makeCondition("geoIdFrom", country), EntityCondition.makeCondition("geoAssocTypeId", "GROUP_MEMBER"), EntityCondition.makeCondition("geoTypeId", "GROUP")); + List<GenericValue> regionList = delegator.findList("GeoAssocAndGeoToWithState", stateRegionFindCond, null, sortList, null, true); + if (regionList.size() == 1) { + for (GenericValue region : regionList) { + List<GenericValue> tmpState = delegator.findList("GeoAssocAndGeoTo", EntityCondition.makeCondition("geoId", region.getString("geoIdFrom")), null, sortList, null, true); + for (GenericValue state : tmpState) { + geoList.addAll(getAssociatedStateList(delegator, state.getString("geoIdFrom"), listOrderBy)); + } + } + } + + // get all related states + EntityCondition stateProvinceFindCond = EntityCondition.makeCondition( + EntityCondition.makeCondition("geoIdFrom", country), + EntityCondition.makeCondition("geoAssocTypeId", "REGIONS"), + EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY"), + EntityCondition.makeCondition("geoTypeId", "COUNTY"))); + geoList.addAll(delegator.findList("GeoAssocAndGeoToWithState", stateProvinceFindCond, null, sortList, null, true)); } catch (GenericEntityException e) { Debug.logError(e, "Cannot lookup Geo", module); } Modified: ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/login/LoginServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/login/LoginServices.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/src/org/ofbiz/common/login/LoginServices.java Wed Aug 3 16:12:58 2011 @@ -888,11 +888,6 @@ public class LoginServices { userLoginToUpdate.set("disabledDateTime", null); } - // if was enabled and we are disabling it, and no disabledDateTime was passed, set it to now - if (wasEnabled && "N".equals(context.get("enabled")) && context.get("disabledDateTime") == null) { - userLoginToUpdate.set("disabledDateTime", UtilDateTime.nowTimestamp()); - } - try { userLoginToUpdate.store(); } catch (GenericEntityException e) { Modified: ofbiz/branches/jackrabbit20100709/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy Wed Aug 3 16:12:58 2011 @@ -19,6 +19,7 @@ import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.entity.util.EntityFindOptions; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityConditionList; @@ -104,7 +105,11 @@ if (orExprs && entityName && displayFiel def entityConditionList = EntityCondition.makeCondition(mainAndConds, EntityOperator.AND); - Integer autocompleterViewSize = Integer.valueOf(context.autocompleterViewSize ?: 10); + String viewSizeStr = context.autocompleterViewSize; + if (viewSizeStr == null) { + viewSizeStr = UtilProperties.getPropertyValue("widget", "widget.autocompleter.defaultViewSize"); + } + Integer autocompleterViewSize = Integer.valueOf(viewSizeStr ?: 10); EntityFindOptions findOptions = new EntityFindOptions(); findOptions.setMaxRows(autocompleterViewSize); findOptions.setDistinct(searchDistinct); Modified: ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl Wed Aug 3 16:12:58 2011 @@ -35,7 +35,9 @@ under the License. <script type="text/javascript"> <#if autocompleteOptions?exists> var autocomp = [ - <#assign displayReturnField = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")> + <#if !displayReturnField?exists> + <#assign displayReturnField = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")> + </#if> <#list autocompleteOptions as autocompleteOption> { <#assign displayString = ""/> Modified: ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/countries.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/countries.ftl?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/countries.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/countries.ftl Wed Aug 3 16:12:58 2011 @@ -18,6 +18,9 @@ under the License. --> <#assign countries = Static["org.ofbiz.common.CommonWorkers"].getCountryList(delegator)> <#list countries as country> - <option value='${country.geoId}'>${country.get("geoName",locale)?default(country.geoId)}</option> + <#if defaultCountryGeoId?exists> + <option value='${country.geoId}' ${(country.geoId==defaultCountryGeoId)?string("selected=\"selected\"","")}>${country.get("geoName",locale)?default(country.geoId)}</option> + <#else> + <option value='${country.geoId}'>${country.get("geoName",locale)?default(country.geoId)}</option> + </#if> </#list> - Modified: ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/htmlTemplate.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/htmlTemplate.ftl?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/htmlTemplate.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/webcommon/includes/htmlTemplate.ftl Wed Aug 3 16:12:58 2011 @@ -46,7 +46,7 @@ under the License. <#else> <#local readonly = false /> </#if> - <@renderLookupField className alert name value size maxlength id event action readonly autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed/> + <@renderLookupField name formName fieldFormName className alert value size maxlength id event action readonly autocomplete descriptionFieldName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed/> </#macro> <#macro nextPrev commonUrl="" ajaxEnabled=false javaScriptEnabled=false paginateStyle="nav-pager" paginateFirstStyle="nav-first" viewIndex=0 highIndex=0 listSize=0 viewSize=1 ajaxFirstUrl="" firstUrl="" paginateFirstLabel="" paginatePreviousStyle="nav-previous" ajaxPreviousUrl="" previousUrl="" paginatePreviousLabel="" pageLabel="" ajaxSelectUrl="" selectUrl="" ajaxSelectSizeUrl="" selectSizeUrl="" commonDisplaying="" paginateNextStyle="nav-next" ajaxNextUrl="" nextUrl="" paginateNextLabel="" paginateLastStyle="nav-last" ajaxLastUrl="" lastUrl="" paginateLastLabel="" paginateViewSizeLabel="" > Modified: ofbiz/branches/jackrabbit20100709/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/common/widget/CommonScreens.xml?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/framework/common/widget/CommonScreens.xml Wed Aug 3 16:12:58 2011 @@ -31,6 +31,9 @@ under the License. </screen> <screen name="countries"> <section> + <actions> + <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/> + </actions> <widgets> <platform-specific><html><html-template location="component://common/webcommon/includes/countries.ftl"/></html></platform-specific> </widgets> @@ -149,53 +152,70 @@ under the License. <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]"/> </actions> <widgets> - <!-- render header --> - <platform-specific><html><html-template location="${headerTemplateLocation}"/></html></platform-specific> - <!-- render appbar or its opening part --> - <section name="Render-Main-Nav"> + <section> <condition> - <not><if-empty field="appbarOpenTemplateLocation"/></not> + <if-empty field="parameters.ajaxUpdateEvent"/> </condition> <widgets> - <platform-specific><html><html-template location="${appbarOpenTemplateLocation}"/></html></platform-specific> + <!-- render header --> + <platform-specific><html><html-template location="${headerTemplateLocation}"/></html></platform-specific> + <!-- render appbar or its opening part --> + <section name="Render-Main-Nav"> + <condition> + <not><if-empty field="appbarOpenTemplateLocation"/></not> + </condition> + <widgets> + <platform-specific><html><html-template location="${appbarOpenTemplateLocation}"/></html></platform-specific> + </widgets> + <fail-widgets> + <platform-specific><html><html-template location="${appbarTemplateLocation}"/></html></platform-specific> + </fail-widgets> + </section> </widgets> - <fail-widgets> - <platform-specific><html><html-template location="${appbarTemplateLocation}"/></html></platform-specific> - </fail-widgets> </section> - - <!-- render appheader: both menu widget style and ftl template style menus are supported--> - <section name="Render-App-Nav"> + + <section> <condition> - <not><if-empty field="userLogin"/></not> + <if-empty field="parameters.ajaxUpdateEvent"/> </condition> <widgets> - <section> - <condition><not><if-empty field="appheaderTemplate"/></not></condition> + <!-- render appheader: both menu widget style and ftl template style menus are supported--> + <section name="Render-App-Nav"> + <condition> + <not><if-empty field="userLogin"/></not> + </condition> <widgets> - <platform-specific><html><html-template location="${appheaderTemplate}"/></html></platform-specific> - </widgets> - <fail-widgets> - <section> - <condition><not><if-empty field="parameters.applicationTitle"/></not></condition> - <widgets><label style="apptitle">${parameters.applicationTitle}</label></widgets> - </section> <section> - <condition><not><if-empty field="applicationMenuLocation"/></not></condition> - <widgets><include-menu name="${applicationMenuName}" location="${applicationMenuLocation}"/></widgets> + <condition><not><if-empty field="appheaderTemplate"/></not></condition> + <widgets> + <platform-specific><html><html-template location="${appheaderTemplate}"/></html></platform-specific> + </widgets> + <fail-widgets> + <section> + <condition><not><if-empty field="parameters.applicationTitle"/></not></condition> + <widgets><label style="apptitle">${parameters.applicationTitle}</label></widgets> + </section> + <section> + <condition><not><if-empty field="applicationMenuLocation"/></not></condition> + <widgets><include-menu name="${applicationMenuName}" location="${applicationMenuLocation}"/></widgets> + </section> + </fail-widgets> </section> + </widgets> + <fail-widgets> + <!-- better to just not include this, the CommonAppBarMenu doesn't show anything by default if the user isn't logged in, causing a funny empty menu: <include-menu name="CommonAppBarMenu" location="component://common/widget/CommonMenus.xml"/> --> </fail-widgets> </section> </widgets> - <fail-widgets> - <!-- better to just not include this, the CommonAppBarMenu doesn't show anything by default if the user isn't logged in, causing a funny empty menu: <include-menu name="CommonAppBarMenu" location="component://common/widget/CommonMenus.xml"/> --> - </fail-widgets> </section> - + <!-- render the appbar closing part --> <section> <condition> - <not><if-empty field="appbarCloseTemplateLocation"/></not> + <and> + <if-empty field="parameters.ajaxUpdateEvent"/> + <not><if-empty field="appbarCloseTemplateLocation"/></not> + </and> </condition> <widgets> <platform-specific><html><html-template location="${appbarCloseTemplateLocation}"/></html></platform-specific> @@ -223,7 +243,7 @@ under the License. <decorator-section-include name="left-column"/> </container> <container id="content-main-section" style="leftonly"> - <container style="no-clear"> + <container style="no-clear" id="centerdiv"> <decorator-section-include name="body"/> </container> </container> @@ -233,17 +253,24 @@ under the License. </container> </container> - <!-- render footer --> - <section name="Render-Footer"> + <section> <condition> - <if-empty field="applicationFooterTemplate"/> + <if-empty field="parameters.ajaxUpdateEvent"/> </condition> <widgets> - <platform-specific><html><html-template location="${footerTemplateLocation}"/></html></platform-specific> + <!-- render footer --> + <section name="Render-Footer"> + <condition> + <if-empty field="applicationFooterTemplate"/> + </condition> + <widgets> + <platform-specific><html><html-template location="${footerTemplateLocation}"/></html></platform-specific> + </widgets> + <fail-widgets> + <platform-specific><html><html-template location="${applicationFooterTemplate}"/></html></platform-specific> + </fail-widgets> + </section> </widgets> - <fail-widgets> - <platform-specific><html><html-template location="${applicationFooterTemplate}"/></html></platform-specific> - </fail-widgets> </section> </widgets> </section> @@ -253,7 +280,7 @@ under the License. <screen name="LookupDecorator"> <section> <condition> - <if-empty field="parameters.ajaxLookup"/> + <not><if-compare operator="equals" value="Y" field="parameters.ajaxLookup"/></not> </condition> <widgets> <section> @@ -321,7 +348,6 @@ under the License. <section> <actions> <set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/> - <property-to-field resource="widget" property="widget.autocompleter.defaultViewSize" field="autocompleterViewSize"/> <script location="component://common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy"/> </actions> <widgets> Propchange: ofbiz/branches/jackrabbit20100709/framework/common/widget/HelpScreens.xml ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Aug 3 16:12:58 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/framework/common/widget/HelpScreens.xml:951708-952957 /ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml:952958-1044489 /ofbiz/branches/multitenant20100310/framework/common/widget/HelpScreens.xml:921280-927264 -/ofbiz/trunk/framework/common/widget/HelpScreens.xml:962442-1128853 +/ofbiz/trunk/framework/common/widget/HelpScreens.xml:962442-1153542 Modified: ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entity-config.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entity-config.xsd?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entity-config.xsd (original) +++ ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entity-config.xsd Wed Aug 3 16:12:58 2011 @@ -392,6 +392,7 @@ under the License. <xs:attribute type="xs:string" name="table-type"/> <xs:attribute type="xs:string" name="character-set"/> <xs:attribute type="xs:string" name="collate"/> + <xs:attribute type="xs:integer" name="max-worker-pool-size" default="0"/> </xs:attributeGroup> <xs:element name="sql-load-path"> <xs:complexType> Modified: ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entitymodel.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entitymodel.xsd?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entitymodel.xsd (original) +++ ofbiz/branches/jackrabbit20100709/framework/entity/dtd/entitymodel.xsd Wed Aug 3 16:12:58 2011 @@ -139,6 +139,13 @@ under the License. </xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="field-set" default="" type="xs:string"> + <xs:annotation> + <xs:documentation> + Any fields that have the same field-set will be selected together in generated queries. + </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:attributeGroup> <xs:element name="validate"> <xs:complexType> @@ -267,6 +274,13 @@ under the License. <xs:attribute name="prefix" type="xs:string"/> <xs:attribute name="group-by" default="false" type="boolean"/> <xs:attribute name="function" type="aggregate-function"/> + <xs:attribute name="field-set" default="" type="xs:string"> + <xs:annotation> + <xs:documentation> + Any fields that have the same field-set will be selected together in generated queries. + </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:attributeGroup> <xs:element name="exclude"> <xs:complexType> @@ -293,6 +307,13 @@ under the License. <xs:attribute name="prim-key" type="xs:string"/> <xs:attribute name="group-by" default="false" type="boolean"/> <xs:attribute name="function" type="aggregate-function"/> + <xs:attribute name="field-set" default="" type="xs:string"> + <xs:annotation> + <xs:documentation> + Any fields that have the same field-set will be selected together in generated queries. + </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:attributeGroup> <xs:element name="complex-alias"> <xs:annotation> Modified: ofbiz/branches/jackrabbit20100709/framework/entity/src/org/ofbiz/entity/Delegator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=1153560&r1=1153559&r2=1153560&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/entity/src/org/ofbiz/entity/Delegator.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/entity/src/org/ofbiz/entity/Delegator.java Wed Aug 3 16:12:58 2011 @@ -1209,4 +1209,23 @@ public interface Delegator { */ public int storeByCondition(String entityName, Map<String, ? extends Object> fieldsToSet, EntityCondition condition, boolean doCacheClear) throws GenericEntityException; + /** + * Enables/Disables the JMS listeners globally + * (this will not effect any dispatchers already running) + * @param enable + */ + public void enableJMS(boolean enable); + + /** + * Get Enabled/Disabled JMS listeners status + * @return boolean true is JMS listeners are enabled + */ + public boolean getEnabledJMS(); + + /** + * Get use of Distributed Cache Clear mechanism status + * @return boolean true if this delegator uses a Distributed Cache Clear mechanism + */ + public boolean useDistributedCacheClear(); + } |
Free forum by Nabble | Edit this page |