You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/03 07:54:24 UTC
svn commit: r1636282 [13/20] - in
/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./
applications/content/config/ applications/content/data/
applications/humanres/src/org/ofbiz/humanres/
applications/humanres/webapp/humanres/WEB-INF/ applica...
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java Mon Nov 3 06:54:16 2014
@@ -19,8 +19,10 @@
package org.ofbiz.service.mail;
import java.io.IOException;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.MessagingException;
@@ -28,15 +30,12 @@ import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.internet.MimeMessage;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.entity.GenericValue;
-
import org.w3c.dom.Element;
@SuppressWarnings("serial")
@@ -250,7 +249,7 @@ public class ServiceMcaCondition impleme
if (c instanceof String) {
return UtilMisc.toList((String) c);
} else if (c instanceof Multipart) {
- List<String> textContent = FastList.newInstance();
+ List<String> textContent = new LinkedList<String>();
int count = ((Multipart) c).getCount();
for (int i = 0; i < count; i++) {
BodyPart bp = ((Multipart) c).getBodyPart(i);
@@ -258,7 +257,7 @@ public class ServiceMcaCondition impleme
}
return textContent;
} else {
- return FastList.newInstance();
+ return new LinkedList<String>();
}
}
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java Mon Nov 3 06:54:16 2014
@@ -18,15 +18,13 @@
*******************************************************************************/
package org.ofbiz.service.rmi;
+import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
-import java.net.MalformedURLException;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
-import org.ofbiz.service.rmi.RemoteDispatcher;
import org.ofbiz.service.GenericServiceException;
/** An example of how to remotely access the Service Engine's RemoteDispatcher.
@@ -67,7 +65,7 @@ public class ExampleRemoteClient {
}
public Map<String, Object> runTestService() throws RemoteException, GenericServiceException {
- Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> context = new HashMap<String, Object>();
context.put("message", "Remote Service Test");
return rd.runSync("testScv", context);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java Mon Nov 3 06:54:16 2014
@@ -29,6 +29,7 @@ import org.ofbiz.entity.GenericEntityExc
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.transaction.GenericTransactionException;
import org.ofbiz.entity.transaction.TransactionUtil;
+import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.job.JobManager;
@@ -120,7 +121,7 @@ public class ServiceSemaphore {
GenericValue semaphore;
try {
- semaphore = delegator.findOne("ServiceSemaphore", false, "serviceName", model.name);
+ semaphore = EntityQuery.use(delegator).from("ServiceSemaphore").where("serviceName", model.name).queryOne();
} catch (GenericEntityException e) {
throw new SemaphoreFailException(e);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java Mon Nov 3 06:54:16 2014
@@ -18,12 +18,11 @@
*/
package org.ofbiz.service.test;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
@@ -31,6 +30,7 @@ import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.transaction.TransactionUtil;
+import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericResultWaiter;
import org.ofbiz.service.GenericServiceException;
@@ -52,7 +52,7 @@ public class ServiceEngineTestServices {
// make sure to wait for these to both finish to make sure results aren't checked until they are done
Map<String, Object> threadAResult = threadAWaiter.waitForResult();
Map<String, Object> threadBResult = threadBWaiter.waitForResult();
- List<Object> errorList = FastList.newInstance();
+ List<Object> errorList = new LinkedList<Object>();
if (ServiceUtil.isError(threadAResult)) {
errorList.add(UtilProperties.getMessage(resource, "ServiceTestDeadLockThreadA", UtilMisc.toMap("errorString", ServiceUtil.getErrorMessage(threadAResult)), locale));
}
@@ -75,7 +75,7 @@ public class ServiceEngineTestServices {
Locale locale = (Locale) context.get("locale");
try {
// grab entity SVCLRT_A by changing, then wait, then find and change SVCLRT_B
- GenericValue testingTypeA = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_A");
+ GenericValue testingTypeA = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_A").queryOne();
testingTypeA.set("description", "New description for SVCLRT_A");
testingTypeA.store();
@@ -84,12 +84,12 @@ public class ServiceEngineTestServices {
Thread.sleep(100);
Debug.logInfo("In testServiceDeadLockRetryThreadA done with wait, updating SVCLRT_B", module);
- GenericValue testingTypeB = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_B");
+ GenericValue testingTypeB = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_B").queryOne();
testingTypeB.set("description", "New description for SVCLRT_B");
testingTypeB.store();
Debug.logInfo("In testServiceDeadLockRetryThreadA done with updating SVCLRT_B, updating SVCLRT_AONLY", module);
- GenericValue testingTypeAOnly = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_AONLY");
+ GenericValue testingTypeAOnly = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_AONLY").queryOne();
testingTypeAOnly.set("description", "New description for SVCLRT_AONLY; this is only changed by thread A so if it doesn't match something happened to thread A!");
testingTypeAOnly.store();
} catch (GenericEntityException e) {
@@ -107,7 +107,7 @@ public class ServiceEngineTestServices {
Locale locale = (Locale) context.get("locale");
try {
// grab entity SVCLRT_B by changing, then wait, then change SVCLRT_A
- GenericValue testingTypeB = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_B");
+ GenericValue testingTypeB = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_B").queryOne();
testingTypeB.set("description", "New description for SVCLRT_B");
testingTypeB.store();
@@ -116,12 +116,12 @@ public class ServiceEngineTestServices {
Thread.sleep(100);
Debug.logInfo("In testServiceDeadLockRetryThreadB done with wait, updating SVCLRT_A", module);
- GenericValue testingTypeA = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_A");
+ GenericValue testingTypeA = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_A").queryOne();
testingTypeA.set("description", "New description for SVCLRT_A");
testingTypeA.store();
Debug.logInfo("In testServiceDeadLockRetryThreadA done with updating SVCLRT_A, updating SVCLRT_BONLY", module);
- GenericValue testingTypeAOnly = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_BONLY");
+ GenericValue testingTypeAOnly = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLRT_BONLY").queryOne();
testingTypeAOnly.set("description", "New description for SVCLRT_BONLY; this is only changed by thread B so if it doesn't match something happened to thread B!");
testingTypeAOnly.store();
} catch (GenericEntityException e) {
@@ -147,7 +147,7 @@ public class ServiceEngineTestServices {
// make sure to wait for these to both finish to make sure results aren't checked until they are done
Map<String, Object> grabberResult = grabberWaiter.waitForResult();
Map<String, Object> waiterResult = waiterWaiter.waitForResult();
- List<Object> errorList = FastList.newInstance();
+ List<Object> errorList = new LinkedList<Object>();
if (ServiceUtil.isError(grabberResult)) {
errorList.add("Error running testServiceLockWaitTimeoutRetryGrabber: " + ServiceUtil.getErrorMessage(grabberResult));
}
@@ -169,7 +169,7 @@ public class ServiceEngineTestServices {
Locale locale = (Locale) context.get("locale");
try {
// grab entity SVCLWTRT by changing, then wait a LONG time, ie more than the wait timeout
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRT");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLWTRT").queryOne();
testingType.set("description", "New description for SVCLWTRT from the GRABBER service, this should be replaced by Waiter service in the service engine auto-retry");
testingType.store();
@@ -198,7 +198,7 @@ public class ServiceEngineTestServices {
Debug.logInfo("In testServiceLockWaitTimeoutRetryWaiter about to update SVCLWTRT, wait starts here", module);
// TRY grab entity SVCLWTRT by looking up and changing, should get a lock wait timeout exception because of the Grabber thread
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRT");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLWTRT").queryOne();
testingType.set("description", "New description for SVCLWTRT from Waiter service, this is the value that should be there.");
testingType.store();
@@ -238,7 +238,7 @@ public class ServiceEngineTestServices {
Locale locale = (Locale) context.get("locale");
try {
// grab entity SVCLWTRTCR by changing, then wait a LONG time, ie more than the wait timeout
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRTCR");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLWTRTCR").queryOne();
testingType.set("description", "New description for SVCLWTRTCR from Lock Wait Timeout Lock GRABBER, this should be replaced by the one in the Waiter service.");
testingType.store();
@@ -267,7 +267,7 @@ public class ServiceEngineTestServices {
Debug.logInfo("In testServiceLockWaitTimeoutRetryCantRecoverWaiter updating SVCLWTRTCR", module);
// TRY grab entity SVCLWTRTCR by looking up and changing, should get a lock wait timeout exception because of the Grabber thread
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRTCR");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVCLWTRTCR").queryOne();
testingType.set("description", "New description for SVCLWTRTCR from Lock Wait Timeout Lock Waiter, this is the value that should be there.");
testingType.store();
@@ -303,7 +303,7 @@ public class ServiceEngineTestServices {
Locale locale = (Locale) context.get("locale");
try {
// change the SVC_SRBO value first to test that the rollback really does revert/reset
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SRBO");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVC_SRBO").queryOne();
testingType.set("description", "New description for SVC_SRBO; this should be reset on the rollback, if this is in the db then the test failed");
testingType.store();
@@ -346,7 +346,7 @@ public class ServiceEngineTestServices {
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
try {
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SECAGC");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVC_SECAGC").queryOne();
testingType.set("description", "New description for SVC_SECAGC, what it should be after the global-commit test");
testingType.store();
} catch (GenericEntityException e) {
@@ -365,7 +365,7 @@ public class ServiceEngineTestServices {
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
try {
- GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SECAGR");
+ GenericValue testingType = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "SVC_SECAGR").queryOne();
testingType.set("description", "New description for SVC_SECAGR, what it should be after the global-rollback test");
testingType.store();
} catch (GenericEntityException e) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java Mon Nov 3 06:54:16 2014
@@ -18,11 +18,10 @@
*/
package org.ofbiz.service.test;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.entity.GenericValue;
@@ -38,14 +37,14 @@ public class ServiceSOAPTests extends OF
}
public void testSOAPSimpleService() throws Exception {
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("defaultValue", new Double("123.4567"));
serviceContext.put("message", "Test Message !!!");
dispatcher.runSync("testSoapSimple", serviceContext);
}
public void testSOAPService() throws Exception {
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
GenericValue testing = delegator.makeValue("Testing");
testing.put("testingId", "COMPLEX_TYPE_TEST");
testing.put("testingTypeId", "SOAP_TEST");
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/build.xml?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/build.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/build.xml Mon Nov 3 06:54:16 2014
@@ -45,11 +45,8 @@ under the License.
<file name="org/ofbiz/sql/test/ValuesTest.java"/>
<file name="org/ofbiz/sql/test/ConditionsTest.java"/>
<file name="org/ofbiz/sql/test/SelectTest.java"/>
- <file name="org/ofbiz/sql/test/SQLTest.java"/>
</filelist>
<patternset id="cobertura-src-dirs">
- <include name="build/gen-src/javacc"/>
- <include name="build/gen-src/jjtree"/>
<include name="src"/>
</patternset>
@@ -57,21 +54,6 @@ under the License.
<!-- Compilation of the source files -->
<!-- ================================================================== -->
- <target name="gen-src">
- <ofbiz-javacc dir="org/ofbiz/sql" file="Parser"/>
- </target>
-
- <target name="classes" depends="prepare,gen-src">
- <javac17>
- <sourcepath>
- <dirset dir="build/gen-src">
- <include name="javacc"/>
- <include name="jjtree"/>
- </dirset>
- </sourcepath>
- </javac17>
- </target>
-
<target name="jar" depends="classes">
<main-jar/>
<test-jar/>
@@ -83,10 +65,6 @@ under the License.
<target name="docs" depends="prepare-docs">
<default-javadoc>
- <fileset dir="build/gen-src/javacc" defaultexcludes="yes">
- <patternset refid="src.inc.set"/>
- <patternset refid="src.exc.set"/>
- </fileset>
<fileset dir="${src.dir}" defaultexcludes="yes">
<patternset refid="src.inc.set"/>
<patternset refid="src.exc.set"/>
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/src/org/ofbiz/sql/test/SelectTest.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/src/org/ofbiz/sql/test/SelectTest.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/src/org/ofbiz/sql/test/SelectTest.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/sql/src/org/ofbiz/sql/test/SelectTest.java Mon Nov 3 06:54:16 2014
@@ -18,7 +18,6 @@
*/
package org.ofbiz.sql.test;
-import java.io.StringReader;
import java.util.Collections;
import java.util.Set;
@@ -30,7 +29,6 @@ import org.ofbiz.sql.FieldDef;
import org.ofbiz.sql.FieldValue;
import org.ofbiz.sql.FunctionCall;
import org.ofbiz.sql.OrderByItem;
-import org.ofbiz.sql.Parser;
import org.ofbiz.sql.StaticValue;
import org.ofbiz.sql.Value;
@@ -44,10 +42,6 @@ public class SelectTest extends GenericT
super(name);
}
- private static Parser parser(Object v) {
- return new Parser(new StringReader(v.toString()));
- }
-
private static <V> void basicTest(String label, Class<V> clz, V v, V o, boolean matches) {
assertNotEquals(label + ":not-equals-this", v, SelectTest.class);
if (o != null) {
@@ -62,7 +56,6 @@ public class SelectTest extends GenericT
private static void fieldAllTest(String label, FieldAll v, String alias, Set<String> exclude, FieldAll o, boolean matches) throws Exception {
assertEquals(label + ":alias", alias, v.getAlias());
assertEquals(label + ":exclude", exclude, set(v));
- assertEquals(label + ":parse", v, parser(v).parse_FieldAll());
basicTest(label, FieldAll.class, v, o, matches);
}
@@ -83,7 +76,6 @@ public class SelectTest extends GenericT
assertEquals(label + ":value", value, v.getValue());
assertEquals(label + ":alias", alias, v.getAlias());
assertEquals(label + ":default-name", defaultName, v.getDefaultName());
- assertEquals(label + ":parse", v, parser(v).parse_FieldDef());
basicTest(label, FieldDef.class, v, o, matches);
}
@@ -104,7 +96,6 @@ public class SelectTest extends GenericT
assertEquals(label + ":order", order, v.getOrder());
assertEquals(label + ":nulls", nulls, v.getNulls());
assertEquals(label + ":value", value, v.getValue());
- assertEquals(label + ":parse", v, parser(v).parse_OrderByItem());
basicTest(label, OrderByItem.class, v, o, matches);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java Mon Nov 3 06:54:16 2014
@@ -19,9 +19,9 @@
package org.ofbiz.testtools;
import java.net.URL;
+import java.util.LinkedList;
import java.util.List;
-import javolution.util.FastList;
import junit.framework.AssertionFailedError;
import junit.framework.TestResult;
@@ -72,7 +72,7 @@ public class EntityXmlAssertTest extends
try {
URL entityXmlURL = FlexibleLocation.resolveLocation(entityXmlUrlString);
- List<Object> errorMessages = FastList.newInstance();
+ List<Object> errorMessages = new LinkedList<Object>();
if ("assert".equals(this.action)) {
EntityDataAssert.assertData(entityXmlURL, delegator, errorMessages);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java Mon Nov 3 06:54:16 2014
@@ -18,9 +18,9 @@
*******************************************************************************/
package org.ofbiz.testtools;
+import java.util.LinkedList;
import java.util.List;
-import javolution.util.FastList;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -38,7 +38,7 @@ public class JunitSuiteWrapper {
public static final String module = JunitSuiteWrapper.class.getName();
- protected List<ModelTestSuite> modelTestSuiteList = FastList.newInstance();
+ protected List<ModelTestSuite> modelTestSuiteList = new LinkedList<ModelTestSuite>();
public JunitSuiteWrapper(String componentName, String suiteName, String testCase) {
for (ComponentConfig.TestSuiteInfo testSuiteInfo: ComponentConfig.getAllTestSuiteInfos(componentName)) {
@@ -79,7 +79,7 @@ public class JunitSuiteWrapper {
}
public List<Test> getAllTestList() {
- List<Test> allTestList = FastList.newInstance();
+ List<Test> allTestList = new LinkedList<Test>();
for (ModelTestSuite modelTestSuite: this.modelTestSuiteList) {
for (Test tst: modelTestSuite.getTestList()) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestListContainer.java Mon Nov 3 06:54:16 2014
@@ -22,11 +22,9 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
-import java.lang.String;
+import java.util.LinkedList;
import java.util.List;
-import javolution.util.FastList;
-
import org.ofbiz.base.component.ComponentConfig;
import org.ofbiz.base.config.GenericConfigException;
import org.ofbiz.base.config.ResourceHandler;
@@ -72,7 +70,7 @@ public class TestListContainer implement
}
public boolean start() throws ContainerException {
- List<FoundTest> foundTests = FastList.newInstance();
+ List<FoundTest> foundTests = new LinkedList<FoundTest>();
for (ComponentConfig.TestSuiteInfo testSuiteInfo: ComponentConfig.getAllTestSuiteInfos(null)) {
String componentName = testSuiteInfo.getComponentConfig().getComponentName();
ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Mon Nov 3 06:54:16 2014
@@ -22,11 +22,10 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
-import java.lang.String;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -205,7 +204,7 @@ public class TestRunContainer implements
class JunitXmlListener extends XMLJUnitResultFormatter {
- Map<String, Long> startTimes = FastMap.newInstance();
+ Map<String, Long> startTimes = new HashMap<String, Long>();
public JunitXmlListener(OutputStream out) {
this.setOutput(out);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/OfbizUrlBuilder.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/OfbizUrlBuilder.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/OfbizUrlBuilder.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/OfbizUrlBuilder.java Mon Nov 3 06:54:16 2014
@@ -29,6 +29,7 @@ import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.webapp.control.ConfigXMLReader;
import org.ofbiz.webapp.control.ConfigXMLReader.ControllerConfig;
import org.ofbiz.webapp.control.ConfigXMLReader.RequestMap;
@@ -85,7 +86,7 @@ public final class OfbizUrlBuilder {
Assert.notNull("delegator", delegator);
String webSiteId = WebAppUtil.getWebSiteId(webAppInfo);
if (webSiteId != null) {
- GenericValue webSiteValue = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
+ GenericValue webSiteValue = EntityQuery.use(delegator).from("WebSite").where("webSiteId", webSiteId).cache().queryOne();
if (webSiteValue != null) {
webSiteProps = WebSiteProperties.from(webSiteValue);
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Mon Nov 3 06:54:16 2014
@@ -22,16 +22,16 @@ import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.ofbiz.base.component.ComponentConfig.WebappInfo;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.metrics.Metrics;
@@ -60,7 +60,7 @@ public class ConfigXMLReader {
public static final RequestResponse emptyNoneRequestResponse = RequestResponse.createEmptyNoneRequestResponse();
public static Set<String> findControllerFilesWithRequest(String requestUri, String controllerPartialPath) throws GeneralException {
- Set<String> allControllerRequestSet = FastSet.newInstance();
+ Set<String> allControllerRequestSet = new HashSet<String>();
if (UtilValidate.isEmpty(requestUri)) {
return allControllerRequestSet;
}
@@ -70,7 +70,7 @@ public class ConfigXMLReader {
try {
// find controller.xml file with webappMountPoint + "/WEB-INF" in the path
List<File> controllerFiles = FileUtil.findXmlFiles(null, controllerPartialPath, "site-conf", "site-conf.xsd");
- controllerConfigs = FastList.newInstance();
+ controllerConfigs = new LinkedList<ControllerConfig>();
for (File controllerFile : controllerFiles) {
URL controllerUrl = null;
try {
@@ -125,7 +125,7 @@ public class ConfigXMLReader {
// if (controllerLocAndRequestSet.size() > 0) Debug.logInfo("============== In findRequestNamesLinkedtoInWidget, controllerLocAndRequestSet: " + controllerLocAndRequestSet, module);
return controllerLocAndRequestSet;
} else {
- return FastSet.newInstance();
+ return new HashSet<String>();
}
}
@@ -176,16 +176,16 @@ public class ConfigXMLReader {
private String securityClass;
private String defaultRequest;
private String statusCode;
- private List<URL> includes = FastList.newInstance();
- private Map<String, Event> firstVisitEventList = FastMap.newInstance();
- private Map<String, Event> preprocessorEventList = FastMap.newInstance();
- private Map<String, Event> postprocessorEventList = FastMap.newInstance();
- private Map<String, Event> afterLoginEventList = FastMap.newInstance();
- private Map<String, Event> beforeLogoutEventList = FastMap.newInstance();
- private Map<String, String> eventHandlerMap = FastMap.newInstance();
- private Map<String, String> viewHandlerMap = FastMap.newInstance();
- private Map<String, RequestMap> requestMapMap = FastMap.newInstance();
- private Map<String, ViewMap> viewMapMap = FastMap.newInstance();
+ private List<URL> includes = new ArrayList<URL>();
+ private Map<String, Event> firstVisitEventList = new HashMap<String, Event>();
+ private Map<String, Event> preprocessorEventList = new HashMap<String, Event>();
+ private Map<String, Event> postprocessorEventList = new HashMap<String, Event>();
+ private Map<String, Event> afterLoginEventList = new HashMap<String, Event>();
+ private Map<String, Event> beforeLogoutEventList = new HashMap<String, Event>();
+ private Map<String, String> eventHandlerMap = new HashMap<String, String>();
+ private Map<String, String> viewHandlerMap = new HashMap<String, String>();
+ private Map<String, RequestMap> requestMapMap = new HashMap<String, RequestMap>();
+ private Map<String, ViewMap> viewMapMap = new HashMap<String, ViewMap>();
public ControllerConfig(URL url) throws WebAppConfigurationException {
this.url = url;
@@ -532,7 +532,7 @@ public class ConfigXMLReader {
public boolean securityCert = false;
public boolean securityExternalView = true;
public boolean securityDirectRequest = true;
- public Map<String, RequestResponse> requestResponseMap = FastMap.newInstance();
+ public Map<String, RequestResponse> requestResponseMap = new HashMap<String, RequestResponse>();
public Metrics metrics = null;
public RequestMap(Element requestMapElement) {
@@ -587,8 +587,8 @@ public class ConfigXMLReader {
public boolean saveLastView = false;
public boolean saveCurrentView = false;
public boolean saveHomeView = false;
- public Map<String, String> redirectParameterMap = FastMap.newInstance();
- public Map<String, String> redirectParameterValueMap = FastMap.newInstance();
+ public Map<String, String> redirectParameterMap = new HashMap<String, String>();
+ public Map<String, String> redirectParameterValueMap = new HashMap<String, String>();
public RequestResponse() {
}
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java Mon Nov 3 06:54:16 2014
@@ -36,6 +36,7 @@ import org.ofbiz.entity.GenericEntityExc
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.serialize.XmlSerializer;
import org.ofbiz.entity.transaction.TransactionUtil;
+import org.ofbiz.entity.util.EntityQuery;
/**
* HttpSessionListener that gathers and tracks various information and statistics
@@ -77,7 +78,7 @@ public class ControlEventListener implem
GenericValue visit = (GenericValue) session.getAttribute("visit");
if (visit != null) {
Delegator delegator = visit.getDelegator();
- visit = delegator.findOne("Visit", UtilMisc.toMap("visitId", visit.get("visitId")), false);
+ visit = EntityQuery.use(delegator).from("Visit").where("visitId", visit.get("visitId")).queryOne();
if (visit != null) {
visit.set("thruDate", new Timestamp(session.getLastAccessedTime()));
visit.store();
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Mon Nov 3 06:54:16 2014
@@ -25,9 +25,11 @@ import java.security.cert.X509Certificat
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -39,9 +41,6 @@ import javax.servlet.http.HttpSession;
import javax.servlet.jsp.PageContext;
import javax.transaction.Transaction;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.component.ComponentConfig;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -66,6 +65,7 @@ import org.ofbiz.entity.model.ModelEntit
import org.ofbiz.entity.serialize.XmlSerializer;
import org.ofbiz.entity.transaction.GenericTransactionException;
import org.ofbiz.entity.transaction.TransactionUtil;
+import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.security.Security;
import org.ofbiz.security.SecurityConfigurationException;
@@ -88,7 +88,7 @@ public class LoginWorker {
public static final String X509_CERT_ATTR = "SSLx509Cert";
/** This Map is keyed by the randomly generated externalLoginKey and the value is a UserLogin GenericValue object */
- public static Map<String, GenericValue> externalLoginKeys = FastMap.newInstance();
+ public static Map<String, GenericValue> externalLoginKeys = new ConcurrentHashMap<String, GenericValue>();
public static StringWrapper makeLoginUrl(PageContext pageContext) {
return makeLoginUrl(pageContext, "checkLogin");
@@ -185,7 +185,7 @@ public class LoginWorker {
try {
beganTransaction = TransactionUtil.begin();
- GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
+ GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne();
if (userLogin == null) {
Debug.logError("Could not find UserLogin record for setLoggedOut with userLoginId [" + userLoginId + "]", module);
} else {
@@ -237,7 +237,7 @@ public class LoginWorker {
List<Object> errorMessageList = UtilGenerics.checkList(request.getAttribute("_ERROR_MESSAGE_LIST"));
if (!hasBasePermission(userLogin, request) || isFlaggedLoggedOut(userLogin)) {
if (errorMessageList == null) {
- errorMessageList = new FastList<Object>();
+ errorMessageList = new LinkedList<Object>();
request.setAttribute("_ERROR_MESSAGE_LIST", errorMessageList);
}
errorMessageList.add("User does not have permission or is flagged as logged out");
@@ -377,7 +377,7 @@ public class LoginWorker {
password = (String) request.getAttribute("PASSWORD");
}
- List<String> unpwErrMsgList = FastList.newInstance();
+ List<String> unpwErrMsgList = new LinkedList<String>();
if (UtilValidate.isEmpty(username)) {
unpwErrMsgList.add(UtilProperties.getMessage(resourceWebapp, "loginevents.username_was_empty_reenter", UtilHttp.getLocale(request)));
}
@@ -757,7 +757,7 @@ public class LoginWorker {
if (autoUserLoginId != null) {
Debug.logInfo("Running autoLogin check.", module);
try {
- GenericValue autoUserLogin = delegator.findOne("UserLogin", false, "userLoginId", autoUserLoginId);
+ GenericValue autoUserLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", autoUserLoginId).queryOne();
GenericValue person = null;
GenericValue group = null;
if (autoUserLogin != null) {
@@ -765,8 +765,8 @@ public class LoginWorker {
ModelEntity modelUserLogin = autoUserLogin.getModelEntity();
if (modelUserLogin.isField("partyId")) {
- person = delegator.findOne("Person", false, "partyId", autoUserLogin.getString("partyId"));
- group = delegator.findOne("PartyGroup", false, "partyId", autoUserLogin.getString("partyId"));
+ person = EntityQuery.use(delegator).from("Person").where("partyId", autoUserLogin.getString("partyId")).queryOne();
+ group = EntityQuery.use(delegator).from("PartyGroup").where("partyId", autoUserLogin.getString("partyId")).queryOne();
}
}
if (person != null) {
@@ -827,7 +827,7 @@ public class LoginWorker {
public static String loginUserWithUserLoginId(HttpServletRequest request, HttpServletResponse response, String userLoginId) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
try {
- GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
+ GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne();
if (userLogin != null) {
String enabled = userLogin.getString("enabled");
if (enabled == null || "Y".equals(enabled)) {
@@ -941,7 +941,7 @@ public class LoginWorker {
//Debug.logInfo("Looking up userLogin from CN: " + userLoginId, module);
// CN should match the userLoginId
- GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
+ GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne();
if (userLogin != null) {
String enabled = userLogin.getString("enabled");
if (enabled == null || "Y".equals(enabled)) {
@@ -966,7 +966,7 @@ public class LoginWorker {
}
protected static boolean checkValidIssuer(Delegator delegator, Map<String, String> x500Map, BigInteger serialNumber) throws GeneralException {
- List<EntityCondition> conds = FastList.newInstance();
+ List<EntityCondition> conds = new LinkedList<EntityCondition>();
conds.add(EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeConditionMap("commonName", x500Map.get("CN")),
EntityCondition.makeConditionMap("commonName", null),
EntityCondition.makeConditionMap("commonName", "")));
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java Mon Nov 3 06:54:16 2014
@@ -20,13 +20,12 @@ package org.ofbiz.webapp.control;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilMisc;
@@ -43,8 +42,8 @@ public class ProtectViewWorker {
private final static String module = ProtectViewWorker.class.getName();
private static final String resourceWebapp = "WebappUiLabels";
- private static final FastMap<String, Long> hitsByViewAccessed = FastMap.newInstance();
- private static final FastMap<String, Long> durationByViewAccessed = FastMap.newInstance();
+ private static final Map<String, Long> hitsByViewAccessed = new ConcurrentHashMap<String, Long>();
+ private static final Map<String, Long> durationByViewAccessed = new ConcurrentHashMap<String, Long>();
private static final Long one = new Long(1);
/**
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Mon Nov 3 06:54:16 2014
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingExcept
import java.net.URL;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -35,8 +36,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastMap;
-
import org.ofbiz.base.start.Start;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.SSLUtil;
@@ -51,6 +50,7 @@ import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.webapp.OfbizUrlBuilder;
import org.ofbiz.webapp.event.EventFactory;
import org.ofbiz.webapp.event.EventHandler;
@@ -271,7 +271,7 @@ public class RequestHandler {
String webSiteId = WebSiteWorker.getWebSiteId(request);
if (webSiteId != null) {
try {
- GenericValue webSite = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
+ GenericValue webSite = EntityQuery.use(delegator).from("WebSite").where("webSiteId", webSiteId).cache().queryOne();
if (webSite != null) enableHttps = webSite.getBoolean("enableHttps");
} catch (GenericEntityException e) {
Debug.logWarning(e, "Problems with WebSite entity; using global defaults", module);
@@ -545,7 +545,7 @@ public class RequestHandler {
String preReqAttStr = (String) request.getSession().getAttribute("_REQ_ATTR_MAP_");
Map<String, Object> previousRequestAttrMap = null;
if (preReqAttStr != null) {
- previousRequestAttrMap = FastMap.newInstance();
+ previousRequestAttrMap = new HashMap<String, Object>();
request.getSession().removeAttribute("_REQ_ATTR_MAP_");
byte[] reqAttrMapBytes = StringUtil.fromHexString(preReqAttStr);
Map<String, Object> preRequestMap = checkMap(UtilObject.getObject(reqAttrMapBytes), String.class, Object.class);
@@ -827,7 +827,7 @@ public class RequestHandler {
if (Debug.infoOn()) Debug.logInfo("Sending redirect to: [" + url + "], sessionId=" + UtilHttp.getSessionId(req), module);
// set the attributes in the session so we can access it.
Enumeration<String> attributeNameEnum = UtilGenerics.cast(req.getAttributeNames());
- Map<String, Object> reqAttrMap = FastMap.newInstance();
+ Map<String, Object> reqAttrMap = new HashMap<String, Object>();
Integer statusCode;
try {
statusCode = Integer.valueOf(statusCodeString);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java Mon Nov 3 06:54:16 2014
@@ -28,6 +28,7 @@ import java.io.IOException;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Date;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
@@ -37,8 +38,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilProperties;
@@ -50,8 +49,8 @@ import org.ofbiz.service.GenericServiceE
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.calendar.RecurrenceRule;
-import org.ofbiz.webapp.control.RequestHandler;
import org.ofbiz.webapp.control.ConfigXMLReader.Event;
+import org.ofbiz.webapp.control.RequestHandler;
/**
* CoreEvents - WebApp Events Related To Framework pieces
@@ -125,7 +124,7 @@ public class CoreEvents {
String retryCnt = (String) params.remove("SERVICE_MAXRETRY");
// the frequency map
- Map<String, Integer> freqMap = FastMap.newInstance();
+ Map<String, Integer> freqMap = new HashMap<String, Integer>();
freqMap.put("SECONDLY", Integer.valueOf(1));
freqMap.put("MINUTELY", Integer.valueOf(2));
@@ -169,7 +168,7 @@ public class CoreEvents {
}
// make the context valid; using the makeValid method from ModelService
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
Iterator<String> ci = modelService.getInParamNames().iterator();
while (ci.hasNext()) {
String name = ci.next();
@@ -347,7 +346,7 @@ public class CoreEvents {
session.removeAttribute("_SAVED_SYNC_RESULT_");
Map<String, String[]> serviceFieldsToSave = checkMap(request.getParameterMap(), String.class, String[].class);
- Map<String, Object> savedFields = FastMap.newInstance();
+ Map<String, Object> savedFields = new HashMap<String, Object>();
for (Map.Entry<String, String[]> entry : serviceFieldsToSave.entrySet()) {
String key = entry.getKey();
@@ -384,14 +383,14 @@ public class CoreEvents {
servicePathMap = checkMap(servicePathObject);
} else if (servicePathObject instanceof GenericEntity) {
GenericEntity servicePathEntity = (GenericEntity)servicePathObject;
- servicePathMap = FastMap.newInstance();
+ servicePathMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry: servicePathEntity.entrySet()) {
servicePathMap.put(entry.getKey(), entry.getValue());
}
} else if (servicePathObject instanceof Collection<?>) {
Collection<?> servicePathColl = checkCollection(servicePathObject);
int count=0;
- servicePathMap = FastMap.newInstance();
+ servicePathMap = new HashMap<String, Object>();
for (Object value: servicePathColl) {
servicePathMap.put("_"+count+"_", value);
count++;
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java Mon Nov 3 06:54:16 2014
@@ -19,14 +19,13 @@
package org.ofbiz.webapp.event;
import java.lang.reflect.Method;
+import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.webapp.control.ConfigXMLReader;
import org.ofbiz.webapp.control.ConfigXMLReader.Event;
@@ -39,7 +38,7 @@ public class JavaEventHandler implements
public static final String module = JavaEventHandler.class.getName();
- private Map<String, Class<?>> eventClassMap = FastMap.newInstance();
+ private Map<String, Class<?>> eventClassMap = new HashMap<String, Class<?>>();
/**
* @see org.ofbiz.webapp.event.EventHandler#init(javax.servlet.ServletContext)
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java Mon Nov 3 06:54:16 2014
@@ -21,7 +21,10 @@ package org.ofbiz.webapp.event;
import static org.ofbiz.base.util.UtilGenerics.checkList;
import java.io.File;
+import java.io.IOException;
import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -33,9 +36,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -130,7 +130,7 @@ public class ServiceEventHandler impleme
}
boolean isMultiPart = ServletFileUpload.isMultipartContent(request);
- Map<String, Object> multiPartMap = FastMap.newInstance();
+ Map<String, Object> multiPartMap = new HashMap<String, Object>();
if (isMultiPart) {
// get the http upload configuration
String maxSizeStr = EntityUtilProperties.getPropertyValue("general.properties", "http.upload.max.size", "-1", dctx.getDelegator());
@@ -188,7 +188,7 @@ public class ServiceEventHandler impleme
if (mapValue instanceof List<?>) {
checkList(mapValue, Object.class).add(item.getString());
} else if (mapValue instanceof String) {
- List<String> newList = FastList.newInstance();
+ List<String> newList = new LinkedList<String>();
newList.add((String) mapValue);
newList.add(item.getString());
multiPartMap.put(fieldName, newList);
@@ -233,9 +233,18 @@ public class ServiceEventHandler impleme
Map<String, Object> rawParametersMap = UtilHttp.getParameterMap(request, null, null);
Set<String> urlOnlyParameterNames = UtilHttp.getUrlOnlyParameterMap(request).keySet();
+ Map<String, Object> requestBodyMap = null;
+ try {
+ requestBodyMap = RequestBodyMapHandlerFactory.extractMapFromRequestBody(request);
+ } catch (IOException ioe) {
+ Debug.logWarning(ioe, module);
+ }
+ if (requestBodyMap != null) {
+ rawParametersMap.putAll(requestBodyMap);
+ }
// we have a service and the model; build the context
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
for (ModelParam modelParam: model.getInModelParamList()) {
String name = modelParam.name;
@@ -309,7 +318,7 @@ public class ServiceEventHandler impleme
// get only the parameters for this service - converted to proper type
// TODO: pass in a list for error messages, like could not convert type or not a proper X, return immediately with messages if there are any
- List<Object> errorMessages = FastList.newInstance();
+ List<Object> errorMessages = new LinkedList<Object>();
serviceContext = model.makeValid(serviceContext, ModelService.IN_PARAM, true, errorMessages, timeZone, locale);
if (errorMessages.size() > 0) {
// uh-oh, had some problems...
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java Mon Nov 3 06:54:16 2014
@@ -19,6 +19,8 @@
package org.ofbiz.webapp.event;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -30,9 +32,6 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilHttp;
@@ -50,9 +49,9 @@ import org.ofbiz.service.ServiceAuthExce
import org.ofbiz.service.ServiceUtil;
import org.ofbiz.service.ServiceValidationException;
import org.ofbiz.webapp.control.ConfigXMLReader;
-import org.ofbiz.webapp.control.RequestHandler;
import org.ofbiz.webapp.control.ConfigXMLReader.Event;
import org.ofbiz.webapp.control.ConfigXMLReader.RequestMap;
+import org.ofbiz.webapp.control.RequestHandler;
import org.ofbiz.webapp.control.WebAppConfigurationException;
/**
@@ -155,8 +154,8 @@ public class ServiceMultiEventHandler im
String messageSuffixStr = UtilProperties.getMessage("DefaultMessages", "service.message.suffix", locale);
// prepare the error message and success message lists
- List<Object> errorMessages = FastList.newInstance();
- List<String> successMessages = FastList.newInstance();
+ List<Object> errorMessages = new LinkedList<Object>();
+ List<String> successMessages = new LinkedList<String>();
// Check the global-transaction attribute of the event from the controller to see if the
// event should be wrapped in a transaction
@@ -207,7 +206,7 @@ public class ServiceMultiEventHandler im
}
// build the context
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
for (ModelParam modelParam: modelService.getInModelParamList()) {
String paramName = modelParam.name;
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java Mon Nov 3 06:54:16 2014
@@ -23,14 +23,13 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
+import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.DelegatorFactory;
@@ -70,7 +69,7 @@ public class ServiceStreamHandler implem
throw new EventHandlerException(e.getMessage(), e);
}
- Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> context = new HashMap<String, Object>();
context.put("inputStream", in);
context.put("outputStream", out);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java Mon Nov 3 06:54:16 2014
@@ -27,6 +27,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Writer;
+import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -34,8 +35,6 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastMap;
-
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.XmlRpcHandler;
import org.apache.xmlrpc.XmlRpcRequest;
@@ -190,7 +189,7 @@ public class XmlRpcEventHandler extends
String password = config.getBasicPassword();
// check the account
- Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> context = new HashMap<String, Object>();
context.put("login.username", username);
context.put("login.password", password);
@@ -287,7 +286,7 @@ public class XmlRpcEventHandler extends
}
// context placeholder
- Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> context = new HashMap<String, Object>();
if (model != null) {
int parameterCount = xmlRpcReq.getParameterCount();
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java Mon Nov 3 06:54:16 2014
@@ -36,6 +36,7 @@ import org.ofbiz.entity.DelegatorFactory
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entity.util.EntityQuery;
import com.ibm.icu.util.Calendar;
@@ -474,7 +475,7 @@ public class ServerHitBin {
// check for type data before running.
GenericValue serverHitType = null;
- serverHitType = delegator.findOne("ServerHitType", UtilMisc.toMap("hitTypeId", ServerHitBin.typeIds[this.type]), true);
+ serverHitType = EntityQuery.use(delegator).from("ServerHitType").where("hitTypeId", ServerHitBin.typeIds[this.type]).cache().queryOne();
if (serverHitType == null) {
// datamodel data not loaded; not storing hit.
Debug.logWarning("The datamodel data has not been loaded; cannot find hitTypeId '" + ServerHitBin.typeIds[this.type] + " not storing ServerHit.", module);
@@ -488,7 +489,7 @@ public class ServerHitBin {
return;
}
String visitId = visit.getString("visitId");
- visit = delegator.findOne("Visit", UtilMisc.toMap("visitId", visitId), false);
+ visit = EntityQuery.use(delegator).from("Visit").where("visitId", visitId).queryOne();
if (visit == null) {
// GenericValue stored in client session does not exist in database.
Debug.logInfo("The Visit GenericValue stored in the client session does not exist in the database, not storing server hit.", module);
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java Mon Nov 3 06:54:16 2014
@@ -35,6 +35,7 @@ import org.ofbiz.entity.DelegatorFactory
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entity.util.EntityQuery;
/**
* Handles saving and maintaining visit information
@@ -164,7 +165,7 @@ public class VisitHandler {
// sometimes these values get stale, so check it before we use it
try {
- GenericValue checkVisitor = delegator.findOne("Visitor", false, "visitorId", visitorId);
+ GenericValue checkVisitor = EntityQuery.use(delegator).from("Visitor").where("visitorId", visitorId).queryOne();
if (checkVisitor == null) {
GenericValue newVisitor = delegator.create("Visitor", "visitorId", visitorId);
session.setAttribute("visitor", newVisitor);
@@ -247,7 +248,7 @@ public class VisitHandler {
}
} else {
try {
- visitor = delegator.findOne("Visitor", false, "visitorId", cookieVisitorId);
+ visitor = EntityQuery.use(delegator).from("Visitor").where("visitorId", cookieVisitorId).queryOne();
if (visitor == null) {
// looks like we have an ID that doesn't exist in our database, so we'll create a new one
visitor = delegator.makeValue("Visitor");
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java Mon Nov 3 06:54:16 2014
@@ -18,10 +18,9 @@
*******************************************************************************/
package org.ofbiz.webapp.webdav;
+import java.util.LinkedList;
import java.util.List;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.UtilValidate;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -56,7 +55,7 @@ public class PropFindHelper extends Resp
}
public List<Element> getFindPropsList(String nameSpaceUri) {
- List<Element> result = FastList.newInstance();
+ List<Element> result = new LinkedList<Element>();
NodeList nodeList = this.requestDocument.getElementsByTagNameNS(nameSpaceUri == null ? "*" : nameSpaceUri, "prop");
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i).getFirstChild();
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java Mon Nov 3 06:54:16 2014
@@ -23,14 +23,13 @@ import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import javax.servlet.http.HttpServletRequest;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Base64;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilProperties;
@@ -101,7 +100,7 @@ public class WebDavUtil {
if ("true".equalsIgnoreCase(UtilProperties.getPropertyValue("security.properties", "password.lowercase"))) {
password = password.toLowerCase();
}
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new HashMap<String, Object>();
result.put("login.username", username);
result.put("login.password", password);
return result;
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java Mon Nov 3 06:54:16 2014
@@ -28,6 +28,7 @@ import org.ofbiz.base.util.UtilPropertie
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
/**
* Web site properties.
@@ -67,7 +68,7 @@ public final class WebSiteProperties {
if (delegator != null) {
String webSiteId = WebSiteWorker.getWebSiteId(request);
if (webSiteId != null) {
- GenericValue webSiteValue = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
+ GenericValue webSiteValue = EntityQuery.use(delegator).from("WebSite").where("webSiteId", webSiteId).cache().queryOne();
if (webSiteValue != null) {
if (webSiteValue.get("httpPort") != null) {
httpPort = webSiteValue.getString("httpPort");
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java Mon Nov 3 06:54:16 2014
@@ -31,6 +31,8 @@ import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilURL;
+import org.ofbiz.widget.artifact.ArtifactInfoContext;
+import org.ofbiz.widget.artifact.ArtifactInfoGatherer;
import org.ofbiz.widget.form.ModelForm;
import org.xml.sax.SAXException;
@@ -68,12 +70,14 @@ public class FormWidgetArtifactInfo exte
/** note this is mean to be called after the object is created and added to the ArtifactInfoFactory.allFormInfos in ArtifactInfoFactory.getFormWidgetArtifactInfo */
public void populateAll() throws GeneralException {
- // populate entitiesUsedInThisForm, servicesUsedInThisForm, formThisFormExtends (and reverse in aif.allFormInfosExtendingForm)
- this.populateUsedEntities();
- this.populateUsedServices();
+ ArtifactInfoContext infoContext = new ArtifactInfoContext();
+ ArtifactInfoGatherer infoGatherer = new ArtifactInfoGatherer(infoContext);
+ infoGatherer.visit(this.modelForm);
+ populateEntitiesFromNameSet(infoContext.getEntityNames());
+ populateServicesFromNameSet(infoContext.getServiceNames());
this.populateFormExtended();
- this.populateLinkedRequests();
- this.populateTargetedRequests();
+ this.populateLinkedRequests(infoContext.getRequestLocations());
+ this.populateTargetedRequests(infoContext.getTargetLocations());
}
protected void populateFormExtended() throws GeneralException {
@@ -97,11 +101,7 @@ public class FormWidgetArtifactInfo exte
UtilMisc.addToSortedSetInMap(this, aif.allFormInfosExtendingForm, formName);
}
}
- protected void populateUsedEntities() throws GeneralException {
- // populate entitiesUsedInThisForm and for each the reverse-associate cache in the aif
- Set<String> allEntityNameSet = this.modelForm.getAllEntityNamesUsed();
- populateEntitiesFromNameSet(allEntityNameSet);
- }
+
protected void populateEntitiesFromNameSet(Set<String> allEntityNameSet) throws GeneralException {
for (String entityName: allEntityNameSet) {
if (entityName.contains("${")) {
@@ -118,11 +118,6 @@ public class FormWidgetArtifactInfo exte
UtilMisc.addToSortedSetInMap(this, aif.allFormInfosReferringToEntityName, entityName);
}
}
- protected void populateUsedServices() throws GeneralException {
- // populate servicesUsedInThisForm and for each the reverse-associate cache in the aif
- Set<String> allServiceNameSet = this.modelForm.getAllServiceNamesUsed();
- populateServicesFromNameSet(allServiceNameSet);
- }
protected void populateServicesFromNameSet(Set<String> allServiceNameSet) throws GeneralException {
for (String serviceName: allServiceNameSet) {
if (serviceName.contains("${")) {
@@ -142,8 +137,7 @@ public class FormWidgetArtifactInfo exte
}
}
- protected void populateLinkedRequests() throws GeneralException{
- Set<String> allRequestUniqueId = this.modelForm.getLinkedRequestsLocationAndUri();
+ protected void populateLinkedRequests(Set<String> allRequestUniqueId) throws GeneralException{
for (String requestUniqueId: allRequestUniqueId) {
if (requestUniqueId.contains("${")) {
@@ -160,8 +154,7 @@ public class FormWidgetArtifactInfo exte
}
}
}
- protected void populateTargetedRequests() throws GeneralException{
- Set<String> allRequestUniqueId = this.modelForm.getTargetedRequestsLocationAndUri();
+ protected void populateTargetedRequests(Set<String> allRequestUniqueId) throws GeneralException{
for (String requestUniqueId: allRequestUniqueId) {
if (requestUniqueId.contains("${")) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java Mon Nov 3 06:54:16 2014
@@ -33,6 +33,8 @@ import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilURL;
+import org.ofbiz.widget.artifact.ArtifactInfoContext;
+import org.ofbiz.widget.artifact.ArtifactInfoGatherer;
import org.ofbiz.widget.screen.ModelScreen;
import org.xml.sax.SAXException;
@@ -71,16 +73,15 @@ public class ScreenWidgetArtifactInfo ex
}
public void populateAll() throws GeneralException {
- this.populateUsedEntities();
- this.populateUsedServices();
- this.populateIncludedForms();
- this.populateLinkedRequests();
- }
- protected void populateUsedServices() throws GeneralException {
- // populate servicesUsedInThisScreen and for each the reverse-associate cache in the aif
- Set<String> allServiceNameSet = this.modelScreen.getAllServiceNamesUsed();
- populateServicesFromNameSet(allServiceNameSet);
+ ArtifactInfoContext infoContext = new ArtifactInfoContext();
+ ArtifactInfoGatherer infoGatherer = new ArtifactInfoGatherer(infoContext);
+ infoGatherer.visit(this.modelScreen);
+ populateServicesFromNameSet(infoContext.getServiceNames());
+ populateEntitiesFromNameSet(infoContext.getEntityNames());
+ populateFormsFromNameSet(infoContext.getFormLocations());
+ populateLinkedRequests(infoContext.getRequestLocations());
}
+
protected void populateServicesFromNameSet(Set<String> allServiceNameSet) throws GeneralException {
for (String serviceName: allServiceNameSet) {
if (serviceName.contains("${")) {
@@ -99,11 +100,7 @@ public class ScreenWidgetArtifactInfo ex
UtilMisc.addToSortedSetInMap(this, aif.allScreenInfosReferringToServiceName, serviceName);
}
}
- protected void populateUsedEntities() throws GeneralException {
- // populate entitiesUsedInThisScreen and for each the reverse-associate cache in the aif
- Set<String> allEntityNameSet = this.modelScreen.getAllEntityNamesUsed();
- populateEntitiesFromNameSet(allEntityNameSet);
- }
+
protected void populateEntitiesFromNameSet(Set<String> allEntityNameSet) throws GeneralException {
for (String entityName: allEntityNameSet) {
if (entityName.contains("${")) {
@@ -122,11 +119,7 @@ public class ScreenWidgetArtifactInfo ex
UtilMisc.addToSortedSetInMap(this, aif.allScreenInfosReferringToEntityName, entityName);
}
}
- protected void populateIncludedForms() throws GeneralException {
- // populate servicesUsedInThisScreen and for each the reverse-associate cache in the aif
- Set<String> allFormNameSet = this.modelScreen.getAllFormNamesIncluded();
- populateFormsFromNameSet(allFormNameSet);
- }
+
protected void populateFormsFromNameSet(Set<String> allFormNameSet) throws GeneralException {
for (String formName: allFormNameSet) {
if (formName.contains("${")) {
@@ -147,8 +140,7 @@ public class ScreenWidgetArtifactInfo ex
}
}
- protected void populateLinkedRequests() throws GeneralException{
- Set<String> allRequestUniqueId = this.modelScreen.getAllRequestsLocationAndUri();
+ protected void populateLinkedRequests(Set<String> allRequestUniqueId) throws GeneralException{
for (String requestUniqueId: allRequestUniqueId) {
if (requestUniqueId.contains("${")) {
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/ModelWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/ModelWidget.java?rev=1636282&r1=1636281&r2=1636282&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/ModelWidget.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/widget/src/org/ofbiz/widget/ModelWidget.java Mon Nov 3 06:54:16 2014
@@ -30,31 +30,42 @@ import org.w3c.dom.Element;
* extended by other widget model classes.
*/
@SuppressWarnings("serial")
-public class ModelWidget implements Serializable {
+public abstract class ModelWidget implements Serializable {
/**
* The parameter name used to control widget boundary comments. Currently
* set to "widgetVerbose".
*/
public static final String enableBoundaryCommentsParam = "widgetVerbose";
- protected String name;
- private String systemId;
- private int startColumn;
- private int startLine;
+ private final String name;
+ private final String systemId;
+ private final int startColumn;
+ private final int startLine;
- protected ModelWidget() {}
+ /**
+ * Derived classes must call this constructor.
+ * @param name The widget name
+ */
+ protected ModelWidget(String name) {
+ this.name = name;
+ this.systemId = "anonymous";
+ this.startColumn = 0;
+ this.startLine = 0;
+ }
/**
* Derived classes must call this constructor.
* @param widgetElement The XML Element for the widget
*/
- public ModelWidget(Element widgetElement) {
+ protected ModelWidget(Element widgetElement) {
this.name = widgetElement.getAttribute("name");
this.systemId = (String) widgetElement.getUserData("systemId");
this.startColumn = ((Integer) widgetElement.getUserData("startColumn")).intValue();
this.startLine = ((Integer) widgetElement.getUserData("startLine")).intValue();
}
+ public abstract void accept(ModelWidgetVisitor visitor);
+
/**
* Returns the widget's name.
* @return Widget's name