From: Aron Roberts Date: Tue, 10 Apr 2012 16:13:29 +0000 (-0700) Subject: CSPACE-4814: Cleanup of changes to Import service to emit additional info about impor... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=a49427716d97747db3c8897cd9daf0e3c26df596;p=tmp%2Fjakarta-migration.git CSPACE-4814: Cleanup of changes to Import service to emit additional info about imported records in response, in part to support automated tests. Removed comments, extraneous assignment; added wrapper element. --- diff --git a/services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java b/services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java index 255ba79f7..321f5ace0 100644 --- a/services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java +++ b/services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java @@ -60,9 +60,6 @@ public class ImportCommand { // pipe.addTransformer(transformer); pipe.setReader(reader); pipe.setWriter(writer); - // FIXME: pipe.run() appears to return at least one type - // of Exception that is logged but not thrown; this is a - // potential workaround DocumentTranslationMap dtm = pipe.run(); Map documentRefs = dtm.getDocRefMap(); dump.append(""); @@ -72,20 +69,12 @@ public class ImportCommand { if (keyDocRef == null || valueDocRef == null) { continue; } - // System.out.println("value="+entry.getValue()); - // System.out.println("key="+entry.getKey()); - - docModel = repoSession.getDocument((DocumentRef) entry.getValue()); - // System.out.println("value doctype="+docModel.getDocumentType().toString()); - dump.append(""); docModel = repoSession.getDocument(valueDocRef); docType = docModel.getDocumentType().getName(); - // System.out.println(docType); dump.append(""+docType+""); dump.append(""+keyDocRef.toString()+""); dump.append(""); - // System.out.println(dump.toString()); if (recordsImportedForDocType.containsKey(docType)) { numRecordsImportedForDocType = (Integer) recordsImportedForDocType.get(docType); numRecordsImportedForDocType = Integer.valueOf(numRecordsImportedForDocType.intValue() + 1); @@ -103,8 +92,10 @@ public class ImportCommand { dump.append(""); TreeSet keys = new TreeSet(recordsImportedForDocType.keySet()); for (String key : keys) { + dump.append(""); dump.append(""+key+""); dump.append(""+recordsImportedForDocType.get(key).intValue()+""); + dump.append(""); } dump.append(""); if (reader != null) {