gFeed/oai-harvester/src/test/java/org/gcube/application/gfeed/oai/OAIClientTests.java

30 lines
923 B
Java

package org.gcube.application.gfeed.oai;
import java.util.Collection;
import javax.xml.bind.JAXBException;
import org.gcube.data.publishing.gFeed.collectors.oai.OAIClient;
import org.gcube.data.publishing.gFeed.collectors.oai.model.OAIInteractionException;
import org.gcube.data.publishing.gFeed.collectors.oai.model.OAIRecord;
import org.gcube.data.publishing.gFeed.collectors.oai.model.ckan.GCatModel;
import org.gcube.data.publishing.gFeed.collectors.oai.model.ckan.GCatTransformer;
public class OAIClientTests {
public static void main (String[] args) throws JAXBException, OAIInteractionException {
String baseUrl="https://data.inrae.fr/oai";
OAIClient client=new OAIClient(baseUrl);
Collection <OAIRecord> records=client.getAll(OAIClient.DC_METADATA_PREFIX);
System.out.println("Records size = "+records.size());
GCatTransformer tr=new GCatTransformer();
tr.transform(records);
}
}