Reverting r1646165. It seems that changes that we did for <property-to-field> are not needed. I will commit the new changes soon.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1646191 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ashish Vijaywargiya
2014-12-17 10:49:41 +00:00
parent d3e50d1e18
commit f19b8bdfe7
40 changed files with 112 additions and 439 deletions
@@ -237,7 +237,7 @@ public class LoginWorker {
// check if they have permission for this login attempt; if not log them out
if (userLogin != null) {
List<Object> errorMessageList = UtilGenerics.checkList(request.getAttribute("_ERROR_MESSAGE_LIST"));
if (!hasBasePermission(userLogin, request) || isFlaggedLoggedOut(userLogin, userLogin.getDelegator())) {
if (!hasBasePermission(userLogin, request) || isFlaggedLoggedOut(userLogin)) {
if (errorMessageList == null) {
errorMessageList = new LinkedList<Object>();
request.setAttribute("_ERROR_MESSAGE_LIST", errorMessageList);
@@ -1066,8 +1066,8 @@ public class LoginWorker {
return "success";
}
public static boolean isFlaggedLoggedOut(GenericValue userLogin, Delegator delegator) {
if ("true".equalsIgnoreCase(EntityUtilProperties.getPropertyValue("security.properties", "login.disable.global.logout", delegator))) {
public static boolean isFlaggedLoggedOut(GenericValue userLogin) {
if ("true".equalsIgnoreCase(UtilProperties.getPropertyValue("security.properties", "login.disable.global.logout"))) {
return false;
}
if (userLogin == null || userLogin.get("userLoginId") == null) {
@@ -71,6 +71,8 @@ import org.python.modules.re;
public class RequestHandler {
public static final String module = RequestHandler.class.getName();
private static final boolean throwRequestHandlerExceptionOnMissingLocalRequest = UtilProperties.propertyValueEqualsIgnoreCase(
"requestHandler.properties", "throwRequestHandlerExceptionOnMissingLocalRequest", "Y");
private final String defaultStatusCodeString = UtilProperties.getPropertyValue("requestHandler.properties", "status-code", "302");
private final ViewFactory viewFactory;
private final EventFactory eventFactory;
@@ -129,8 +131,6 @@ public class RequestHandler {
public void doRequest(HttpServletRequest request, HttpServletResponse response, String chain,
GenericValue userLogin, Delegator delegator) throws RequestHandlerException, RequestHandlerExceptionAllowExternalRequests {
final boolean throwRequestHandlerExceptionOnMissingLocalRequest = EntityUtilProperties.propertyValueEqualsIgnoreCase(
"requestHandler.properties", "throwRequestHandlerExceptionOnMissingLocalRequest", "Y", delegator);
long startTime = System.currentTimeMillis();
HttpSession session = request.getSession();
@@ -280,7 +280,7 @@ public class RequestHandler {
}
}
if (enableHttps == null) {
enableHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
enableHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
}
if (Boolean.FALSE.equals(enableHttps)) {
@@ -1024,11 +1024,11 @@ public class RequestHandler {
@Deprecated
public static String getDefaultServerRootUrl(HttpServletRequest request, boolean secure) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
String httpsPort = EntityUtilProperties.getPropertyValue("url.properties", "port.https", "443", delegator);
String httpsServer = EntityUtilProperties.getPropertyValue("url.properties", "force.https.host", delegator);
String httpPort = EntityUtilProperties.getPropertyValue("url.properties", "port.http", "80", delegator);
String httpServer = EntityUtilProperties.getPropertyValue("url.properties", "force.http.host", delegator);
boolean useHttps = EntityUtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y", delegator);
String httpsPort = UtilProperties.getPropertyValue("url.properties", "port.https", "443");
String httpsServer = UtilProperties.getPropertyValue("url.properties", "force.https.host");
String httpPort = UtilProperties.getPropertyValue("url.properties", "port.http", "80");
String httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host");
boolean useHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
if (Start.getInstance().getConfig().portOffset != 0) {
Integer httpPortValue = Integer.valueOf(httpPort);
@@ -37,7 +37,6 @@ import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtilProperties;
import com.ibm.icu.util.Calendar;
@@ -214,7 +213,7 @@ public class ServerHitBin {
// put the copy at the first of the list, then put this object back on
if (bin.getNumberHits() > 0) {
// persist each bin when time ends if option turned on
if (EntityUtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist." + ServerHitBin.typeIds[type] + ".bin", "true", delegator)) {
if (UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist." + ServerHitBin.typeIds[type] + ".bin", "true")) {
GenericValue serverHitBin = delegator.makeValue("ServerHitBin");
serverHitBin.set("contentId", bin.id);
serverHitBin.set("hitTypeId", ServerHitBin.typeIds[bin.type]);
@@ -466,8 +465,7 @@ public class ServerHitBin {
private void saveHit(HttpServletRequest request, long startTime, long runningTime, GenericValue userLogin) throws GenericEntityException {
// persist record of hit in ServerHit entity if option turned on
Delegator delegator = (Delegator) request.getAttribute("delegator");
if (EntityUtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist." + ServerHitBin.typeIds[type] + ".hit", "true", delegator)) {
if (UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist." + ServerHitBin.typeIds[type] + ".hit", "true")) {
// if the hit type is ENTITY and the name contains "ServerHit" don't
// persist; avoids the infinite loop and a bunch of annoying data
if (this.type == ENTITY && this.id.indexOf("ServerHit") > 0) {
@@ -36,7 +36,6 @@ import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtilProperties;
/**
* Handles saving and maintaining visit information
@@ -205,8 +204,7 @@ public class VisitHandler {
public static GenericValue getVisitor(HttpServletRequest request, HttpServletResponse response) {
// this defaults to true: ie if anything but "false" it will be true
Delegator delegator = (Delegator) request.getAttribute("delegator");
if (!EntityUtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist.visitor", "false", delegator)) {
if (!UtilProperties.propertyValueEqualsIgnoreCase("serverstats", "stats.persist.visitor", "false")) {
HttpSession session = request.getSession();
GenericValue visitor = (GenericValue) session.getAttribute("visitor");
@@ -214,6 +212,7 @@ public class VisitHandler {
synchronized (session) {
visitor = (GenericValue) session.getAttribute("visitor");
if (visitor == null) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
String delegatorName = (String) session.getAttribute("delegatorName");
if (delegator == null && UtilValidate.isNotEmpty(delegatorName)) {