Class PreferenceWorker

java.lang.Object
org.apache.ofbiz.common.preferences.PreferenceWorker

public final class PreferenceWorker extends Object
User preference worker methods.
  • Method Details

    • checkCopyPermission

      public static Map<String,Object> checkCopyPermission(DispatchContext ctx, Map<String,?> context)
      Checks preference copy permissions. Returns hasPermission=true if permission is granted.

      Users can copy from any set of preferences to their own preferences. Copying to another user's preferences requires ADMIN_PERMISSION permission.

      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input arguments.
      Returns:
      Map with the result of the service, the output parameters.
    • checkPermission

      public static Map<String,Object> checkPermission(DispatchContext ctx, Map<String,?> context)
      Checks preference get/set permissions. Returns hasPermission=true if permission is granted.

      This method is a simple wrapper around the isValidxxxId methods.

      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input arguments.
      Returns:
      Map with the result of the service, the output parameters.
    • toFieldMap

      public static Map<String,Object> toFieldMap(String userLoginId, String userPrefTypeId, String userPrefGroupTypeId, Object userPrefValue) throws GeneralException
      Creates a field Map to be used in GenericValue create or store methods.
      Parameters:
      userLoginId - The user's login ID
      userPrefTypeId - The preference ID
      userPrefGroupTypeId - The preference group ID (may be null or empty)
      userPrefValue - The preference value (will be converted to java.lang.String data type)
      Returns:
      field map
      Throws:
      GeneralException