Package org.serviceconnector.web.cmd

Examples of org.serviceconnector.web.cmd.WebCommand$XMLDocument


                Element rootElement = document.createElement(name);
                document.appendChild(rootElement);
                return document;
            }

            XMLDocument xmlDocument = (XMLDocument)createDocument();
            Element rootElement = xmlDocument.createElement(name);
            xmlDocument.appendChild(rootElement);
            xmlDocument.setDoctype(name, systemIdentifier, null);
            return xmlDocument;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    }
View Full Code Here


        transform(source, result);
    }

    public void transform(Node sourceNode, Writer resultWriter) throws XMLPlatformException {
        try {
            XMLDocument xmlDocument;
            if (sourceNode.getNodeType() == Node.DOCUMENT_NODE) {
                xmlDocument = (XMLDocument)sourceNode;
            } else {
                xmlDocument = (XMLDocument)sourceNode.getOwnerDocument();
            }

            if (isFragment()) {
                xmlDocument.setEncoding(null);
                xmlDocument.setVersion(null);
            } else {
                xmlDocument.setEncoding(getEncoding());
                xmlDocument.setVersion(getVersion());
            }

            XMLNode xmlNode = (XMLNode)sourceNode;
            PrintWriter printWriter = new PrintWriter(resultWriter);
            XDKPrintDriver xdkPrintDriver = new XDKPrintDriver(printWriter);
View Full Code Here

    public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException {
        try {
            XSLProcessor xslProcessor = new XSLProcessor();
            XSLStylesheet xslStylesheet = xslProcessor.newXSLStylesheet(stylesheet);
            XMLDocument xmlDocument = (XMLDocument)sourceDocument;
            XMLDocumentFragment resultDocumentFragment = xslProcessor.processXSL(xslStylesheet, xmlDocument);
            resultParentNode.appendChild(resultDocumentFragment);
        } catch (XSLException e) {
            throw XMLPlatformException.xmlPlatformTransformException(e);
        }
View Full Code Here

    HttpRequest httpRequest = (HttpRequest) event.getMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    IWebRequest webRequest = new NettyWebRequest(httpRequest, localAddress, remoteAddress);
    IWebResponse webResponse = new NettyWebResponse(httpResponse);
    WebCommand webCommand = WebContext.getWebCommand();
    webCommand.run(webRequest, webResponse);
    ChannelBuffer buffer = ChannelBuffers.copiedBuffer(webResponse.getBytes());
    httpResponse.setContent(buffer);
    httpResponse.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.readableBytes()));
    // Write the response.
    event.getChannel().write(httpResponse);
View Full Code Here

    HttpRequest httpRequest = (HttpRequest) event.getMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    IWebRequest webRequest = new NettyWebRequest(httpRequest, localAddress, remoteAddress);
    IWebResponse webResponse = new NettyWebResponse(httpResponse);
    WebCommand webCommand = WebContext.getWebCommand();
    webCommand.run(webRequest, webResponse);
    ChannelBuffer buffer = ChannelBuffers.copiedBuffer(webResponse.getBytes());
    httpResponse.setContent(buffer);
    httpResponse.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.readableBytes()));
    // Write the response.
    event.getChannel().write(httpResponse);
View Full Code Here

TOP

Related Classes of org.serviceconnector.web.cmd.WebCommand$XMLDocument

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.