Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.DefintionPartConfig


    Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts( loader );
    definitionCache.setRootPart( baseUri );

    for( Iterator<String> i = urls.keySet().iterator(); i.hasNext(); )
    {
      DefintionPartConfig definitionPart = definitionCache.addNewPart();
      String url = i.next();
      definitionPart.setUrl( url );
      XmlObject xmlObject = urls.get( url );
      Node domNode = xmlObject.getDomNode();

      if( domNode.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE )
      {
        Node node = ( ( DocumentFragment )domNode ).getFirstChild();
        if( node.getNodeType() == Node.TEXT_NODE )
        {
          domNode = XmlUtils.parseXml( node.getNodeValue() );
          // xmlObject = XmlObject.Factory.parse( domNode );
          xmlObject = XmlUtils.createXmlObject( domNode );
        }
      }

      Element contentElement = ( ( Document )domNode ).getDocumentElement();

      Node newDomNode = definitionPart.addNewContent().getDomNode();
      newDomNode.appendChild( newDomNode.getOwnerDocument().createTextNode( xmlObject.toString() ) );
      definitionPart.setType( contentElement.getNamespaceURI() );
    }

    initParts();
  }
View Full Code Here


    Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts( loader );

    for( Iterator<String> i = urls.keySet().iterator(); i.hasNext(); )
    {
      DefintionPartConfig definitionPart = definitionCache.addNewPart();
      String url = i.next();
      definitionPart.setUrl( url );
      XmlObject xmlObject = urls.get( url );
      Node domNode = xmlObject.getDomNode();

      if( domNode.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE )
      {
        Node node = ( ( DocumentFragment )domNode ).getFirstChild();
        if( node.getNodeType() == Node.TEXT_NODE )
        {
          domNode = XmlUtils.parseXml( node.getNodeValue() );
          // xmlObject = XmlObject.Factory.parse( domNode );
          xmlObject = XmlUtils.createXmlObject( domNode );
        }
      }

      Element contentElement = ( ( Document )domNode ).getDocumentElement();

      Node newDomNode = definitionPart.addNewContent().getDomNode();
      newDomNode.appendChild( newDomNode.getOwnerDocument().createTextNode( xmlObject.toString() ) );
      definitionPart.setType( contentElement.getNamespaceURI() );
    }

    return definitionCache;
  }
View Full Code Here

        definitionCache.setType(DefinitionCacheTypeConfig.TEXT);
        Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts(loader);
        definitionCache.setRootPart(baseUri);

        for (Map.Entry<String, XmlObject> entry : urls.entrySet()) {
            DefintionPartConfig definitionPart = definitionCache.addNewPart();
            String url = entry.getKey();
            definitionPart.setUrl(url);
            XmlObject xmlObject = entry.getValue();
            Node domNode = xmlObject.getDomNode();

            if (domNode.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) {
                Node node = ((DocumentFragment) domNode).getFirstChild();
                if (node.getNodeType() == Node.TEXT_NODE) {
                    domNode = XmlUtils.parseXml(node.getNodeValue());
                    // xmlObject = XmlObject.Factory.parse( domNode );
                    xmlObject = XmlUtils.createXmlObject(domNode);
                }
            }

            Element contentElement = ((Document) domNode).getDocumentElement();

            Node newDomNode = definitionPart.addNewContent().getDomNode();
            newDomNode.appendChild(newDomNode.getOwnerDocument().createTextNode(xmlObject.toString()));
            definitionPart.setType(contentElement.getNamespaceURI());
        }

        initParts();
    }
View Full Code Here

        definitionCache.setType(DefinitionCacheTypeConfig.TEXT);

        Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts(loader);

        for (Map.Entry<String, XmlObject> urlEntry : urls.entrySet()) {
            DefintionPartConfig definitionPart = definitionCache.addNewPart();
            String url = urlEntry.getKey();
            definitionPart.setUrl(url);
            XmlObject xmlObject = urlEntry.getValue();
            Node domNode = xmlObject.getDomNode();

            if (domNode.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) {
                Node node = domNode.getFirstChild();
                if (node.getNodeType() == Node.TEXT_NODE) {
                    domNode = XmlUtils.parseXml(node.getNodeValue());
                    xmlObject = XmlUtils.createXmlObject(domNode);
                }
            }

            Element contentElement = ((Document) domNode).getDocumentElement();

            Node newDomNode = definitionPart.addNewContent().getDomNode();
            newDomNode.appendChild(newDomNode.getOwnerDocument().createTextNode(xmlObject.toString()));
            definitionPart.setType(contentElement.getNamespaceURI());
        }

        return definitionCache;
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.config.DefintionPartConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.