Skip to content

Commit 14d4dc4

Browse files
committed
Set default extractor category to EXTRACT in both heartbeat and api.
1 parent ba69293 commit 14d4dc4

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.7.4 - 2019-10-21
8+
9+
### Fixed
10+
- Extractors that don't specify EXTRACT as categories don't show up in the manual submission page.
11+
[CATS-1023](https://opensource.ncsa.illinois.edu/jira/browse/CATS-1023)
12+
713
## 1.7.3 - 2019-08-19
814

915
### Fixed

app/api/Extractions.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,10 @@ class Extractions @Inject()(
455455
case _ => request.body
456456
}
457457

458-
// If extractor doesn't have categories specified, set a default
459-
requestJson = requestJson \ "categories" match {
460-
case cats: JsUndefined => requestJson.as[JsObject] ++ Json.obj("categories" -> Json.arr(ExtractorCategory.EXTRACT.toString))
461-
case _ => requestJson
462-
}
463-
458+
// Validate document
464459
val extractionInfoResult = requestJson.validate[ExtractorInfo]
460+
461+
// Update database
465462
extractionInfoResult.fold(
466463
errors => {
467464
BadRequest(Json.obj("status" -> "KO", "message" -> JsError.toFlatJson(errors)))

app/models/Extraction.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ object ExtractorInfo {
132132
(JsPath \ "libraries").read[List[String]].orElse(Reads.pure(List.empty)) and
133133
(JsPath \ "bibtex").read[List[String]].orElse(Reads.pure(List.empty)) and
134134
(JsPath \ "process").read[ExtractorProcessTriggers].orElse(Reads.pure(new ExtractorProcessTriggers())) and
135-
(JsPath \ "categories").read[List[String]].orElse(Reads.pure(List.empty))
135+
(JsPath \ "categories").read[List[String]].orElse(Reads.pure(List[String](ExtractorCategory.EXTRACT.toString)))
136136
)(ExtractorInfo.apply _)
137137
}
138138

app/services/RabbitmqPlugin.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,12 @@ class ExtractorsHeartbeats(channel: Channel, queue: String) extends Actor {
12071207
// TODO store running extractors ids
12081208
val id = UUID((json \ "id").as[String])
12091209
val queue = (json \ "queue").as[String]
1210-
val extractor_info = (json \ "extractor_info")
1210+
val extractor_info = json \ "extractor_info"
1211+
1212+
// Validate document
12111213
val extractionInfoResult = extractor_info.validate[ExtractorInfo]
1214+
1215+
// Update database
12121216
extractionInfoResult.fold(
12131217
errors => {
12141218
Logger.error("Received extractor heartbeat with bad format: " + extractor_info)

doc/src/sphinx/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
author = 'Luigi Marini'
2121

2222
# The full version, including alpha/beta/rc tags
23-
release = '1.7.3'
23+
release = '1.7.4'
2424

2525

2626
# -- General configuration ---------------------------------------------------

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import NativePackagerKeys._
1313
object ApplicationBuild extends Build {
1414

1515
val appName = "clowder"
16-
val version = "1.7.3"
16+
val version = "1.7.4"
1717
val jvm = "1.7"
1818

1919
def appVersion: String = {

0 commit comments

Comments
 (0)