Package com.google.gwt.xml.client

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


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

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


    /**
     * Generate xml elements of mr 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 <job-xml>
View Full Code Here

     * @param root xml element under which configuration tag is added
     * @param doc xml document
     */
    protected void configToXML(List<Property> list, Element root, Document doc) {

        Element confEle = null;

        for (Property prop : list) {
            if (prop.getName() != null && !prop.getName().matches("\\s*") && prop.getValue() != null
                    && !prop.getValue().matches("\\s*")) {

                if (confEle == null) {
                    confEle = doc.createElement("configuration");
                    root.appendChild(confEle);
                }

                // create <property>
                Element propEle = doc.createElement("property");
                confEle.appendChild(propEle);

                // create <name>
                Element nameEle = doc.createElement("name");
                propEle.appendChild(nameEle);
                nameEle.appendChild(doc.createTextNode(prop.getName()));

                // create <value>
                Element valEle = doc.createElement("value");
                propEle.appendChild(valEle);
                valEle.appendChild(doc.createTextNode(prop.getValue()));
            }
        }

    }
View Full Code Here

     * @param root xml element under which prepare tag is added
     * @param doc xml document
     */
    protected void prepareToXML(List<Property> list, Element root, Document doc) {

        Element prepareEle = null;
        for (Property prop : list) {
            if (prop.getName() != null && !prop.getName().matches("\\s*") && prop.getValue() != null
                    && !prop.getValue().matches("\\s*")) {

                if (prepareEle == null) {
                    prepareEle = doc.createElement("prepare");
                    root.appendChild(prepareEle);
                }

                // create <delete> or <mkdir>
                Element ele = null;
                if (prop.getName().equals("delete")) {
                    ele = doc.createElement("delete");
                }
                else if (prop.getName().equals("mkdir")) {
                    ele = doc.createElement("mkdir");
                }
                ele.setAttribute("path", prop.getValue());
                prepareEle.appendChild(ele);
            }
        }
    }
View Full Code Here

        for (Property prop : list) {
            if (prop.getName() != null && !prop.getName().matches("\\s*") && prop.getValue() != null
                    && !prop.getValue().matches("\\s*")) {
                if (prop.getName().equals(key)) {
                    // create key element
                    Element nameEle = doc.createElement(key);
                    root.appendChild(nameEle);

                    // create text node under created element
                    Text valEle = doc.createTextNode(prop.getValue());
                    nameEle.appendChild(valEle);
                }
            }
        }
    }
View Full Code Here

     * @param tag tag name
     * @param box textbox
     * @return
     */
    protected Element generateElement(Document doc, String tag, TextBox box) {
        Element ele = doc.createElement(tag);
        Text t = doc.createTextNode(box.getText());
        ele.appendChild(t);
        return ele;
    }
View Full Code Here

     * @param doc xml document
     * @param next next node widget to be executed after this in workflow
     * @return
     */
    protected Element generateOKElement(Document doc, NodeWidget next) {
        Element okEle = doc.createElement("ok");
        okEle.setAttribute("to", next.getName());
        return okEle;
    }
View Full Code Here

     *
     * @param doc xml document
     * @return
     */
    protected Element generateErrorElement(Document doc) {
        Element errEle = doc.createElement("error");
        NodeWidget kill = getKillNode();
        errEle.setAttribute("to", kill == null ? "" : kill.getName());
        return errEle;
    }
View Full Code Here

    /**
     * Generate xml elements of ssh 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 <ssh>
        Element sshEle = doc.createElement("ssh");
        action.appendChild(sshEle);

        // create <host>
        sshEle.appendChild(generateElement(doc, "host", host));

        // create <command>
        sshEle.appendChild(generateElement(doc, "command", command));

        // create <args>
        for (String arg : args) {
            Element argsEle = doc.createElement("args");
            Text n = doc.createTextNode(arg);
            argsEle.appendChild(n);
            sshEle.appendChild(argsEle);

        }

        // create <capture-output>
        if (rby.getValue()) {
            Element outputele = doc.createElement("capture-output");
            sshEle.appendChild(outputele);
        }

        // create <ok>
        action.appendChild(generateOKElement(doc, next));
View Full Code Here

    /**
     * Generate xml elements of shell 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 <shell>
        Element shellEle = doc.createElement("shell");
        action.appendChild(shellEle);

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

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

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

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

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

        // create <exec>
        shellEle.appendChild(generateElement(doc, "exec", exec));

        // create <argument>
        filterListToXML(others, shellEle, doc, "argument");

        // create <env-var>
        filterListToXML(others, shellEle, doc, "env-var");

        // create <file>
        filterListToXML(others, shellEle, doc, "file");

        // create <archive>
        filterListToXML(others, shellEle, doc, "archive");

        // create <capture-output>
        if (rby.getValue()) {
            Element outputele = doc.createElement("capture-output");
            shellEle.appendChild(outputele);
        }

        // create <ok>
        action.appendChild(generateOKElement(doc, next));
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.