From 70da89d392d5c9649157e53944db9a49d2149da3 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 1 Nov 2009 14:26:20 -0500 Subject: Initial form for paper assignment --- demo/more/conference.ur | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'demo/more/conference.ur') diff --git a/demo/more/conference.ur b/demo/more/conference.ur index e810043b..7b3d3d71 100644 --- a/demo/more/conference.ur +++ b/demo/more/conference.ur @@ -12,12 +12,14 @@ signature INPUT = sig val paperId_inj : sql_injectable_prim paperId val paperId_show : show paperId val paperId_read : read paperId + val paperId_eq : eq paperId table paper : ([Id = paperId, Document = blob] ++ paper) PRIMARY KEY Id 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} + val checkChair : transaction unit val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $paper -> xml ([Body] ++ ctx) [] [] end @@ -27,6 +29,7 @@ signature OUTPUT = sig type paperId val linksForPc : xbody + val linksForChair : xbody con yourPaperTables :: {{Type}} constraint [Paper] ~ yourPaperTables @@ -105,12 +108,20 @@ functor Make(M : sig else error You are not on the PC. + val checkChair = + r <- getLogin; + if r.Chair then + return () + else + error You are not a chair. + structure O = M.Make(struct val user = user val paper = paper val checkLogin = checkLogin val getLogin = getLogin val getPcLogin = getPcLogin + val checkChair = checkChair val summarizePaper = @@M.summarizePaper end) @@ -203,7 +214,10 @@ functor Make(M : sig
Welcome, {[me.Nam]}!
{if me.Chair then -
  • Manage users
  • + +
  • Manage users
  • + {O.linksForChair} +
    else } -- cgit v1.2.3