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.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@884347 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2009-11-26 00:40:44 +00:00
parent e53baa39a9
commit bf7ff532f4
13 changed files with 27 additions and 29 deletions
+1
View File
@@ -44,6 +44,7 @@ specialpurpose/oagis/build/
specialpurpose/pos/build/
specialpurpose/projectmgr/build/
specialpurpose/webpos/build/
specialpurpose/shark/build/
ofbiz.jar
changelog
runtime/svninfo.ftl
@@ -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 abstract class AuditEntityObject {
public Delegator getDelegator() {
if (this.delegator == null && delegatorName != null) {
this.delegator = Delegator.getDelegator(delegatorName);
this.delegator = DelegatorFactory.getDelegator(delegatorName);
}
return this.delegator;
}
@@ -24,6 +24,7 @@ import java.util.List;
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;
@@ -22,6 +22,7 @@ import org.ofbiz.entity.Delegator;
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 @@ public class GenericAuthenticationMgr implements AuthenticationManager {
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;
@@ -25,6 +25,7 @@ import org.ofbiz.entity.GenericEntityException;
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 @@ public class OfbizAuthenticationMgr implements AuthenticationManager {
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 @@ public class OfbizAuthenticationMgr implements AuthenticationManager {
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;
@@ -40,7 +40,9 @@ import org.ofbiz.base.util.Debug;
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 @@ public class SharkContainer implements Container, Runnable
}
// 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 {
@@ -24,6 +24,7 @@ import org.enhydra.shark.api.RootException;
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 {
@@ -20,6 +20,7 @@ package org.ofbiz.shark.expression;
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;
@@ -478,8 +478,8 @@ public class EntityPersistentMgr implements PersistentManagerInterface {
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 @@ public class EntityPersistentMgr implements PersistentManagerInterface {
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 @@ public class EntityPersistentMgr implements PersistentManagerInterface {
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 @@ public class EntityPersistentMgr implements PersistentManagerInterface {
} 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);
}
@@ -31,7 +31,7 @@ public abstract class InstanceEntityObject {
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 abstract class InstanceEntityObject {
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;
}
@@ -28,6 +28,7 @@ import org.ofbiz.entity.GenericValue;
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;
@@ -308,7 +308,7 @@ public class EntityRepositoryMgr implements RepositoryPersistenceManager {
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 {
@@ -149,11 +149,7 @@ public abstract class AbstractRequester implements WfRequester, Serializable {
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;
}