Package com.google.gwt.xml.client

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


   */
  protected List<String> getNames( final Document fileInfo, int type ) {
    List<String> names = new ArrayList<String>();
    NodeList aces = fileInfo.getElementsByTagName( ACES_ELEMENT_NAME );
    for ( int i = 0; i < aces.getLength(); i++ ) {
      Element ace = (Element) aces.item( i );
      NodeList recipientTypeList = ace.getElementsByTagName( RECIPIENT_TYPE_ELEMENT_NAME );
      Node recipientNode = recipientTypeList.item( 0 );
      String nodeValue = recipientNode.getFirstChild().getNodeValue();
      int recipientType = Integer.parseInt( nodeValue );
      if ( recipientType == type ) {
        names.add( ace.getElementsByTagName( RECIPIENT_ELEMENT_NAME ).item( 0 ).getFirstChild().getNodeValue() );
      }
    }
    return names;
  }
View Full Code Here


   */
  private List<Integer> getPermissionsForUserOrRole( Document fileInfo, String recipient, String recipientType ) {
    List<Integer> values = new ArrayList<Integer>();
    NodeList aces = fileInfo.getElementsByTagName( ACES_ELEMENT_NAME );
    for ( int i = 0; i < aces.getLength(); i++ ) {
      Element ace = (Element) aces.item( i );
      if ( ace.getElementsByTagName( RECIPIENT_ELEMENT_NAME ).item( 0 ).getFirstChild().getNodeValue().equals(
          recipient ) && ace.getElementsByTagName( RECIPIENT_TYPE_ELEMENT_NAME ).item( 0 ).getFirstChild().getNodeValue().equals(
          recipientType ) ) {
        NodeList permissions = ace.getElementsByTagName( PERMISSIONS_ELEMENT_NAME );
        for ( int j = 0; j < permissions.getLength(); j++ ) {
          if ( permissions.item( j ).getFirstChild() != null ) {
            values.add( new Integer( permissions.item( j ).getFirstChild().getNodeValue() ) );           
          }
        }
View Full Code Here

    NodeList list = doc.getElementsByTagName(modelType.getRecordName());
    ArrayList<ModelData> records = new ArrayList<ModelData>();
    for (int i = 0; i < list.getLength(); i++) {
      Node node = list.item(i);
      Element elem = (Element) node;
      ModelData model = newModelInstance();
      for (int j = 0; j < modelType.getFieldCount(); j++) {
        DataField field = modelType.getField(j);
        Class type = field.getType();
        String name = field.getName();
View Full Code Here

    NodeList list = doc.getElementsByTagName(modelType.getRecordName());
    ArrayList<ModelData> records = new ArrayList<ModelData>();
    for (int i = 0; i < list.getLength(); i++) {
      Node node = list.item(i);
      Element elem = (Element) node;
      ModelData model = newModelInstance();
      for (int j = 0; j < modelType.getFieldCount(); j++) {
        DataField field = modelType.getField(j);
        Class type = field.getType();
        String name = field.getName();
View Full Code Here

    NodeList list = doc.getElementsByTagName(modelType.recordName);
    ArrayList<ModelData> records = new ArrayList<ModelData>();
    for (int i = 0; i < list.getLength(); i++) {
      Node node = list.item(i);
      Element elem = (Element) node;
      ModelData model = newModelInstance();
      for (int j = 0; j < modelType.getFieldCount(); j++) {
        DataField field = modelType.getField(j);
        String map = field.map != null ? field.map : field.name;
        String v = getValue(elem, map);
View Full Code Here

        String appname = "visualizationApp";
        if (wrkflowtable != null) {
            appname = wrkflowtable.getName();
        }
        Element root = xmldoc.createElement("workflow-app");
        root.setAttribute("xmlns", wrkflowtable.getNameSpace());
        root.setAttribute("name", appname);
        xmldoc.appendChild(root);

        wrkflowtable.generateXML(xmldoc, root, null);

        for (Connection c : this.connections) {
View Full Code Here

    /**
     * Generate xml elements of end node and attach them to xml doc
     */
    @Override
    public void generateXML(Document doc, Element root, NodeWidget next) {
        Element endele = doc.createElement("end");
        endele.setAttribute("name", getName());
        root.appendChild(endele);
    }
View Full Code Here

    /**
     * Generate xml elements of start node and attach them to xml doc
     */
    @Override
    public void generateXML(Document doc, Element root, NodeWidget next) {
        Element startele = doc.createElement("start");
        startele.setAttribute("to", next.getName());
        root.appendChild(startele);
    }
View Full Code Here

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

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

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

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

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

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

        // create <main-class>
        javaEle.appendChild(generateElement(doc, "main-class", mainClass));

        // create <java-opts>
        filterListToXML(others, javaEle, doc, "java-opts");

        // create <arg>
        filterListToXML(others, javaEle, doc, "arg");

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

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

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

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

    /**
     * Generate xml elements of streaming 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 <streaming>
        Element streamEle = null;
        streamEle = filterListToXML(streaming, mrEle, streamEle, doc, "mapper");
        streamEle = filterListToXML(streaming, mrEle, streamEle, doc, "reducer");
        streamEle = filterListToXML(streaming, mrEle, streamEle, doc, "record-reader");
        streamEle = filterListToXML(streaming, mrEle, streamEle, doc, "record-reader-mapping");
        streamEle = filterListToXML(streaming, mrEle, streamEle, doc, "env");
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.