Package org.apache.xindice.client.xmldb

Examples of org.apache.xindice.client.xmldb.ResourceSetImpl


            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(
                new InputSource(new StringReader(result)));
           
            NodeList nodes = resultDoc.getDocumentElement().getChildNodes();
            ResourceSetImpl rs = new ResourceSetImpl(this, null);
           
            for (int i = 0; i < nodes.getLength(); i++) {
               
                Node n = nodes.item(i);
           
                String documentId = ((Element) n).getAttributeNS(
                        QUERY_NS, "key");          
                XMLResourceImpl resource = new XMLResourceImpl(null,
                        documentId, this, TextWriter.toString(n));
                rs.addResource(resource);
            }
        
            return rs;
        } catch (Exception e) {
           
View Full Code Here


            }
            else {
               result = col.queryCollection(queryLang, query, namespaces);
            }
           
            ResourceSetImpl rs = new ResourceSetImpl(this, null);

            while (result.hasMoreNodes()) {

               Node n = result.getNextNode();
               if ( n instanceof DBNode ) {
                  ( ( DBNode ) n ).expandSource();
               }

               String documentId = ((Element) n).getAttributeNS(QUERY_NS, "key");

               XMLResourceImpl resource = new XMLResourceImpl(null, documentId, this,
                    TextWriter.toString( n ));
               rs.addResource(resource);
            }
        
            return rs;
        } catch (Exception e) {           
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
View Full Code Here

            String result = (String) runRemoteCommand("Query", params);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(result)));

            ResourceSetImpl rs = new ResourceSetImpl(this, resultDoc);

            return rs;
        } catch (Exception e) {
            e.printStackTrace();
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
View Full Code Here

                result = col.queryDocument(queryLang, query, createNamespaceMap(nsMap), name);
            } else {
                result = col.queryCollection(queryLang, query, createNamespaceMap(nsMap));
            }

            return new ResourceSetImpl(this, nodesetToDocument(result));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR,
                                                  "Query error: " + e.getMessage(), e);
        }
    }
View Full Code Here

                nodeSet = col.queryDocument(queryLang, query, QueryUtil.mapNamespaces(nsMap), name);
            } else {
                nodeSet = col.queryCollection(queryLang, query, QueryUtil.mapNamespaces(nsMap));
            }

            return new ResourceSetImpl(this, QueryUtil.queryResultsToDOM(nodeSet));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR,
                                                  "Query error: " + e.getMessage(), e);
        }
    }
View Full Code Here

                nodeSet = col.queryDocument(queryLang, query, QueryUtil.mapNamespaces(nsMap), name);
            } else {
                nodeSet = col.queryCollection(queryLang, query, QueryUtil.mapNamespaces(nsMap));
            }

            return new ResourceSetImpl(this, QueryUtil.queryResultsToDOM(nodeSet));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR,
                                                  "Query error: " + e.getMessage(), e);
        }
    }
View Full Code Here

            String result = (String) runRemoteCommand("Query", params);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(result)));

            ResourceSetImpl rs = new ResourceSetImpl(this, resultDoc);
            return rs;
        } catch (Exception e) {
            e.printStackTrace();
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
        }
View Full Code Here

            String result = (String) runRemoteCommand("Query", params);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(result)));

            return new ResourceSetImpl(this, resultDoc);
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
        }
    }
View Full Code Here

                nodeSet = col.queryDocument(queryLang, query, QueryUtil.mapNamespaces(nsMap), name);
            } else {
                nodeSet = col.queryCollection(queryLang, query, QueryUtil.mapNamespaces(nsMap));
            }

            return new ResourceSetImpl(this, QueryUtil.queryResultsToDOM(nodeSet));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR,
                                                  "Query error: " + e.getMessage(), e);
        }
    }
View Full Code Here

            String result = (String) runRemoteCommand("Query", params);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(result)));

            ResourceSetImpl rs = new ResourceSetImpl(this, resultDoc);
            return rs;
        } catch (Exception e) {
            e.printStackTrace();
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
        }
View Full Code Here

TOP

Related Classes of org.apache.xindice.client.xmldb.ResourceSetImpl

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.