Advertisement
tko_pb

CallGenerateAutoSearchKey

Jul 27th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. package org.wirabumi.gen.oez.callout;
  2. import java.util.Enumeration;
  3. import java.util.HashMap;
  4. import java.util.Vector;
  5.  
  6. import org.openbravo.base.secureApp.VariablesSecureApp;
  7. import org.openbravo.client.kernel.RequestContext;
  8. import org.openbravo.dal.service.OBDal;
  9. import org.openbravo.erpCommon.ad_callouts.SimpleCallout;
  10. import org.openbravo.erpCommon.utility.Utility;
  11.  
  12. public class CallGenerateAutoSearchKey extends SimpleCallout {
  13.  
  14.     @Override
  15.     protected void execute(CalloutInfo info) {
  16.         try {
  17.             //get parameter
  18.             String SearchKeyRule = Utility.getPreference(info.vars, "SearchKeyRules", null);       
  19.  
  20.             Enumeration<String> CalloutInfoParameter = getCalloutParameter(info);
  21.            
  22.  
  23.             HashMap<String, String> CalloutInfoHashmap = new HashMap<>();
  24.             HashMap<String, String> CInfoHasil = new HashMap<>();
  25.  
  26.             boolean strValid = SearchKeyRule != null && !SearchKeyRule.isEmpty();
  27.             if (strValid) {
  28.                 Class<?> cls = Class.forName(SearchKeyRule);
  29.                 Object clsInstance = (Object) cls.newInstance();
  30.                 GenerateProductSearchKey concrete = null;
  31.                 concrete = (GenerateProductSearchKey) clsInstance;
  32.                 String searchKey = concrete.getProductSearchKey(info);
  33.                 info.addResult("inpvalue", searchKey);
  34.             }  
  35.             else {
  36.                 return;
  37.             }
  38.         } catch (ClassNotFoundException e) {
  39.             // TODO Auto-generated catch block
  40.             e.printStackTrace();
  41.         } catch (InstantiationException e) {
  42.             // TODO Auto-generated catch block
  43.             e.printStackTrace();
  44.         } catch (IllegalAccessException e) {
  45.             // TODO Auto-generated catch block
  46.             e.printStackTrace();
  47.         }
  48.  
  49.     }
  50.  
  51.     public Enumeration<String> getCalloutParameter (CalloutInfo info){
  52.         VariablesSecureApp vars = new VariablesSecureApp();
  53.         Enumeration<String> params = vars.getEnumerationString();
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement