921309e27aba8127eeaf4637d1892a5df5658beb.svn-base 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package xin.glue.ui.Z;
  2. import xin.glue.ui.common.PosMultiSearch;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. public class PosPrivSearch extends PosMultiSearch {
  6. public String runActivity(PosContext ctx) {
  7. int count = 1;
  8. if (getProperty("sqlkey-count") != null)
  9. count = Integer.parseInt(getProperty("sqlkey-count").trim());
  10. if (count == 0) return PosBizControlConstants.SUCCESS;
  11. if (ctx.get("ROOT_AMN_YN") != null &&
  12. ("Y".equals(((String[])ctx.get("ROOT_AMN_YN"))[0])))
  13. count--;
  14. Initialize("true".equalsIgnoreCase(getProperty("writeLog")));
  15. String resultkey = getProperty("resultkey");
  16. if (resultkey == null) {
  17. resultkey = "ListResult";
  18. for(int i = 0; i < count; i++) {
  19. String resultkeys = resultkey + "_" + i;
  20. setParamMap(ctx, "sqlkey" + i, "param" + i);
  21. Execute(resultkeys, ctx, "sqlkey" + i, "param" + i);
  22. }
  23. } else {
  24. String[] resultkeys = resultkey.split("\\|");
  25. int length = resultkeys.length;
  26. for(int i = 0; i < count; i++) {
  27. setParamMap(ctx, "sqlkey" + i, "param" + i);
  28. Execute((i<length)?resultkeys[i]:resultkeys[length-1], ctx, "sqlkey" + i, "param" + i);
  29. }
  30. }
  31. return PosBizControlConstants.SUCCESS;
  32. }
  33. }