package eu.dnetlib.helpers.functionallity.webui;


public class DocumentReaderMain {

	/*
	public static void main(String[] args) throws JAXBException {
		
		IndexLayoutManagerImpl ilm = new IndexLayoutManagerImpl();
		ilm.initialize("no-name");
		DocumentReader reader = new DocumentReader(
				ilm.getResultFields(),
				new TreeMap<String, String>(),
				new TreeMap<String, Vocabulary>());
		String indexUrl = "http://129.70.12.28:8002/cgi-bin/SoapDriver.fcgi";
		indexUrl = "http://node8.p.driver.research-infrastructures.eu:8180/"
				+ "indexService/IndexService";
		
		IndexClient client = new IndexClientImpl(indexUrl);
		String epr = client.lookup("test");
		System.out.println("epr = " + epr);
		RSClient rs = new RSClientImpl(epr);
		
		int page = 10;
		int n = rs.getNumberOfObjects();
		int from = 1;
		int to = Math.min(from + page-1, n);
		while (to <= n) {
			System.out.println("asking page [" + from + "," + to + "]");
			List<String> data = rs.updateRS(from, to);
			for (String string : data) {
				if (string == null || string.equals("")) {
					System.out.println("Empty data!!!");
					System.exit(0);
				}
				Document document = reader.read(string);
				
				System.out.println("\tdocument: " + document.getMap());
			}
			from = to + 1;
			if (from > n) {
				to = n+1;
			} else {
				to = Math.min(from + page - 1, n);
			}
			System.out.println("page size: " + data.size());
		}
		System.out.println("total: " + n);
	}
	*/
}
