]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4814: Cleanup of changes to Import service to emit additional info about impor...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 10 Apr 2012 16:13:29 +0000 (09:13 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 10 Apr 2012 16:13:29 +0000 (09:13 -0700)
services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java

index 255ba79f760854e0230bf8c63905c03c7d9876f0..321f5ace0ee5733a7d148acd3844ffbd46894bfe 100644 (file)
@@ -60,9 +60,6 @@ public class ImportCommand {
             // pipe.addTransformer(transformer);\r
             pipe.setReader(reader);\r
             pipe.setWriter(writer);\r
-            // FIXME: pipe.run() appears to return at least one type\r
-            // of Exception that is logged but not thrown; this is a\r
-            // potential workaround\r
             DocumentTranslationMap dtm = pipe.run();\r
             Map<DocumentRef,DocumentRef> documentRefs = dtm.getDocRefMap();\r
             dump.append("<importedRecords>");\r
@@ -72,20 +69,12 @@ public class ImportCommand {
                 if (keyDocRef == null || valueDocRef == null) {\r
                     continue;\r
                 }\r
-                // System.out.println("value="+entry.getValue());\r
-                // System.out.println("key="+entry.getKey());\r
-\r
-                docModel = repoSession.getDocument((DocumentRef) entry.getValue());\r
-                // System.out.println("value doctype="+docModel.getDocumentType().toString());\r
-\r
                 dump.append("<importedRecord>");\r
                 docModel = repoSession.getDocument(valueDocRef);\r
                 docType = docModel.getDocumentType().getName();\r
-                // System.out.println(docType);\r
                 dump.append("<doctype>"+docType+"</doctype>");\r
                 dump.append("<csid>"+keyDocRef.toString()+"</csid>");\r
                 dump.append("</importedRecord>");\r
-                // System.out.println(dump.toString());\r
                 if (recordsImportedForDocType.containsKey(docType)) {\r
                     numRecordsImportedForDocType = (Integer) recordsImportedForDocType.get(docType);\r
                     numRecordsImportedForDocType = Integer.valueOf(numRecordsImportedForDocType.intValue() + 1);\r
@@ -103,8 +92,10 @@ public class ImportCommand {
             dump.append("<numRecordsImportedByDocType>");\r
             TreeSet<String> keys = new TreeSet<String>(recordsImportedForDocType.keySet());\r
             for (String key : keys) {\r
+                dump.append("<numRecordsImported>");\r
                 dump.append("<docType>"+key+"</docType>");\r
                 dump.append("<numRecords>"+recordsImportedForDocType.get(key).intValue()+"</numRecords>");\r
+                dump.append("</numRecordsImported>");\r
             }\r
             dump.append("</numRecordsImportedByDocType>");\r
             if (reader != null) {\r