Search in sources :

Example 11 with Document

use of com.google.gwt.xml.client.Document in project data-access by pentaho.

the class DatasourceServiceManagerGwtImpl method convertReponseToList.

private List<String> convertReponseToList(Response response) {
    List<String> dataList = new ArrayList<String>();
    Document document = (Document) XMLParser.parse(response.getText());
    Element element = document.getDocumentElement();
    Node node = element.getFirstChild();
    boolean done = false;
    do {
        try {
            dataList.add(getNodeValueByTagName(node, "Item"));
            node = (node.getNextSibling() != null) ? node.getNextSibling() : null;
            if (node == null) {
                done = true;
            }
        } catch (Exception e) {
            done = true;
        }
    } while (!done);
    return dataList;
}
Also used : Element(com.google.gwt.xml.client.Element) Node(com.google.gwt.xml.client.Node) ArrayList(java.util.ArrayList) Document(com.google.gwt.xml.client.Document) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

Document (com.google.gwt.xml.client.Document)11 Element (com.google.gwt.xml.client.Element)8 Node (com.google.gwt.xml.client.Node)4 NodeList (com.google.gwt.xml.client.NodeList)4 RequestBuilder (com.google.gwt.http.client.RequestBuilder)3 RequestException (com.google.gwt.http.client.RequestException)3 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)3 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 Request (com.google.gwt.http.client.Request)2 RequestCallback (com.google.gwt.http.client.RequestCallback)2 Response (com.google.gwt.http.client.Response)2 FlexTable (com.google.gwt.user.client.ui.FlexTable)1 HTML (com.google.gwt.user.client.ui.HTML)1 Label (com.google.gwt.user.client.ui.Label)1 Text (com.google.gwt.xml.client.Text)1 List (java.util.List)1 DatabaseConnection (org.pentaho.database.model.DatabaseConnection)1 IDatabaseConnection (org.pentaho.database.model.IDatabaseConnection)1 IDialogCallback (org.pentaho.gwt.widgets.client.dialogs.IDialogCallback)1