You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/11/26 01:40:44 UTC
svn commit: r884347 - in /ofbiz/trunk: ./
specialpurpose/shark/src/org/ofbiz/shark/audit/
specialpurpose/shark/src/org/ofbiz/shark/auth/
specialpurpose/shark/src/org/ofbiz/shark/container/
specialpurpose/shark/src/org/ofbiz/shark/expression/ specialpur...
Author: doogie
Date: Thu Nov 26 00:40:44 2009
New Revision: 884347
URL: http://svn.apache.org/viewvc?rev=884347&view=rev
Log:
Shark compiles now. Except that you have to add the libraries uploaded
to https://issues.apache.org/jira/browse/OFBIZ-552. Which you probably
can't, as latest shark(2.0 or 2.5, couldn't really tell) is LGPL. So we
should probably remove this anyways.
Modified:
ofbiz/trunk/.gitignore
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/AuditEntityObject.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/GenericAuthenticationMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/OfbizAuthenticationMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java
ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java
Modified: ofbiz/trunk/.gitignore
URL: http://svn.apache.org/viewvc/ofbiz/trunk/.gitignore?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/.gitignore (original)
+++ ofbiz/trunk/.gitignore Thu Nov 26 00:40:44 2009
@@ -44,6 +44,7 @@
specialpurpose/pos/build/
specialpurpose/projectmgr/build/
specialpurpose/webpos/build/
+specialpurpose/shark/build/
ofbiz.jar
changelog
runtime/svninfo.ftl
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/AuditEntityObject.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/AuditEntityObject.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/AuditEntityObject.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/AuditEntityObject.java Thu Nov 26 00:40:44 2009
@@ -19,6 +19,7 @@
package org.ofbiz.shark.audit;
import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
import org.ofbiz.entity.GenericEntityException;
@@ -40,7 +41,7 @@
public Delegator getDelegator() {
if (this.delegator == null && delegatorName != null) {
- this.delegator = Delegator.getDelegator(delegatorName);
+ this.delegator = DelegatorFactory.getDelegator(delegatorName);
}
return this.delegator;
}
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java Thu Nov 26 00:40:44 2009
@@ -24,6 +24,7 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/GenericAuthenticationMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/GenericAuthenticationMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/GenericAuthenticationMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/GenericAuthenticationMgr.java Thu Nov 26 00:40:44 2009
@@ -22,6 +22,7 @@
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.shark.container.SharkContainer;
+import org.ofbiz.base.crypto.HashCrypt;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.common.login.LoginServices;
@@ -54,9 +55,9 @@
String registeredPwd = sharkUser.getString(org.ofbiz.shark.SharkConstants.passwd);
if (password.equals(registeredPwd)) {
return true;
- } else if (LoginServices.getPasswordHash(password).equals(registeredPwd)) {
+ } else if (HashCrypt.getDigestHash(password, LoginServices.getHashType()).equals(registeredPwd)) {
return true;
- } else if (LoginServices.getPasswordHash(registeredPwd).equals(password)) {
+ } else if (HashCrypt.getDigestHash(registeredPwd, LoginServices.getHashType()).equals(password)) {
return true;
} else {
return false;
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/OfbizAuthenticationMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/OfbizAuthenticationMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/OfbizAuthenticationMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/auth/OfbizAuthenticationMgr.java Thu Nov 26 00:40:44 2009
@@ -25,6 +25,7 @@
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityCrypto;
import org.ofbiz.shark.container.SharkContainer;
+import org.ofbiz.base.crypto.HashCrypt;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.common.login.LoginServices;
import org.ofbiz.service.LocalDispatcher;
@@ -52,7 +53,7 @@
Delegator delegator = SharkContainer.getDelegator();
String p = null;
GenericValue adminUser = null;
- String pass_hash = LoginServices.getPasswordHash(password);
+ String pass_hash = HashCrypt.getDigestHash(password, LoginServices.getHashType());
try {
adminUser = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userName));
String a = adminUser.getString("userLoginId");
@@ -61,9 +62,9 @@
if (adminUser != null) {
if (password.equals(p)) {
return true;
- } else if (LoginServices.getPasswordHash(password).equals(p)) {
+ } else if (HashCrypt.getDigestHash(password, LoginServices.getHashType()).equals(p)) {
return true;
- } else if (LoginServices.getPasswordHash(p).equals(password)) {
+ } else if (HashCrypt.getDigestHash(p, LoginServices.getHashType()).equals(password)) {
return true;
} else {
return false;
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/container/SharkContainer.java Thu Nov 26 00:40:44 2009
@@ -40,7 +40,9 @@
import org.ofbiz.base.util.GeneralRuntimeException;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.GenericDispatcher;
@@ -107,12 +109,8 @@
}
// get the delegator and dispatcher objects
- SharkContainer.delegator = Delegator.getDelegator(delegatorProp.value);
- try {
- SharkContainer.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherProp.value, SharkContainer.delegator);
- } catch (GenericServiceException e) {
- throw new ContainerException(e);
- }
+ SharkContainer.delegator = DelegatorFactory.getDelegator(delegatorProp.value);
+ SharkContainer.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherProp.value, SharkContainer.delegator);
// get the admin user
try {
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java Thu Nov 26 00:40:44 2009
@@ -24,6 +24,7 @@
import org.enhydra.shark.api.common.ActivityIteratorExpressionBuilder;
import org.ofbiz.base.util.Debug;
import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.model.ModelKeyMap;
public class ActivityIteratorCondExprBldr extends BaseEntityCondExprBldr implements ActivityIteratorExpressionBuilder {
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java Thu Nov 26 00:40:44 2009
@@ -20,6 +20,7 @@
import org.enhydra.shark.api.common.ProcessMgrIteratorExpressionBuilder;
import org.ofbiz.base.util.Debug;
+import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java Thu Nov 26 00:40:44 2009
@@ -478,8 +478,8 @@
List createdList = new ArrayList();
List lookupList = null;
try {
- lookupList = delegator.findByCondition(org.ofbiz.shark.SharkConstants.WfProcess,
- makeStateListCondition(org.ofbiz.shark.SharkConstants.currentState, runningStates, EntityOperator.EQUALS, EntityOperator.OR), null, order);
+ lookupList = delegator.findList(org.ofbiz.shark.SharkConstants.WfProcess,
+ makeStateListCondition(org.ofbiz.shark.SharkConstants.currentState, runningStates, EntityOperator.EQUALS, EntityOperator.OR), null, order, null, false);
} catch (GenericEntityException e) {
throw new PersistenceException(e);
}
@@ -504,7 +504,7 @@
try {
EntityCondition stateCond = this.makeStateListCondition(org.ofbiz.shark.SharkConstants.currentState, finsihedStates, EntityOperator.EQUALS, EntityOperator.OR);
EntityCondition cond = this.makeProcessFilterCondition(stateCond, packageId, processDefId, packageVer, finishedBefore);
- lookupList = delegator.findByCondition(org.ofbiz.shark.SharkConstants.WfProcess, cond, null, order);
+ lookupList = delegator.findList(org.ofbiz.shark.SharkConstants.WfProcess, cond, null, order, null, false);
} catch (GenericEntityException e) {
throw new PersistenceException(e);
}
@@ -846,7 +846,7 @@
Delegator delegator = SharkContainer.getDelegator();
long count = 0;
try {
- count = delegator.findCountByAnd(org.ofbiz.shark.SharkConstants.WfActivity, UtilMisc.toMap(org.ofbiz.shark.SharkConstants.processId, procId, org.ofbiz.shark.SharkConstants.setDefinitionId, asDefId, org.ofbiz.shark.SharkConstants.definitionId, aDefId));
+ count = delegator.findCountByCondition(org.ofbiz.shark.SharkConstants.WfActivity, EntityCondition.makeCondition(UtilMisc.toMap(org.ofbiz.shark.SharkConstants.processId, procId, org.ofbiz.shark.SharkConstants.setDefinitionId, asDefId, org.ofbiz.shark.SharkConstants.definitionId, aDefId)), null, null);
} catch (GenericEntityException e) {
throw new PersistenceException(e);
}
@@ -1146,7 +1146,7 @@
} else {
cond = proc;
}
- lookupList = delegator.findByCondition(org.ofbiz.shark.SharkConstants.WfActivity, cond, null, order);
+ lookupList = delegator.findList(org.ofbiz.shark.SharkConstants.WfActivity, cond, null, order, null, false);
} catch (GenericEntityException e) {
throw new PersistenceException(e);
}
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java Thu Nov 26 00:40:44 2009
@@ -31,7 +31,7 @@
protected EntityPersistentMgr mgr = null;
protected String delegatorName = null;
- public InstanceEntityObject(EntityPersistentMgr mgr, GenericDelegator delegator) {
+ public InstanceEntityObject(EntityPersistentMgr mgr, Delegator delegator) {
this.delegatorName = delegator.getDelegatorName();
this.delegator = delegator;
this.mgr = mgr;
@@ -43,11 +43,7 @@
public Delegator getGenericDelegator() {
if (this.delegator == null && delegatorName != null) {
- try {
- this.delegator = DelegatorFactory.getDelegator(this.delegatorName);
- } catch (ClassNotFoundException e) {
- Debug.logError(e, module);
- }
+ this.delegator = DelegatorFactory.getDelegator(this.delegatorName);
}
return this.delegator;
}
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/mapping/EntityParticipantMappingMgr.java Thu Nov 26 00:40:44 2009
@@ -28,6 +28,7 @@
import org.ofbiz.shark.container.SharkContainer;
import org.ofbiz.shark.transaction.JtaTransaction;
import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
import org.enhydra.shark.api.internal.working.CallbackUtilities;
import org.enhydra.shark.api.internal.partmappersistence.ParticipantMap;
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java Thu Nov 26 00:40:44 2009
@@ -308,7 +308,7 @@
EntityCondition cond = EntityCondition.makeCondition(exprList, EntityOperator.AND);
List lookupList = null;
try {
- lookupList = delegator.findByCondition(org.ofbiz.shark.SharkConstants.WfRepository, cond, null, UtilMisc.toList("-xpdlVersion"));
+ lookupList = delegator.findList(org.ofbiz.shark.SharkConstants.WfRepository, cond, null, UtilMisc.toList("-xpdlVersion"), null, false);
} catch (GenericEntityException e) {
throw new RepositoryException(e);
} finally {
Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java?rev=884347&r1=884346&r2=884347&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java Thu Nov 26 00:40:44 2009
@@ -149,11 +149,7 @@
protected synchronized Delegator getDelegator() {
if (this.delegator == null && this.delegatorName != null) {
- try {
- this.delegator = DelegatorFactory.getDelegator(this.delegatorName);
- } catch (ClassNotFoundException e) {
- Debug.logError(e, module);
- }
+ this.delegator = DelegatorFactory.getDelegator(this.delegatorName);
}
return this.delegator;
}