Document Counts (Python)

Document Counts (Python)
 1ot = impact.gui.output_toolbox
 2db = impact.active_database
 3
 4ot.clear()
 5docSettings = db.settings.document_settings
 6docProvider = db.settings.document_provider
 7
 8docNormalCount = docProvider.document_count(ipDocumentStatus.dsNormal)
 9
10if docSettings.supports_undelete:
11    docDeletedCount = docProvider.document_count(ipDocumentStatus.dsDeleted)
12else:
13    docDeletedCount = 0
14
15if docSettings.supports_data_purge:
16    docPurgedCount = docProvider.document_count(ipDocumentStatus.dsDataPurged)
17else:
18    docPurgedCount = 0
19
20ot.add("Normal Documents: " + str(docNormalCount))
21ot.add("Deleted Documents: " + str(docDeletedCount))
22ot.add("Purged Documents: " + str(docPurgedCount))