adamc@1022: signature INPUT = sig adamc@1023: con paper :: {Type} adamc@1022: constraint [Id, Document] ~ paper adamc@1022: adamc@1022: type userId adamc@1022: val userId_inj : sql_injectable_prim userId adamc@1022: table user : {Id : userId, Nam : string, Password : string, Chair : bool, OnPc : bool} adamc@1022: PRIMARY KEY Id, adamc@1022: CONSTRAINT Nam UNIQUE Nam adamc@1022: adamc@1022: type paperId adamc@1022: val paperId_inj : sql_injectable_prim paperId adamc@1023: val paperId_show : show paperId adamc@1023: val paperId_read : read paperId adamc@1023: table paper : ([Id = paperId, Document = blob] ++ paper) adamc@1022: PRIMARY KEY Id adamc@1022: adamc@1022: val checkLogin : transaction (option {Id : userId, Nam : string, Chair : bool, OnPc : bool}) adamc@1022: val getLogin : transaction {Id : userId, Nam : string, Chair : bool, OnPc : bool} adamc@1023: val getPcLogin : transaction {Id : userId, Nam : string, Chair : bool} adamc@1023: val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $paper -> xml ([Body] ++ ctx) [] [] adamc@1022: end adamc@1022: adamc@1022: signature OUTPUT = sig adamc@1023: con paper :: {Type} adamc@1022: type userId adamc@1022: type paperId adamc@1022: adamc@1022: val linksForPc : xbody adamc@1022: adamc@1022: con yourPaperTables :: {{Type}} adamc@1022: constraint [Paper] ~ yourPaperTables adamc@1022: val joinYourPaper : tabs ::: {{Type}} -> paper ::: {Type} adamc@1022: -> [[Paper] ~ tabs] => [[Paper] ~ yourPaperTables] => [tabs ~ yourPaperTables] => [[Id] ~ paper] => adamc@1022: sql_from_items ([Paper = [Id = paperId] ++ paper] ++ tabs) adamc@1022: -> sql_from_items (yourPaperTables ++ [Paper = [Id = paperId] ++ paper] ++ tabs) adamc@1022: end adamc@1022: adamc@1001: functor Make(M : sig adamc@1003: con paper :: {(Type * Type)} adamc@1010: constraint [Id, Document, Authors] ~ paper adamc@1004: val paper : $(map Meta.meta paper) adamc@1007: val paperFolder : folder paper adamc@1003: adamc@1001: con review :: {(Type * Type)} adamc@1003: constraint [Paper, User] ~ review adamc@1004: val review : $(map Meta.meta review) adamc@1011: val reviewFolder : folder review adamc@1006: adamc@1006: val submissionDeadline : time adamc@1023: val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $(map fst paper) -> xml ([Body] ++ ctx) [] [] adamc@1022: adamc@1023: functor Make (M : INPUT where con paper = map fst paper) adamc@1023: : OUTPUT where con paper = map fst paper adamc@1023: where con userId = M.userId adamc@1022: where con paperId = M.paperId adamc@1001: end) : sig adamc@1001: adamc@1001: val main : unit -> transaction page adamc@1001: adamc@1001: end