From 817f6f3f09d7533362128b809b1e9c7e7ff8f9b2 Mon Sep 17 00:00:00 2001 From: Max Burnette Date: Wed, 17 Mar 2021 08:57:13 -0500 Subject: [PATCH 1/3] Add file status to file report --- app/api/Reporting.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/Reporting.scala b/app/api/Reporting.scala index 674f0d45c..1f4f58c3f 100644 --- a/app/api/Reporting.scala +++ b/app/api/Reporting.scala @@ -39,7 +39,7 @@ class Reporting @Inject()(selections: SelectionService, var headerRow = true val enum = Enumerator.generateM({ val chunk = if (headerRow) { - val header = "type,id,name,owner,owner_id,size_kb,uploaded,views,downloads,last_viewed,last_downloaded,location,parent_datasets,parent_collections,parent_spaces\n" + val header = "type,id,name,owner,owner_id,size_kb,uploaded,views,downloads,last_viewed,last_downloaded,location,parent_datasets,parent_collections,parent_spaces,status\n" headerRow = false Some(header.getBytes("UTF-8")) } else { @@ -137,7 +137,7 @@ class Reporting @Inject()(selections: SelectionService, // TODO: This will still fail on excessively large instances without Enumerator refactor - should we maintain this endpoint or remove? - var contents: String = "type,id,name,owner,owner_id,size_kb,uploaded/created,views,downloads,last_viewed,last_downloaded,location,parent_datasets,parent_collections,parent_spaces\n" + var contents: String = "type,id,name,owner,owner_id,size_kb,uploaded/created,views,downloads,last_viewed,last_downloaded,location,parent_datasets,parent_collections,parent_spaces,status\n" collections.getMetrics().foreach(coll => { contents += _buildCollectionRow(coll, true) @@ -289,6 +289,7 @@ class Reporting @Inject()(selections: SelectionService, contents += "\""+ds_list+"\"," contents += "\""+coll_list+"\"," contents += "\""+space_list+"\"" + contents += "\""+f.status+"\"" contents += "\n" return contents @@ -343,6 +344,7 @@ class Reporting @Inject()(selections: SelectionService, if (returnAllColums) contents += "," // datasets do not have parent_datasets contents += "\""+coll_list+"\"," contents += "\""+space_list+"\"" + if (returnAllColums) contents += "," // datasets do not have status contents += "\n" return contents @@ -391,6 +393,7 @@ class Reporting @Inject()(selections: SelectionService, if (returnAllColums) contents += "," // collections do not have parent_datasets contents += "\""+coll_list+"\"," contents += "\""+space_list+"\"" + if (returnAllColums) contents += "," // collections do not have status contents += "\n" return contents From 04e6e49b75dd7acb86080f3c080dd51da5a0d5e8 Mon Sep 17 00:00:00 2001 From: Max Burnette Date: Wed, 17 Mar 2021 08:58:46 -0500 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 195c5e5c0..030d04853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Consolidated field names sent by the EventSinkService to maxaimize reuse. +- Add status column to files report to indicate if files are ARCHIVED, etc. ## 1.15.0 - 2021-03-03 From af3eb59418bdee3193907d0843f3c2031660801f Mon Sep 17 00:00:00 2001 From: Max Burnette Date: Mon, 29 Mar 2021 13:50:06 -0500 Subject: [PATCH 3/3] add missing trailing comma --- app/api/Reporting.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/Reporting.scala b/app/api/Reporting.scala index 1f4f58c3f..c88c8e412 100644 --- a/app/api/Reporting.scala +++ b/app/api/Reporting.scala @@ -288,7 +288,7 @@ class Reporting @Inject()(selections: SelectionService, contents += "\""+f.loader_id+"\"," contents += "\""+ds_list+"\"," contents += "\""+coll_list+"\"," - contents += "\""+space_list+"\"" + contents += "\""+space_list+"\"," contents += "\""+f.status+"\"" contents += "\n"