Improved: General refactoring and code improvements, package
org.apache.ofbiz.common.preferences. (OFBIZ-9927) Thanks Dennis Balkir for reporting and providing the patches. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818548 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
-12
@@ -85,9 +85,6 @@ public class PreferenceServices {
|
||||
if (preference != null) {
|
||||
userPrefMap = PreferenceWorker.createUserPrefMap(preference);
|
||||
}
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
|
||||
} catch (GeneralException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
|
||||
@@ -135,9 +132,6 @@ public class PreferenceServices {
|
||||
fieldMap.put("userLoginId", userLoginId);
|
||||
userPrefMap.putAll(PreferenceWorker.createUserPrefMap(EntityQuery.use(delegator).from("UserPreference").where(fieldMap).cache(true).queryList()));
|
||||
}
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
|
||||
} catch (GeneralException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
|
||||
@@ -185,9 +179,6 @@ public class PreferenceServices {
|
||||
}
|
||||
GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, userPrefTypeId, userPrefGroupTypeId, userPrefValue));
|
||||
delegator.createOrStore(rec);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
|
||||
} catch (GeneralException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
|
||||
@@ -247,9 +238,6 @@ public class PreferenceServices {
|
||||
GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, mapEntry.getKey(), userPrefGroupTypeId, mapEntry.getValue()));
|
||||
delegator.createOrStore(rec);
|
||||
}
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
|
||||
} catch (GeneralException e) {
|
||||
Debug.logWarning(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public final class PreferenceWorker {
|
||||
private static final String DEFAULT_UID = "_NA_";
|
||||
|
||||
private PreferenceWorker () {}
|
||||
|
||||
|
||||
/**
|
||||
* Add a UserPreference GenericValue to a Map.
|
||||
* @param rec GenericValue to convert
|
||||
|
||||
Reference in New Issue
Block a user