changeset 14:94ea06e32003

minor
author dwinter
date Thu, 13 Sep 2012 13:41:32 +0200
parents 9164f3f4b232
children e0efd3a9d2f0
files src/de/mpiwg/itgroup/eSciDoc/Tools/DRI/ConvertXMLToDRIList.java src/de/mpiwg/itgroup/eSciDoc/Tools/DRI/CreateDRIList.java src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/RepairPublishingInfoDeleteWrong.java src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/ReplaceAffiliation_local.java
diffstat 4 files changed, 63 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/de/mpiwg/itgroup/eSciDoc/Tools/DRI/ConvertXMLToDRIList.java	Thu Sep 13 13:01:36 2012 +0200
+++ b/src/de/mpiwg/itgroup/eSciDoc/Tools/DRI/ConvertXMLToDRIList.java	Thu Sep 13 13:41:32 2012 +0200
@@ -58,6 +58,7 @@
 
 	}
 	
+	
 	public static void main(String[] args) throws IOException, JDOMException {
 		if (args.length <2){
 			System.out.print("USAGE: fileIN filenOUT");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/de/mpiwg/itgroup/eSciDoc/Tools/DRI/CreateDRIList.java	Thu Sep 13 13:41:32 2012 +0200
@@ -0,0 +1,60 @@
+package de.mpiwg.itgroup.eSciDoc.Tools.DRI;
+
+
+import java.io.IOException;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jdom.JDOMException;
+
+import de.mpiwg.itgroup.eSciDoc.Tools.EScidocBasicHandler;
+import de.mpiwg.itgroup.eSciDoc.exceptions.ESciDocXmlObjectException;
+import de.mpiwg.itgroup.eSciDoc.utils.eSciDocXmlObject;
+
+
+public class CreateDRIList {
+
+
+	private EScidocBasicHandler connector;
+
+	int MAX_REC=500;
+	protected Logger logger = Logger.getRootLogger();
+	public CreateDRIList()
+	{
+		logger.setLevel(Level.DEBUG);
+		connector = new EScidocBasicHandler("escidoc.mpiwg-berlin.mpg.de",8080,"dwinter","weikiki7");	
+	}	
+
+
+
+	public void convert( String command, String objectXPath) throws IllegalStateException, IOException, JDOMException, ESciDocXmlObjectException{
+		Integer numberOfHits = connector.getNumberOfHitsFromFilterResult(
+				command, objectXPath,1);
+
+		logger.info(String.format("%s objects found.", numberOfHits));
+		int tausend = ((numberOfHits-1) / MAX_REC);
+
+		String queryRestrict="";
+
+		int counter=0;
+		for (int t = 0; t <= tausend; t++) {
+			int start = t * MAX_REC+1;
+			// int max=Math.min((t+1)*1000, numberOfHits);
+			logger.info(String.format("start: %s ", t));
+			String query = "?maximumRecords="+String.valueOf(MAX_REC)+"&startRecord="
+					+ String.valueOf(start)+"&"+queryRestrict;
+			for (eSciDocXmlObject obj : connector
+					.getObjectsFromFilterResult(command+query, objectXPath)) {
+				System.out.println(obj.getESciDocId());
+			}
+		}
+
+	}
+	
+	public static void main(String[] args) throws IOException, JDOMException, IllegalStateException, ESciDocXmlObjectException {
+	
+		CreateDRIList cv = new CreateDRIList();
+		String context = "/ir/context/escidoc:398284";
+		cv.convert(context+"/resources/members","//escidocItem:item");
+	}
+}
\ No newline at end of file
--- a/src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/RepairPublishingInfoDeleteWrong.java	Thu Sep 13 13:01:36 2012 +0200
+++ b/src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/RepairPublishingInfoDeleteWrong.java	Thu Sep 13 13:41:32 2012 +0200
@@ -33,7 +33,7 @@
 		Logger logger = Logger.getRootLogger();
 		logger.setLevel(Level.DEBUG);
 		EScidocBasicHandler connector = new EScidocBasicHandler(
-				"escidoc.mpiwg-berlin.mpg.de", 8080, "dwinter", "fl0rian");
+				"escidoc.mpiwg-berlin.mpg.de", 8080, "dwinter", "XXXX");
 
 		if(args.length<2){
 			System.out.println("Usage: startrecord maximumrecords");
--- a/src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/ReplaceAffiliation_local.java	Thu Sep 13 13:01:36 2012 +0200
+++ b/src/de/mpiwg/itgroup/eSciDoc/Tools/Pubman/ReplaceAffiliation_local.java	Thu Sep 13 13:41:32 2012 +0200
@@ -32,7 +32,7 @@
 		Logger logger = Logger.getRootLogger();
 		logger.setLevel(Level.DEBUG);
 		EScidocBasicHandler connector = new EScidocBasicHandler(
-				"escidoc.mpiwg-berlin.mpg.de", 8080, "dwinter", "fl0rian");
+				"escidoc.mpiwg-berlin.mpg.de", 8080, "dwinter", "XXXX");
 
 		if(args.length<2){
 			System.out.println("Usage: startrecord maximumrecords");