protected Collection<String> fetchQueryResults(String query, Map<String, Object> params, Properties props) throws Exception { List<String> result = new ArrayList<>(); try (ResultCursor<XQItemAccessor> cursor = query(query, params, props)) { for (XQItemAccessor item: cursor) { result.add(item.getAtomicValue()); } } return result; }
private Collection<String> toCollection(ResultCursor<XQItemAccessor> cursor) throws BagriException { if (cursor == null) { return null; } try { List<String> result = new ArrayList<>(); for (XQItemAccessor item: cursor) { result.add(item.getAtomicValue()); } return result; } catch (XQException ex) { throw new BagriException(ex, BagriException.ecQuery); } }
if (command.equals(cmd_store_document)) { XQItemAccessor item = getBoundItem(params, "uri"); String uri = item.getAtomicValue(); item = getBoundItem(params, "doc"); String xml = item.getItemAsString(null); } else if (command.equals(cmd_remove_document)) { XQItemAccessor item = getBoundItem(params, "uri"); String uri = item.getAtomicValue(); dMgr.removeDocument(uri, null); return Collections.emptyIterator();
DocumentKey fraKey = factory.newDocumentKey(uri, revision, version); try { String fragment = item.getAtomicValue(); String fUri = baseUri + ".r" + revision + ".v" + version + ext; Document doc = loadDocument(fraKey, fUri, fragment, srcFormat, createdAt, createdBy, txStart, collections, props);