Exemple #1
0
  public List getChildRegions(String regionId) throws Exception {
    CommonLogger.logDebug(log, "In PersonAction:getChildRegions() ");

    RegionManager regMgr = new RegionManager();
    List childRegns = regMgr.getChildRegions(regionId);
    return childRegns;
  }
Exemple #2
0
  public List getCountriesList() throws Exception {
    CommonLogger.logDebug(log, "In PersonAction:getCountriesList() ");

    RegionManager regMgr = new RegionManager();
    List locnList = regMgr.getRootRegions();

    return locnList;
  }
Exemple #3
0
  public List prepareLocationFormList(List regnList) throws BSIException {
    CommonLogger.logDebug(
        log, "In PersonAction.prepareLocationFormList(): the regn list size is " + regnList.size());
    System.out.println(
        "In PersonAction.prepareLocationFormList(): the regn list size is " + regnList.size());
    List locnList = new ArrayList();
    LocationForm locForm = null;
    Region region = null;
    String[] ids;
    String[] names;

    for (int z = 0; z < regnList.size(); z++) {
      ids = new String[6];
      names = new String[6];

      locForm = new LocationForm();
      int arrayPos = 0;

      region = (Region) regnList.get(z);
      ids[arrayPos] = region.getRegionId().toString();
      names[arrayPos] = region.getName();

      // Extract parent region name/ids for the given region
      RegionManager regMgr = new RegionManager();

      while (true) {
        region = regMgr.getParentRegion(region.getRegionId());
        CommonLogger.logDebug(log, "The region id is " + region.getRegionId().toString());
        System.out.println("The region id is " + region.getRegionId().toString());

        if (region == null
            || region.getRegionId().toString().equalsIgnoreCase(BSIConstants.ROOT_REGION_ID)) break;
        else {
          arrayPos = arrayPos + 1;
          ids[arrayPos] = region.getRegionId().toString();
          names[arrayPos] = region.getName();
        }
      }

      for (int m = 0; m < 6; m++) {
        System.out.println("The id [] :" + m + "=" + ids[m]);
        System.out.println("The names [] :" + m + "=" + names[m]);
      }
      // Populate the location form
      locForm.setRegionIdAndName(arrayPos + 1, ids, names);
      locnList.add(locForm);
    }
    return locnList;
  }