val decision = {Nam = "Decision",
Initialize = None,
Show = fn bo => cdata (case bo of
None => "?"
| Some True => "Accept"
| Some False => "Reject"),
Inject = _}
functor Make(M : sig
con paperOther :: {Type}
constraint [Id, Decision] ~ paperOther
include Conference.INPUT
where con paper = [Decision = option bool] ++ paperOther
val status : ctx ::: {Unit} -> [[Body] ~ ctx] => $([Id = paperId] ++ paperOther)
-> transaction (xml ([Body] ++ ctx) [] [])
end) = struct
open M
val linksForChair =
let
fun makeDecisions () =
ps <- queryX' (SELECT paper.Id, paper.Decision, paper.{{M.paperOther}}
FROM paper
ORDER BY paper.Id)
(fn r => st <- status (r.Paper -- #Decision);
return
{useMore (summarizePaper (r.Paper -- #Id))}
{useMore st}
);
return
Make acceptance decisions
and saveDecisions r =
List.app (fn {Paper = pid, Decision = dec} =>
dml (UPDATE paper
SET Decision = {[case dec of
"?" => None
| "Accept" => Some True
| "Reject" => Some False
| _ => error Invalid decision code]}
WHERE Id = {[readError pid]})) r.Papers;
makeDecisions ()
in