diff demo/more/conference.ur @ 1032:5d9f47124c4c

Saving paper decisions
author Adam Chlipala <adamc@hcoop.net>
date Sat, 07 Nov 2009 11:06:38 -0500
parents 6bcc1020d5cd
children
line wrap: on
line diff
--- a/demo/more/conference.ur	Mon Nov 02 15:54:22 2009 -0500
+++ b/demo/more/conference.ur	Sat Nov 07 11:06:38 2009 -0500
@@ -16,6 +16,11 @@
     table paper : ([Id = paperId, Document = blob] ++ paper)
                       PRIMARY KEY Id
 
+    con review :: {Type}
+    constraint [Paper, User] ~ review
+    table review : ([Paper = paperId, User = userId] ++ review)
+                       PRIMARY KEY (Paper, User)
+
     val checkLogin : transaction (option {Id : userId, Nam : string, Chair : bool, OnPc : bool})
     val getLogin : transaction {Id : userId, Nam : string, Chair : bool, OnPc : bool}
     val getPcLogin : transaction {Id : userId, Nam : string, Chair : bool}
@@ -63,7 +68,8 @@
                  val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $(map fst paper ++ paperPrivate)
                                                                           -> xml ([Body] ++ ctx) [] []
 
-                 functor Make (M : INPUT where con paper = map fst paper ++ paperPrivate)
+                 functor Make (M : INPUT where con paper = map fst paper ++ paperPrivate
+                                         where con review = map fst review)
                          : OUTPUT where con paper = map fst paper ++ paperPrivate
                                   where con userId = M.userId
                                   where con paperId = M.paperId
@@ -126,6 +132,7 @@
     structure O = M.Make(struct
                              val user = user
                              val paper = paper
+                             val review = review
                              val checkLogin = checkLogin
                              val getLogin = getLogin
                              val getPcLogin = getPcLogin