Package javax.jcr.query

Examples of javax.jcr.query.RowIterator


        n2.setProperty("text", "bar");
        Node n3 = testRootNode.addNode("node3");
        n3.setProperty("text", "foo bar");
        superuser.save();
        String stmt = createStatement("foo -bar");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResult(rows, new Node[]{n1});
    }
View Full Code Here


        n2.setProperty("text", "apache jcr");
        Node n3 = testRootNode.addNode("node3");
        n3.setProperty("text", "jackrabbit jcr");
        superuser.save();
        String stmt = createStatement("apache jackrabbit OR jcr");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResult(rows, new Node[]{n1, n2});
    }
View Full Code Here

        // only nt:resource
        String stmt = createStatement("quick type:\"nt:resource\"");
        checkResultWithRetries(stmt, null, new Node[]{file.getNode("jcr:content")});
        // only nt:unstructured
        stmt = createStatement("quick type:\"nt:unstructured\"");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResult(rows, new Node[]{node});
    }
View Full Code Here

        Node node = testRootNode.addNode("node1");
        node.setProperty("text", SAMPLE_CONTENT);
        node.addMixin(mixReferenceable);
        superuser.save();
        String stmt = createStatement("quick type:referenceable");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResult(rows, new Node[]{node});
    }
View Full Code Here

        // only nt:resource
        String stmt = createStatement("quick type:resource");
        checkResultWithRetries(stmt, null, new Node[]{file.getNode("jcr:content")});
        // only nt:unstructured
        stmt = createStatement("quick type:unstructured");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResult(rows, new Node[]{node});
    }
View Full Code Here

    public void testExcerpt() throws RepositoryException {
        Node file = addFile(testRootNode, "file1.txt", SAMPLE_CONTENT);
        superuser.save();
        String stmt = createStatement("quick");
        checkResultWithRetries(stmt, "jcr:content", new Node[]{file});
        RowIterator rows = GQL.execute(stmt, superuser, "jcr:content");
        assertTrue("Expected result", rows.hasNext());
        String excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
        assertTrue("No excerpt returned", excerpt.startsWith("<div><span>"));
        stmt = createStatement("type:resource quick");
        rows = GQL.execute(stmt, superuser);
        assertTrue("Expected result", rows.hasNext());
        excerpt = rows.nextRow().getValue("rep:excerpt()").getString();
        assertTrue("No excerpt returned", excerpt.startsWith("<div><span>"));
    }
View Full Code Here

        n2.setProperty("jcr:title", "b");
        Node n3 = testRootNode.addNode("node3");
        n3.setProperty("jcr:title", "c");
        superuser.save();
        String stmt = createStatement("order:jcr:title");
        RowIterator rows = GQL.execute(stmt, superuser);
        checkResultSequence(rows, new Node[]{n1, n2, n3});
    }
View Full Code Here

        n2.setProperty("jcr:title", "b");
        Node n3 = testRootNode.addNode("node3");
        n3.setProperty("jcr:title", "c");
        superuser.save();
        String stmt = createStatement("order:jcr:title");
        RowIterator rows = GQL.execute(stmt, superuser, null, new GQL.Filter() {
            public boolean include(Row row) throws RepositoryException {
                return !n1.getPath().equals(row.getValue("jcr:path").getString());
            }
        });
        checkResultSequence(rows, new Node[]{n2, n3});
View Full Code Here

        n2.setProperty("jcr:title", "b");
        Node n3 = testRootNode.addNode("node3");
        n3.setProperty("jcr:title", "c");
        superuser.save();
        String stmt = createStatement("order:jcr:title limit:1");
        RowIterator rows = GQL.execute(stmt, superuser, null, new GQL.Filter() {
            public boolean include(Row row) throws RepositoryException {
                return !n1.getPath().equals(row.getValue("jcr:path").getString());
            }
        });
        checkResultSequence(rows, new Node[]{n2});
View Full Code Here

            descr.add(new ScoreValue(JcrConstants.JCR_SCORE, selectorName, vf));
            columnNames.add(JcrConstants.JCR_SCORE);
        }
        String[] selectorNames = createSelectorNames(descr);
        String[] colNames = columnNames.toArray(new String[columnNames.size()]);
        RowIterator rowIter = qResult.getRows();
        while (rowIter.hasNext()) {
            Row row = rowIter.nextRow();
            List<Value> values = new ArrayList<Value>();
            for (RowValue rv : descr) {
                values.add(rv.getValue(row));
            }
View Full Code Here

TOP

Related Classes of javax.jcr.query.RowIterator

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.