Package javax.jcr.query

Examples of javax.jcr.query.Row


         * Fetches the next {@link Row}.
         */
        private void fetchNext() {
            next = null;
            while (next == null && rows.hasNext()) {
                Row r = rows.nextRow();
                try {
                    if (filter.include(r)) {
                        next = r;
                        return;
                    }
View Full Code Here


            int currentNode = 0;
            int addedNodes = 0;

            ScoreNode node = hits.nextScoreNode();
            while (node != null) {
                Row row = null;
                try {
                    row = new SelectorRow(columns, evaluator,
                            selector.getSelectorName(),
                            session.getNodeById(node.getNodeId()),
                            node.getScore());
View Full Code Here

        }
        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));
            }

            /*
             * get the path for the first selector and build a webdav compliant
             * resource path based on it.
             *
             * Use Row#getPath(String) which works for both simple rows and join
             * rows (in contrast to Row#getPath()).
             *
             * see also https://issues.apache.org/jira/browse/JCR-3089
             */
            final String itemPath = row.getPath(sn.get(0));
            // create a new ms-response for this row of the result set
            DavResourceLocator loc = locator.getFactory().createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), itemPath, false);
            String href = loc.getHref(true);
            MultiStatusResponse resp = new MultiStatusResponse(href, null);
            // build the s-r-property
View Full Code Here

     */
    protected void checkResult(RowIterator result, Node[] nodes)
            throws RepositoryException {
        checkResult(new NodeIteratorAdapter(result) {
            public Object next() throws NoSuchElementException {
                Row next = (Row) super.next();
                try {
                    return superuser.getItem(next.getValue("jcr:path").getString());
                } catch (RepositoryException e) {
                    throw new NoSuchElementException();
                }
            }
        }, nodes);
View Full Code Here

      Session session = ((JackConnection)parent.getConnection()).getSession();
      QueryManager qm = session.getWorkspace().getQueryManager();
      Query query = qm.createQuery("/jcr:root/apps//element(*,sling:Folder)", Query.XPATH);
      QueryResult res = query.execute();
      for (RowIterator iter = res.getRows(); iter.hasNext();) {
        Row row = iter.nextRow();
        Value path = row.getValue("jcr:path");
       
        names.add(path.getString());
        uniq.add(path.getString());
       
      }
View Full Code Here

    @Override
    protected CaoElement nextElement() throws CaoException {
      // return new JackElement(list.getApplication(),rows.nextRow(),null);
      MutableElement out = new MutableElement(list.getApplication());
      out.setMetadata(list.meta);
      Row row = rows.nextRow();
      for (CaoMetaDefinition m : list.meta) {
        try {
          out.setString(m.getName(), row.getValue(m.getName()).getString());
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
      return out;
View Full Code Here

         {
            List<String> ids = new ArrayList<String>(size != -1 ? (int)size : 7);

            while (rows.hasNext())
            {
               final Row row = rows.nextRow();
               final Value rowValue = row.getValue("producerid");
               ids.add(rowValue.getString());
            }

            return ids;
         }
View Full Code Here

     */
    protected void checkValue(RowIterator itr,
                              String propertyName,
                              String expectedValue) throws RepositoryException {
        while (itr.hasNext()) {
            Row row = itr.nextRow();
            // check fullText
            Value value = row.getValue(propertyName);
            if (value == null) {
                fail("Search Test: fails result does not contain value for selected property");
            }
            assertEquals("Value in query result row does not match expected value",
                    expectedValue, value.getString());
View Full Code Here

        checkResult(result, 1);

        // evaluate result
        RowIterator itr = result.getRows();
        while (itr.hasNext()) {
            Row row = itr.nextRow();
            Value value = row.getValue(propertyName1);
            if (value != null) {
                String fullText = value.getString();
                if (fullText.indexOf("cat") > 0) {
                    fail("Search Text: full text search not correct, returned prohibited text");
                }
View Full Code Here

        checkResult(result, 1);

        // evaluate result
        RowIterator itr = result.getRows();
        while (itr.hasNext()) {
            Row row = itr.nextRow();
            Value value = row.getValue(propertyName1);
            if (value != null) {
                String fullText = value.getString();
                if (fullText.indexOf("cat") > 0) {
                    fail("Search Text: full text search not correct, returned prohibited text");
                }
View Full Code Here

TOP

Related Classes of javax.jcr.query.Row

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.