;;; seed-database.mhtml: -*- Meta-HTML -*-  Acme Cake Shop.
;;;
;;;  Copyright (c) 1996 Universal Access Inc.
;;;  Author: Art Medlar, Henry Minsky Fri Jul 26 18:19:12 PDT 1996

;;; This code creates a predefined database of products.
;;;

<defmacro make-item db key>
  <package-delete item>
  <set-var %body>
  <set-var ok =
    <database-save-package <get-var db> <get-var key> item strip=true>>
</defmacro>

<with-open-database prdb <get-var dbfile> MODE=WRITE-CREATE>
  <make-item prdb 100-R>
  item::url="red.mhtml"
  item::picture="cake_red.gif"
  item::color="red"
  item::title="The Yummy Red Cake!"
  item::price=12.75
  item::inventory=100
  item::delivery=8-13-96
  </make-item>

  <make-item prdb 100-B>
  item::url="blue.mhtml"
  item::picture="cake_blue.gif"
  item::color="blue"
  item::title="The Elegant Blue Cake!"
  item::price=15.99
  item::inventory=20
  item::delivery=8-23-96
  </make-item>


  <make-item prdb 100-G>
  item::url="green.mhtml"
  item::picture="cake_green.gif"
  item::color="green"
  item::title="The Scrumptious Green Cake!"
  item::price=12.75
  item::inventory=21
  item::delivery=6-8-96
  </make-item>

  <make-item prdb 100-BK>
  item::url="black.mhtml"
  item::picture="cake_black.gif"
  item::color="black"
  item::title="The Festive Black Cake!"
  item::price=18.18
  item::inventory=0
  item::delivery=8-9-96
  </make-item>

</with-open-database>
