Commit 903c2182 authored by bow's avatar bow
Browse files

Define JSON formats in main RunsProcessor definition

parent f38ada1e
......@@ -17,24 +17,27 @@
package nl.lumc.sasc.sentinel.processors
import java.io.ByteArrayInputStream
import scala.util.Try
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.gridfs.GridFSDBFile
import com.novus.salat._
import com.novus.salat.global._
import org.scalatra.servlet.FileItem
import nl.lumc.sasc.sentinel.Pipeline
import nl.lumc.sasc.sentinel.db.MongodbAccessObject
import nl.lumc.sasc.sentinel.models.{ PipelineStats, BaseRunRecord, User }
import nl.lumc.sasc.sentinel.utils.{ DuplicateFileException, calcMd5, getUtcTimeNow }
import org.scalatra.servlet.FileItem
import scala.util.Try
import nl.lumc.sasc.sentinel.utils.{ DuplicateFileException, SentinelJsonFormats, calcMd5, getUtcTimeNow }
/**
* Base class for processing run summary files.
*/
abstract class RunsProcessor(protected val mongo: MongodbAccessObject) extends Processor {
/** JSON formats used by this processor. */
implicit val formats = SentinelJsonFormats
/**
* Processes and stores the given uploaded file to the run records collection.
*
......
......@@ -30,7 +30,7 @@ import scalaz.{ Failure => _, _ }, Scalaz._
import nl.lumc.sasc.sentinel.Pipeline
import nl.lumc.sasc.sentinel.db._
import nl.lumc.sasc.sentinel.models._
import nl.lumc.sasc.sentinel.utils.{ SentinelJsonFormats, calcMd5, getUtcTimeNow }
import nl.lumc.sasc.sentinel.utils.{ calcMd5, getUtcTimeNow }
import nl.lumc.sasc.sentinel.utils.implicits._
import nl.lumc.sasc.sentinel.validation.ValidationAdapter
......@@ -46,9 +46,6 @@ class GentrapV04RunsProcessor(mongo: MongodbAccessObject)
with ReferencesAdapter
with AnnotationsAdapter {
/** JSON formats used by this processor. */
implicit val formats = SentinelJsonFormats
/** Extracts a reference record from a Gentrap summary. */
private[processors] def extractReference(runJson: JValue): ReferenceRecord = {
val refJson = runJson \ "gentrap" \ "settings" \ "reference"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment