diff --git a/grails-app/controllers/au/org/ala/collectory/IptController.groovy b/grails-app/controllers/au/org/ala/collectory/IptController.groovy index 1a5cab0f..aec57519 100644 --- a/grails-app/controllers/au/org/ala/collectory/IptController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/IptController.groovy @@ -242,40 +242,25 @@ class IptController { } def iptInventory = new JsonSlurper().parse(new URL(provider.websiteUrl + "/inventory/dataset")) - def count = 0 - def iptMap = [:] def result = [] - String[] header = [ - "EML URL", - "GUID", - "Title", - "Number of records in IPT", - "Number of records in Atlas", - "Atlas ID" - ] - result.add(header) - iptInventory.registeredResources.each { item -> - iptMap.put(item.title, item.records) //retrieve UID, and do a count from the services def uid = newMap.get(item.title.toLowerCase()) + def row= [ + title: item.title, + eml: item.eml, + gbifKey: item.gbifKey, + uid: "Not registered", + gbifCount: item.records, + atlasCount: 0 + ] if (uid) { def jsonCount = new JsonSlurper().parse(new URL(grailsApplication.config.biocacheServicesUrl + "/occurrences/search?pageSize=0&fq=data_resource_uid:" + uid)) - String[] row = [ - item.eml, - item.gbifKey, - item.title, - item.records, - jsonCount.totalRecords, - uid - ] - result.add(row) - } else { - String[] row = [item.eml, item.gbifKey, item.title, item.records, "0", "Not registered"] - result.add(row) + row.uid = uid + row.atlasCount = jsonCount.totalRecords } - count += 1 + result.add(row) } [result: result] } diff --git a/grails-app/views/ipt/syncView.gsp b/grails-app/views/ipt/syncView.gsp index 9c7f1325..dc5ed078 100644 --- a/grails-app/views/ipt/syncView.gsp +++ b/grails-app/views/ipt/syncView.gsp @@ -1 +1,5 @@ -${result} +
+    
+        ${item}
+    
+