use of com.lyncode.xoai.dataprovider.handlers.helpers.ItemHelper in project dataverse by IQSS.
the class XlistRecordsHandler method createRecord.
private Record createRecord(OAICompiledRequest parameters, Item item) throws BadArgumentException, CannotDisseminateRecordException, OAIException, NoMetadataFormatsException, CannotDisseminateFormatException {
MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
Header header = new Header();
Dataset dataset = ((Xitem) item).getDataset();
Xrecord xrecord = new Xrecord().withFormatName(parameters.getMetadataPrefix()).withDataset(dataset);
header.withIdentifier(item.getIdentifier());
ItemHelper itemHelperWrap = new ItemHelper(item);
header.withDatestamp(item.getDatestamp());
for (Set set : itemHelperWrap.getSets(getContext(), getRepository().getFilterResolver())) header.withSetSpec(set.getSpec());
if (item.isDeleted())
header.withStatus(Header.Status.DELETED);
xrecord.withHeader(header);
xrecord.withMetadata(item.getMetadata());
return xrecord;
}
use of com.lyncode.xoai.dataprovider.handlers.helpers.ItemHelper in project dataverse by IQSS.
the class XgetRecordHandler method createRecord.
private Xrecord createRecord(OAICompiledRequest parameters, Item item) throws BadArgumentException, CannotDisseminateRecordException, OAIException, NoMetadataFormatsException, CannotDisseminateFormatException {
MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
Header header = new Header();
Dataset dataset = ((Xitem) item).getDataset();
Xrecord xrecord = new Xrecord().withFormatName(parameters.getMetadataPrefix()).withDataset(dataset);
header.withIdentifier(item.getIdentifier());
ItemHelper itemHelperWrap = new ItemHelper(item);
header.withDatestamp(item.getDatestamp());
for (Set set : itemHelperWrap.getSets(getContext(), getRepository().getFilterResolver())) header.withSetSpec(set.getSpec());
if (item.isDeleted())
header.withStatus(Header.Status.DELETED);
xrecord.withHeader(header);
xrecord.withMetadata(item.getMetadata());
return xrecord;
}
Aggregations