예제 #1
0
  private void buildCapabilityList() {

    capabilityList = new ArrayList<ExtendedCapability>();
    // System.out.println("Selected Resource: " + resourceIndex);

    ExtendedRegistry tempExtendedRegistry = this.extendedRegistryList.get(resourceIndex);
    Resource tempResource = tempExtendedRegistry.getResource();

    XmlObject tempObject = tempResource.copy();
    XmlObject xmlObjectCapabilityChild[] = tempObject.selectChildren(new QName("", "capability"));

    Capability capabilityTemp = null;
    ExtendedCapability extendedCapabilityTemp = null;

    for (int j = 0; j < xmlObjectCapabilityChild.length; j++) {
      try {
        capabilityTemp = Capability.Factory.parse(xmlObjectCapabilityChild[j].xmlText());

        extendedCapabilityTemp = new ExtendedCapability(j, capabilityTemp);
      } catch (XmlException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      capabilityList.add(extendedCapabilityTemp);
    }
  }
예제 #2
0
  private String[] buildCapabilityList(Resource resourceValue) {

    Resource tempResource = resourceValue;
    // First for Tap and second for Tap-XSAMs
    String[] accessURLs = new String[] {null, null};

    XmlObject tempObject = tempResource.copy();
    XmlObject xmlObjectCapabilityChild[] = tempObject.selectChildren(new QName("", "capability"));

    Capability capabilityTemp = null;

    for (int j = 0; j < xmlObjectCapabilityChild.length; j++) {
      try {
        capabilityTemp = Capability.Factory.parse(xmlObjectCapabilityChild[j].xmlText());
        if (capabilityTemp.getStandardID() != null) {
          if (capabilityTemp.getStandardID().toUpperCase().contains("ivo://vamdc/std/TAP-XSAMS")) {
            accessURLs[1] = buildInterfaceList(capabilityTemp);
          }
          if (capabilityTemp.getStandardID().toUpperCase().contains("TAP")) {

            if (capabilityTemp.getStandardID().toUpperCase().contains("TAP-XSAMS")) {
              accessURLs[1] = buildInterfaceList(capabilityTemp);
            } else {
              accessURLs[0] = buildInterfaceList(capabilityTemp);
            }
          }
        }

      } catch (XmlException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return accessURLs;
  }