    :flags "x"
    :transaktions_status "pending"})
 
-(defn container-id 
+(defn container-id
   "Return the name of a archive spool directory for a given production"
   [{:keys [id iso-path]}]
   (cond

  [{:keys [path] :as production}]
  (let [tmp-path (.getPath (fs/temp-dir "mdr2"))
        ;; FIXME: it might be better to allow for different manifest names
        manifest (.getPath (file path "package.opf"))] 
    (pipeline/audio-encoder {:input manifest :output tmp-path})
    (assoc production :encoded-path tmp-path)))

(defn create-iso 
  "Pack a production in an iso file. 
Return a map with an additional key `iso-path` where the iso is located"
  [{:keys [encoded-path title publisher]
    :or {title "FIXME:" publisher "FIXME:"} ; title and publisher shouldn't be empty
    :as production}]
  (let [iso-path (.getPath (file (fs/tmpdir) (fs/temp-name "mdr2" ".iso")))]
    (sh "genisoimage" 
        "-quiet" 
        "-r" 
        "-publisher" publisher
        "-V" title ; volume ID (volume name or label)
        "-J" ; Generate Joliet directory records in addition to regular ISO9660 filenames.
        "-o" iso-path encoded-path)
    (assoc production :iso-path iso-path)))

(defn copy-files 
  "Copy a production to the archive spool dir"
  ;; FIXME: this fails if there is already an archiving in progress
  ;; because it will create another copy inside the already existing

        iso-archive-path (.getPath (file archive-path iso-archive-name))]
    ;; if the production has an iso archive that, otherwise just
    ;; archive the raw unencoded files
    (if iso-path
      (fs/copy+ iso-path iso-archive-path)
      (fs/copy-dir path archive-path)))
  production)

(defn create-rdf
  "Create an rdf file and place it in the archive spool directory"
  [production]
  (let [rdf (rdf/rdf production)
