The manual query in the browser gives 1305 results: http://www.gahetna.nl/beeldbank-api/opensearch/?q=Leiden
But my code with Abdera (below) returns just 19 results. This must be due to pagination. How do I access all the pages of results? Thx!
List<NationaalArchiefDoc> docs = new ArrayList();
Abdera abdera = new Abdera();
AbderaClient client = new AbderaClient(abdera);
searchString = searchString.replaceAll(" ", "+");
ClientResponse resp = client.get("http://www.gahetna.nl/beeldbank-api/opensearch/?q=" + searchString.trim());
if (resp.getType() == ResponseType.SUCCESS) {
Document docAbdera = resp.getDocument();
Element elementAbdera = docAbdera.getRoot();
Iterator<Element> elementIterator = elementAbdera.getElements().get(0).getElements().iterator();
System.out.println("number of docs found: " + elementAbdera.getElements().get(0).getElements().size());
//looping through the 19 items
while (elementIterator.hasNext()) {
NationaalArchiefDoc doc = new NationaalArchiefDoc();
Element element1 = elementIterator.next();
// more actions in the loop...
}
}