Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.Element


    /**
     * Generate xml elements of pig action and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("action");
        action.setAttribute("name", current.getName());

        // create <pig>
        Element pigEle = doc.createElement("pig");
        action.appendChild(pigEle);

        // create <job-tracker>
        pigEle.appendChild(generateElement(doc, "job-tracker", jt));

        // create <name-node>
        pigEle.appendChild(generateElement(doc, "name-node", nn));

        // create <prepare>
        prepareToXML(prepare, pigEle, doc);

        // create <job-xml>
        filterListToXML(others, pigEle, doc, "job-xml");

        // create <configuration>
        configToXML(configs, pigEle, doc);

        // create <script>
        pigEle.appendChild(generateElement(doc, "script", script));

        // create <param>
        filterListToXML(others, pigEle, doc, "param");

        // create <argument>
View Full Code Here


    /**
     * Generate xml elements of fs action and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("action");
        action.setAttribute("name", current.getName());

        Element fsEle = doc.createElement("fs");
        action.appendChild(fsEle);

        // create <delete>
        fsDataListToXML(fsdata, fsEle, doc, "delete");

View Full Code Here

                    flag = false;
                }

                if (flag) {
                    // create key element
                    Element nameele = doc.createElement(key);
                    root.appendChild(nameele);

                    // set attribute for parameter(s)
                    for (Map.Entry<String, String> e : params.entrySet()) {
                        nameele.setAttribute(e.getKey(), e.getValue());
                    }
                }
            }
        }
View Full Code Here

    /**
     * Generate xml elements of pipes action and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("action");
        action.setAttribute("name", current.getName());

        // create <map-reduce>
        Element mrEle = doc.createElement("map-reduce");
        action.appendChild(mrEle);

        // create <job-tracker>
        mrEle.appendChild(generateElement(doc, "job-tracker", jt));

        // create <name-node>
        mrEle.appendChild(generateElement(doc, "name-node", nn));

        // create <prepare>
        prepareToXML(prepare, mrEle, doc);

        // create <pipes>
        Element pipesEle = null;
        pipesEle = filterListToXML(pipes, mrEle, pipesEle, doc, "map");
        pipesEle = filterListToXML(pipes, mrEle, pipesEle, doc, "reduce");
        pipesEle = filterListToXML(pipes, mrEle, pipesEle, doc, "inputformat");
        pipesEle = filterListToXML(pipes, mrEle, pipesEle, doc, "partitioner");
        pipesEle = filterListToXML(pipes, mrEle, pipesEle, doc, "writer");
View Full Code Here

                    if (pipes == null) {
                        pipes = doc.createElement("pipes");
                        root.appendChild(pipes);
                    }
                    // create key element
                    Element nameele = doc.createElement(key);
                    pipes.appendChild(nameele);

                    // create text node under created element
                    Text valele = doc.createTextNode(prop.getValue());
                    nameele.appendChild(valele);
                }
            }
        }
        return pipes;
    }
View Full Code Here

    /**
     * Generate xml elements of subworkflow action and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("action");
        action.setAttribute("name", current.getName());

        // create <sub-workflow>
        Element subwfEle = doc.createElement("sub-workflow");
        action.appendChild(subwfEle);

        // create <app-path>
        subwfEle.appendChild(generateElement(doc, "app-path", apppath));

        // create <propagate-configuration>
        if (rby.getValue()) {
            Element proele = doc.createElement("propagate-configuration");
            subwfEle.appendChild(proele);
        }

        // create <configuration>
        configToXML(configs, subwfEle, doc);
View Full Code Here

    /**
     * Generate xml elements of email action and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("action");
        action.setAttribute("name", current.getName());

        // create <email>
        Element emailEle = doc.createElement("email");
        action.appendChild(emailEle);

        // create <to>
        emailEle.appendChild(generateElement(doc, "to", to));

        // create <cc>
        emailEle.appendChild(generateElement(doc, "cc", cc));

        // create <subject>
        emailEle.appendChild(generateElement(doc, "subject", subject));

        // create <body>
        emailEle.appendChild(generateElement(doc, "body", body));

        // create <ok>
        action.appendChild(generateOKElement(doc, next));

        // create <error>
View Full Code Here

        if (namespace != null && namespace.getSelectedIndex() < 3) {
            return;
        }

        // create <global>
        Element globalEle = doc.createElement("global");

        // create <job-tracker>
        if (jt.getText() != null && !jt.getText().matches("\\s*")) {
            globalEle.appendChild(generateElement(doc, "job-tracker", jt));
        }

        // create <name-node>
        if (nn.getText() != null && !nn.getText().matches("\\s*")) {
            globalEle.appendChild(generateElement(doc, "name-node", nn));
        }

        // create <configuration>
        configToXML(configs, globalEle, doc);

        // add <global> only when child nodes exist(if not, do not put <global>)
        if (globalEle.hasChildNodes()) {
            root.appendChild(globalEle);
        }
    }
View Full Code Here

    /**
     * Generate xml elements of decision node and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("decision");
        action.setAttribute("name", name.getText());
        Element switchele = doc.createElement("switch");
        action.appendChild(switchele);
        for (SwitchCase ca : cases) {
            boolean isDefault = false;
            Connection conn = ca.getConnection();
            if (conn.getDecoration() != null) {
                isDefault = true;
            }
            if (isDefault) {
                Element defEle = doc.createElement("default");
                defEle.setAttribute("to", ca.getWidget().getName());
                switchele.appendChild(defEle);
            }
            else {
                Element caseEle = doc.createElement("case");
                caseEle.setAttribute("to", ca.getWidget().getName());
                Text txt = doc.createTextNode(ca.getPreDicate());
                caseEle.appendChild(txt);
                switchele.appendChild(caseEle);
            }
        }
        root.appendChild(action);
    }
View Full Code Here

    /**
     * Generate xml elements of end node and attach them to xml doc
     */
    public void generateXML(Document doc, Element root, NodeWidget next) {

        Element action = doc.createElement("end");
        action.setAttribute("name", name.getText());
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.Element

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.