Package org.wso2.carbon.utils.xml

Examples of org.wso2.carbon.utils.xml.XMLPrettyPrinter


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here


   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            env.serialize(baos);
            InputStream xmlIn = new ByteArrayInputStream(baos.toByteArray());
            String encoding =
                    (String) msgContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
            XMLPrettyPrinter xmlPrettyPrinter = new XMLPrettyPrinter(xmlIn, encoding);
            xml = xmlPrettyPrinter.xmlFormat();
        } catch (Throwable e) {
            String error = "Error occurred while pretty printing message. " + e.getMessage();
            log.error(error, e);
            xml = error;
        }
View Full Code Here

    }

    public static String parseSequenceToPrettyfiedString(SequenceMediator sequence) {
        ByteArrayInputStream byteArrayInputStream
                = new ByteArrayInputStream(parseSequenceToString(sequence).getBytes());
        XMLPrettyPrinter printer = new XMLPrettyPrinter(byteArrayInputStream);
        return printer.xmlFormat();
    }
View Full Code Here

    public static String parseAnonSequenceToPrettyfiedString(SequenceMediator seqMediator,
                                                             String targetSeqName) {
        OMElement elem = parseAnonSequenceToOM(seqMediator);
        elem.setLocalName(targetSeqName + "Sequence");
        ByteArrayInputStream stream = new ByteArrayInputStream(elem.toString().getBytes());
        XMLPrettyPrinter printer = new XMLPrettyPrinter(stream);
        return printer.xmlFormat();
    }
View Full Code Here

        return printer.xmlFormat();
    }
    public static String parseAnonSequenceToPrettyfiedString(SequenceMediator seqMediator) {
        OMElement elem = parseAnonSequenceToOM(seqMediator);
        ByteArrayInputStream stream = new ByteArrayInputStream(elem.toString().getBytes());
        XMLPrettyPrinter printer = new XMLPrettyPrinter(stream);
        return printer.xmlFormat();
    }
View Full Code Here

    public static String serializeMediator(Mediator mediator) throws SequenceEditorException {
        OMElement ele = mediator.serialize(null);
        if (ele != null) {
            ByteArrayInputStream byteArrayInputStream
                = new ByteArrayInputStream(ele.toString().getBytes());
            XMLPrettyPrinter printer = new XMLPrettyPrinter(byteArrayInputStream);
            return printer.xmlFormat();
        }
        return null;
    }
View Full Code Here

                            StAXUtils.createXMLStreamReader(
                                    new ByteArrayInputStream(operationParameter.getBytes()));
                    OMElement paramEle = new StAXOMBuilder(xmlSR).getDocumentElement();
                    String paramName = paramEle.getAttribute(new QName("name")).getAttributeValue();
                    InputStream xmlIn = new ByteArrayInputStream(operationParameter.getBytes());
                    XMLPrettyPrinter xmlPrettyPrinter = new XMLPrettyPrinter(xmlIn, null);
                    Parameter parameter = new Parameter(paramName,
                                                        xmlPrettyPrinter.xmlFormat());
                    boolean isLocked = false;
                    OMAttribute lockedAttrib = paramEle.getAttribute(new QName("locked"));
                    if (lockedAttrib != null) {
                        isLocked = "true".equals(lockedAttrib.getAttributeValue());
                    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.utils.xml.XMLPrettyPrinter

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.