private Definition readWsdl( WSDLReader wsdlReader, String uri, String username, String password ) throws WSDLException, KettleException, AuthenticationException { try { HTTPProtocol http = new HTTPProtocol(); Document doc = XMLHandler.loadXMLString( http.get( wsdlURI.toString(), username, password ), true, false ); if ( doc != null ) { return ( wsdlReader.readWSDL( doc.getBaseURI(), doc ) ); } else { throw new KettleException( "Unable to get document." ); } } catch ( MalformedURLException mue ) { throw new KettleException( mue ); } catch ( AuthenticationException ae ) { // re-throw this. If not IOException seems to catch it throw ae; } catch ( IOException ioe ) { throw new KettleException( ioe ); } }
public String getBaseURI() { return this.doc.getBaseURI(); }
/** * @inheritDoc */ public String getBaseURI() { return dom.getBaseURI(); }
@Override public String getBaseURI() { return original_.getBaseURI(); }
public String getBaseURI() { return document.getBaseURI(); }
@Override public String getBaseURI() { return original_.getBaseURI(); }
@Override public String getBaseURI() { return document.getBaseURI(); }
public String getBaseURI() { return document.getBaseURI(); }
BrowserFieldListener list = new BrowserFieldListener() { public void documentLoaded(BrowserField browserField, Document document) throws Exception { String url = document.getBaseURI(); //u can get the current url here... u can use ur logic to get the url after clicking the submit button Serverconnection(url);//from this methode u can get the response } }; browserField.addListener(list);
@Override public String getBaseURI() { return document.getDomDocument().getBaseURI(); }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element newElement; String baseURI; doc = (Document) load("barfoo", false); newElement = doc.createElementNS("http://www.w3.org/1999/xhtml", "br"); baseURI = doc.getBaseURI(); assertNotNull("nodegetbaseuri06", baseURI); } /**
public Description readWSDL(Document doc, Map<URI, AbsItfDescription> descriptionImports, Map<URI, AbsItfSchema> schemaImports) throws WSDLException { Description desc = null; try { URI uri = null; if (doc.getBaseURI() != null) { uri = new URI(doc.getBaseURI()); } else { uri = new URI("."); } WSDLVersionConstants version = Util.getVersionInDocument(doc); desc = this.readWSDL(uri, version, SourceHelper.convertDOMSource2InputSource(new DOMSource(doc)), descriptionImports, schemaImports); } catch (URISyntaxException e) { throw new WSDLException(e); } catch (XmlException e) { throw new WSDLException(e); } return desc; }
Policy resolveReference(PolicyReference ref, Document doc) { Policy p = null; if (isExternal(ref)) { p = resolveExternal(ref, doc.getBaseURI()); } else { p = resolveLocal(ref, doc); } checkResolved(ref, p); return p; }
Policy resolveReference(PolicyReference ref, Document doc) { Policy p = null; if (isExternal(ref)) { p = resolveExternal(ref, doc.getBaseURI()); } else { p = resolveLocal(ref, doc); } checkResolved(ref, p); return p; }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; String baseURI; String documentURI; doc = (Document) load("barfoo", false); baseURI = doc.getBaseURI(); assertURIEquals("notNull", null, null, null, null, "barfoo", null, null, Boolean.TRUE, baseURI); documentURI = doc.getDocumentURI(); assertEquals("sameAsDocumentURI", documentURI, baseURI); } /**
Policy resolveLocal(PolicyReference ref, Document doc) { String relativeURI = ref.getURI().substring(1); String absoluteURI = doc.getBaseURI() + ref.getURI(); Policy resolved = registry.lookup(absoluteURI); if (null != resolved) { return resolved; } ReferenceResolver resolver = new LocalDocumentReferenceResolver(doc, builder); resolved = resolver.resolveReference(relativeURI); if (null != resolved) { ref.setURI(absoluteURI); registry.register(absoluteURI, resolved); } return resolved; }
Policy resolveLocal(PolicyReference ref, Document doc) { String relativeURI = ref.getURI().substring(1); String absoluteURI = doc.getBaseURI() + ref.getURI(); Policy resolved = registry.lookup(absoluteURI); if (null != resolved) { return resolved; } ReferenceResolver resolver = new LocalDocumentReferenceResolver(doc, builder); resolved = resolver.resolveReference(relativeURI); if (null != resolved) { ref.setURI(absoluteURI); registry.register(absoluteURI, resolved); } return resolved; }
@Override public <X extends XmlObject> X readDocument(Document document, Class<X> xmlObjectInterfaceClass) throws XmlObjectReadException { try { Binder<Node> binder = newBinder(); Object unmarshalled = binder.unmarshal(document); AbstractJaxbModelObject jaxbModelObject = asAbstractJaxbObject(unmarshalled); jaxbModelObject.setBinder(binder); XmlObject newXmlObject = (XmlObject) xmlContext.getXmlObjectFactory().wrap(jaxbModelObject); finalizeReading(newXmlObject, document.getBaseURI()); return xmlObjectInterfaceClass.cast(newXmlObject); } catch (JAXBException je) { throw new XmlObjectReadException(je); } }
/** * Finds shared styles occurring in a kml:Document container. The resulting * collection ({@code Set<String>}) of style identifiers is set as the value * of the suite attribute {@link SuiteAttribute#SHARED_STYLES}. * * @param testContext * Information about the test run. */ @BeforeSuite public void findSharedStyles(ITestContext testContext) { Document kmlDoc = (Document) testContext.getSuite().getAttribute( SuiteAttribute.TEST_SUBJECT.getName()); Source kmlSource = new DOMSource(kmlDoc, kmlDoc.getBaseURI()); Set<String> sharedStyles = KMLUtils.findElementIdentifiers(kmlSource, "//kml:Document/kml:Style | //kml:Document/kml:StyleMap"); testContext.getSuite().setAttribute( SuiteAttribute.SHARED_STYLES.getName(), sharedStyles); }
/** * Finds custom schemas (kml:Schema) defined in a kml:Document container. * The resulting collection ({@code Set<String>}) of schema identifiers is * set as the value of the suite attribute * {@link SuiteAttribute#CUSTOM_SCHEMAS}. * * @param testContext * Information about the test run. */ @BeforeSuite public void findCustomSchemas(ITestContext testContext) { Document kmlDoc = (Document) testContext.getSuite().getAttribute( SuiteAttribute.TEST_SUBJECT.getName()); Source kmlSource = new DOMSource(kmlDoc, kmlDoc.getBaseURI()); Set<String> customSchemas = KMLUtils.findElementIdentifiers(kmlSource, "//kml:Document/kml:Schema"); testContext.getSuite().setAttribute( SuiteAttribute.CUSTOM_SCHEMAS.getName(), customSchemas); }