| java.lang.Object org.ofbiz.service.ServiceUtil
ServiceUtil | public class ServiceUtil (Code) | | Generic Service Utility Class
author: Andy Zeneski version: $Revision: 1.10 $ since: 2.0 |
Method Summary | |
public static Map | cancelJob(DispatchContext dctx, Map context) | public static String | getErrorMessage(Map result) | public static void | getMessages(HttpServletRequest request, Map result, String defaultMessage, String msgPrefix, String msgSuffix, String errorPrefix, String errorSuffix, String successPrefix, String successSuffix) | public static String | getPartyIdCheckSecurity(GenericValue userLogin, Security security, Map context, Map result, String secEntity, String secOperation) | public static boolean | isError(Map results) | public static String | makeErrorMessage(Map result, String msgPrefix, String msgSuffix, String errorPrefix, String errorSuffix) | public static String | makeMessageList(List msgList, String msgPrefix, String msgSuffix) | public static String | makeSuccessMessage(Map result, String msgPrefix, String msgSuffix, String successPrefix, String successSuffix) | public static Map | purgeOldJobs(DispatchContext dctx, Map context) | public static Map | returnError(String errorMessage) | public static Map | returnError(List errorMessageList) | public static Map | returnError(String errorMessage, List errorMessageList, Map errorMessageMap, Map nestedResult) | public static Map | returnMessage(String code, String message) | public static Map | returnSuccess(String successMessage) | public static Map | returnSuccess() | public static void | setMessages(HttpServletRequest request, String errorMessage, String eventMessage, String defaultMessage) |
getPartyIdCheckSecurity | public static String getPartyIdCheckSecurity(GenericValue userLogin, Security security, Map context, Map result, String secEntity, String secOperation)(Code) | | A small routine used all over to improve code efficiency, get the partyId and does a security check
security check: userLogin partyId must equal partyId, or must have [secEntity][secOperation] permission
|
isError | public static boolean isError(Map results)(Code) | | A little short-cut method to check to see if a service returned an error
|
returnError | public static Map returnError(String errorMessage)(Code) | | A small routine used all over to improve code efficiency, make a result map with the message and the error response code
|
returnError | public static Map returnError(List errorMessageList)(Code) | | A small routine used all over to improve code efficiency, make a result map with the message and the error response code
|
returnError | public static Map returnError(String errorMessage, List errorMessageList, Map errorMessageMap, Map nestedResult)(Code) | | A small routine used all over to improve code efficiency, make a result map with the message and the error response code, also forwards any error messages from the nestedResult
|
returnMessage | public static Map returnMessage(String code, String message)(Code) | | A small routine to make a result map with the message and the response code
NOTE: This brings out some bad points to our message convention: we should be using a single message or message list
and what type of message that is should be determined by the RESPONSE_MESSAGE (and there's another annoyance, it should be RESPONSE_CODE)
|
returnSuccess | public static Map returnSuccess(String successMessage)(Code) | | A small routine used all over to improve code efficiency, make a result map with the message and the success response code
|
returnSuccess | public static Map returnSuccess()(Code) | | A small routine used all over to improve code efficiency, make a result map with the message and the success response code
|
|
|