Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.wirabumi.gen.oez.utility;
- import java.util.Enumeration;
- import java.util.HashMap;
- import org.apache.log4j.Logger;
- import org.codehaus.jettison.json.JSONException;
- import org.codehaus.jettison.json.JSONObject;
- import org.openbravo.base.filter.RequestFilter;
- import org.openbravo.base.secureApp.VariablesSecureApp;
- import org.openbravo.erpCommon.ad_callouts.CalloutConstants;
- import org.openbravo.erpCommon.ad_callouts.SimpleCallout;
- public class CalloutUtility {
- public static HashMap<String, String> GetCalloutUtility() {
- VariablesSecureApp vars = null;
- HashMap<String, String> CalloutInfoHashmap = new HashMap<>();
- Enumeration<String> Params = vars.getEnumerationString(); // hasil dari get
- while(Params.hasMoreElements())
- {
- String paramsKey = Params.nextElement();
- String value = getStringParameter(paramsKey, null);
- CalloutInfoHashmap.put(paramsKey, value);
- }
- return CalloutInfoHashmap;
- }
- public static String getStringParameter(String param, RequestFilter filter) {
- VariablesSecureApp vars = null;
- String value = "";
- JSONObject result = null;
- Logger log = Logger.getLogger(SimpleCallout.class);
- Enumeration<String> params = vars.getParameterNames();
- while(params.hasMoreElements())
- System.err.println(params.nextElement());
- try {
- // if a parent callout modified any value, updated value is returned.
- if (result.has(param)) {
- value = result.getJSONObject(param).get(CalloutConstants.CLASSIC_VALUE).toString();
- } else {
- value = vars.getStringParameter(param, filter);
- }
- } catch (JSONException e) {
- log.error("Error parsing JSON Object.", e);
- }
- return value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement