Skip to content

Commit 4823019

Browse files
max-zillalmarini
andauthored
Add file status to file report (#195)
* Add file status to file report * Update CHANGELOG.md * add missing trailing comma Co-authored-by: Luigi Marini <[email protected]>
1 parent 18ebd0d commit 4823019

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515

1616
### Changed
1717
- Consolidated field names sent by the EventSinkService to maxaimize reuse.
18+
- Add status column to files report to indicate if files are ARCHIVED, etc.
1819
- Reworked auto-archival configuration options to make their meanings more clear.
1920

2021
## 1.15.1 - 2021-03-12

app/api/Reporting.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Reporting @Inject()(selections: SelectionService,
3939
var headerRow = true
4040
val enum = Enumerator.generateM({
4141
val chunk = if (headerRow) {
42-
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"
42+
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"
4343
headerRow = false
4444
Some(header.getBytes("UTF-8"))
4545
} else {
@@ -137,7 +137,7 @@ class Reporting @Inject()(selections: SelectionService,
137137

138138
// TODO: This will still fail on excessively large instances without Enumerator refactor - should we maintain this endpoint or remove?
139139

140-
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"
140+
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"
141141

142142
collections.getMetrics().foreach(coll => {
143143
contents += _buildCollectionRow(coll, true)
@@ -288,7 +288,8 @@ class Reporting @Inject()(selections: SelectionService,
288288
contents += "\""+f.loader_id+"\","
289289
contents += "\""+ds_list+"\","
290290
contents += "\""+coll_list+"\","
291-
contents += "\""+space_list+"\""
291+
contents += "\""+space_list+"\","
292+
contents += "\""+f.status+"\""
292293
contents += "\n"
293294

294295
return contents
@@ -343,6 +344,7 @@ class Reporting @Inject()(selections: SelectionService,
343344
if (returnAllColums) contents += "," // datasets do not have parent_datasets
344345
contents += "\""+coll_list+"\","
345346
contents += "\""+space_list+"\""
347+
if (returnAllColums) contents += "," // datasets do not have status
346348
contents += "\n"
347349

348350
return contents
@@ -391,6 +393,7 @@ class Reporting @Inject()(selections: SelectionService,
391393
if (returnAllColums) contents += "," // collections do not have parent_datasets
392394
contents += "\""+coll_list+"\","
393395
contents += "\""+space_list+"\""
396+
if (returnAllColums) contents += "," // collections do not have status
394397
contents += "\n"
395398

396399
return contents

0 commit comments

Comments
 (0)