public InputStream toStream() throws XMLStreamException, XmlWriteException { if (item.getMetadata() != null) { return new ByteArrayInputStream(item.getMetadata().toString().getBytes()); } else { ByteArrayOutputStream mdOUT = new ByteArrayOutputStream(); XmlWriter writer = new XmlWriter(mdOUT); item.getMetadata().write(writer); writer.flush(); writer.close(); return new ByteArrayInputStream(mdOUT.toByteArray()); } }
public List<Set> getSets(Context context, FilterResolver resolver) { List<Set> result = new ArrayList<Set>(); for (Set set : context.getSets()) if (set.getCondition().getFilter(resolver).isItemShown(item)) result.add(set); result.addAll(item.getSets()); return result; } }
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; }
Header header = new Header(); Record record = new Record().withHeader(header); header.withIdentifier(item.getIdentifier()); header.withDatestamp(item.getDatestamp()); for (Set set : itemHelperWrap.getSets(getContext(), getRepository().getFilterResolver())) header.withSetSpec(set.getSpec()); if (item.isDeleted()) header.withStatus(Header.Status.DELETED); if (!item.isDeleted()) { Metadata metadata = null; try { if (item.getAbout() != null) { for (About about : item.getAbout()) { record.withAbout(about);
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; }
header.withIdentifier(item.getIdentifier()); header.withDatestamp(item.getDatestamp()); header.withSetSpec(set.getSpec()); for (Set set : item.getSets()) header.withSetSpec(set.getSpec()); if (item.isDeleted()) header.withStatus(Header.Status.DELETED); if (!item.isDeleted()) { Metadata metadata = null; try { if (item.getAbout() != null) { for (About about : item.getAbout()) record.withAbout(about);
private XSLPipeline toPipeline(Item item) throws XmlWriteException, XMLStreamException { ByteArrayOutputStream output = new ByteArrayOutputStream(); XmlWriter writer = new XmlWriter(output); Metadata metadata = item.getMetadata(); metadata.write(writer); writer.close(); return new XSLPipeline(new ByteArrayInputStream(output.toByteArray()), true); } }
private XSLPipeline toPipeline(Item item) throws XmlWriteException, XMLStreamException { ByteArrayOutputStream output = new ByteArrayOutputStream(); XmlWriter writer = new XmlWriter(output); Metadata metadata = item.getMetadata(); metadata.write(writer); writer.close(); return new XSLPipeline(new ByteArrayInputStream(output.toByteArray()), true); } }
private XSLPipeline toPipeline(Item item) throws XmlWriteException, XMLStreamException { ByteArrayOutputStream output = new ByteArrayOutputStream(); XmlWriter writer = new XmlWriter(output); Metadata metadata = item.getMetadata(); metadata.write(writer); writer.close(); return new XSLPipeline(new ByteArrayInputStream(output.toByteArray()), true); } }
private XSLPipeline toPipeline(Item item) throws XmlWriteException, XMLStreamException { ByteArrayOutputStream output = new ByteArrayOutputStream(); XmlWriter writer = new XmlWriter(output); Metadata metadata = item.getMetadata(); metadata.write(writer); writer.close(); return new XSLPipeline(new ByteArrayInputStream(output.toByteArray()), true); } }