   "The main ERB used to generate the Collection HTML."
   (io/resource "collection_preview/collection_preview.erb"))
 
-(def preview-gem-umm-schema-version
-  "Temporay def for the UMM schema version that is supported by the CMR preview gem.
-   This will be removed once CMR preview gem is fixed to include the UMM schema version
-   it supports in the gem. (MMT-921)"
-  "1.6")
+(def preview-gem-umm-version-config-file
+  "Defines the path to the UMM schema version config file within the preview gem."
+  "gems/cmr_metadata_preview-0.0.1/.umm-version")
+
+(def default-preview-gem-umm-version
+  "Default preview gem UMM schema version in case preview gem is mis-configured."
+  "1.8")
 
 (defn- create-jruby-runtime
   "Creates and initializes a JRuby runtime."

  [context]
  (get-in context [:system :public-conf :relative-root-url]))

(defn render-collection
  "Renders a UMM-C collection record and returns the HTML as a string."
  [context collection]

                  (getEngineByName "jruby"))]
    (.eval jruby (io/reader bootstrap-rb))
    jruby))

(defn- get-preview-gem-umm-version
  "Get the UMM schema version that is defined in preview gem."
  []
  (try
    (-> preview-gem-umm-version-config-file
        io/resource
        slurp
        str/trim)
    (catch Exception e
      (error "Failed to parse preview gem UMM version, will use the default version:"
             default-preview-gem-umm-version
             (.printStackTrace e)))))

;; Allows easily evaluating Ruby code in the Clojure REPL.
(comment
