예제 #1
0
  public void addService(
      VOElement serviceEl) // TO DO - how to check which service is wanted????????
      {
    DataLinkService thisService = new DataLinkService();

    // handle the PARAM elements
    VOElement[] voels = serviceEl.getChildrenByName("PARAM"); // the param elements
    int i = 0;
    while (i < voels.length) {
      ParamElement pel = (ParamElement) voels[i];
      thisService.addParam(pel.getAttribute("name"), pel.getAttribute("value"));
      i++;
    }

    i = 0;

    // handle the GROUP with name=InputParams element and its parameters
    VOElement[] grpels =
        serviceEl.getChildrenByName("GROUP" /*, "name", "inputParams"*/); // the GROUP Element
    VOElement grpel = null;
    while (i < grpels.length && grpel == null) {
      VOElement gel = grpels[i];
      String name = gel.getAttribute("name");

      if (name.equalsIgnoreCase("InputParams")) {
        grpel = gel;
      }
      i++;
    }

    if (grpel != null) {
      VOElement[] grpParams = grpel.getChildrenByName("PARAM"); // the param elements
      // handle the group  PARAM elements
      int size = grpParams.length;
      for (int j = 0; j < size; j++) {
        ParamElement pel = (ParamElement) grpParams[j];
        if (pel.getAttribute("name").equals("ID")) {
          VOElement el = pel.getChildByName("LINK"); // link inside a group element
          if (el.getAttribute("content-role").equals("ddl:id-source"))
            id_source = el.getAttribute("value");
          thisService.addParam("idSource", el.getAttribute("value"));
        } else {
          thisService.addGroupParam(pel);
          queryIndex = j;
        }
      }

      service.add(thisService);
    }
  }