use of org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter in project ddf by codice.
the class TransactionMessageBodyReader method readFrom.
@Override
public CswTransactionRequest readFrom(Class<CswTransactionRequest> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> multivaluedMap, InputStream inputStream) throws IOException, WebApplicationException {
XStream xStream = new XStream(new Xpp3Driver());
TransactionRequestConverter transactionRequestConverter = new TransactionRequestConverter(cswRecordConverter, registry);
transactionRequestConverter.setCswRecordConverter(new CswRecordConverter(metacardType));
xStream.registerConverter(transactionRequestConverter);
xStream.alias("csw:" + CswConstants.TRANSACTION, CswTransactionRequest.class);
xStream.alias(CswConstants.TRANSACTION, CswTransactionRequest.class);
return (CswTransactionRequest) xStream.fromXML(inputStream);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.converter.CswRecordConverter in project ddf by codice.
the class TestTransactionMessageBodyReader method setup.
@Before
public void setup() {
cswRecordConverter = new CswRecordConverter(CswQueryFactoryTest.getCswMetacardType());
new CoreAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
new ContactAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
new LocationAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
new MediaAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
new TopicAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
new AssociationsAttributes().getAttributeDescriptors().stream().forEach(d -> registry.register(d));
}
Aggregations