예제 #1
0
  private void populateServices(
      File projectSourceRoot, NodeList nodeList, List<TMapServiceEntry> services) {

    if (services == null) {
      return;
    }

    TMapServiceEntry service = null;

    assert nodeList != null;

    for (int i = 0; i < nodeList.getLength(); i++) {
      Node tmpNode = nodeList.item(i);
      NamedNodeMap namedNodeMap = tmpNode.getAttributes();

      String partnerLink = XmlUtil.getAttrValue(namedNodeMap, XsltMapConst.PARTNER_LINK);
      QName partnerLinkQname = getQName(partnerLink);
      if (partnerLinkQname == null) {
        continue;
      }
      populateNamespace(partnerLinkQname.getNamespaceURI());

      String roleName = XmlUtil.getAttrValue(namedNodeMap, XsltMapConst.ROLE_NAME);
      String operation = XmlUtil.getAttrValue(namedNodeMap, XsltMapConst.OPERATION);
      String file = XmlUtil.getAttrValue(namedNodeMap, XsltMapConst.FILE);
      String transformJBI = XmlUtil.getAttrValue(namedNodeMap, XsltMapConst.TRANSFORM_JBI);

      services.add(
          new TMapServiceEntry(partnerLinkQname, roleName, operation, file, transformJBI, tmpNode));
    }
  }
예제 #2
0
  public void execute() throws BuildException {
    File xsltMapFile = getXsltMapFile();

    Document document = null;
    if (xsltMapFile != null && xsltMapFile.exists()) {
      document = XmlUtil.getDocument(xsltMapFile);
    }

    if (document != null) {
      NodeList inputNodeList =
          document.getElementsByTagName(TransformationDescType.INPUT.getTagName());
      if (inputNodeList != null && inputNodeList.getLength() > 0) {
        populateProviderServices(xsltMapFile.getParentFile(), inputNodeList);
      }
      NodeList outputNodeList =
          document.getElementsByTagName(TransformationDescType.OUTPUT.getTagName());
      if (outputNodeList != null && outputNodeList.getLength() > 0) {
        populateConsumerServices(xsltMapFile.getParentFile(), outputNodeList);
      }
    }
    try {

      generateTransformMap();
    } catch (IOException ex) {
      throw new BuildException(ex);
    }
  }