use of com.lyncode.xoai.dataprovider.model.ItemIdentifier in project dataverse by IQSS.
the class XitemRepository method getItemIdentifiers.
@Override
public ListItemIdentifiersResult getItemIdentifiers(List<ScopedFilter> filters, int offset, int length, String setSpec, Date from, Date until) throws OAIException {
logger.fine("calling getItemIdentifiers; offset=" + offset + ", length=" + length + ", setSpec=" + setSpec + ", from=" + from + ", until=" + until);
List<OAIRecord> oaiRecords = recordService.findOaiRecordsBySetName(setSpec, from, until);
logger.fine("total " + oaiRecords.size() + " returned");
List<ItemIdentifier> xoaiItems = new ArrayList<>();
if (oaiRecords != null && !oaiRecords.isEmpty()) {
for (int i = offset; i < offset + length && i < oaiRecords.size(); i++) {
OAIRecord record = oaiRecords.get(i);
xoaiItems.add(new Xitem(record));
}
// formatted output in the header:
if (!StringUtil.isEmpty(setSpec)) {
addExtraSets(xoaiItems, setSpec, from, until);
}
boolean hasMore = offset + length < oaiRecords.size();
ListItemIdentifiersResult result = new ListItemIdentifiersResult(hasMore, xoaiItems);
logger.fine("returning result with " + xoaiItems.size() + " items.");
return result;
}
return new ListItemIdentifiersResult(false, xoaiItems);
}
Aggregations