use of com.lyncode.xoai.model.xoai.XOAIMetadata in project dataverse by IQSS.
the class XsetRepository method retrieveSets.
@Override
public ListSetsResult retrieveSets(int offset, int length) {
logger.fine("calling retrieveSets()");
List<OAISet> dataverseOAISets = setService.findAll();
List<Set> XOAISets = new ArrayList<Set>();
if (dataverseOAISets != null) {
for (int i = 0; i < dataverseOAISets.size(); i++) {
OAISet dataverseSet = dataverseOAISets.get(i);
Set xoaiSet = new Set(dataverseSet.getSpec());
xoaiSet.withName(dataverseSet.getName());
XOAIMetadata xMetadata = new XOAIMetadata();
Element element = new Element("description");
element.withField("description", dataverseSet.getDescription());
xMetadata.getElements().add(element);
xoaiSet.withDescription(xMetadata);
XOAISets.add(xoaiSet);
}
}
return new ListSetsResult(offset + length < XOAISets.size(), XOAISets.subList(offset, Math.min(offset + length, XOAISets.size())));
}
Aggregations