Commit 3775f12a authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

I have added the interface to gerda

database applications do not work yet
but all non-database examples seem to work
All examples have been adjusted
because all form usage do need a derive of gerda

Rinus 11-10-2006
parent 45e16e46
......@@ -28,10 +28,12 @@ where
fromLivetime Session PlainString = "S"
fromLivetime Persistent PlainString = "P"
fromLivetime PersistentRO PlainString = "R"
fromLivetime Database PlainString = "D"
fromLivetime Page StaticDynamic = "n"
fromLivetime Session StaticDynamic = "s"
fromLivetime Persistent StaticDynamic = "p"
fromLivetime PersistentRO StaticDynamic = "r"
fromLivetime Database StaticDynamic = "d"
// de-serialize Html State
......@@ -64,16 +66,20 @@ where
toLivetime ['p':_] = Persistent
toLivetime ['R':_] = PersistentRO
toLivetime ['r':_] = PersistentRO
toLivetime ['D':_] = Database
toLivetime ['d':_] = Database
toLivetime _ = Page
toStorageFormat ['N':_] = PlainString
toStorageFormat ['S':_] = PlainString
toStorageFormat ['P':_] = PlainString
toStorageFormat ['R':_] = PlainString
toStorageFormat ['D':_] = PlainString
toStorageFormat ['n':_] = StaticDynamic
toStorageFormat ['p':_] = StaticDynamic
toStorageFormat ['s':_] = StaticDynamic
toStorageFormat ['r':_] = StaticDynamic
toStorageFormat ['d':_] = StaticDynamic
toStorageFormat _ = PlainString
// reconstruct HtmlState out of the information obtained from browser
......@@ -156,6 +162,7 @@ where
Persistent -> "Persistent";
PersistentRO -> "Persistent Read Only"
Session -> "Session";
Database -> "Database";
_ -> "Page"
showf storage = case storage of PlainString -> "String"; _ -> "Dynamic"
shows PlainString s = s
......
......@@ -7,6 +7,7 @@ derive gForm MachineState, Output, Product
derive gUpd MachineState, Output, Product
derive gPrint MachineState, Output, Product
derive gParse MachineState, Output, Product
derive gerda MachineState, Output, Product
//Start world = doHtml coffeemachine world
......
......@@ -18,6 +18,14 @@ mainEntrance hst
[ BodyTag body
] hst
//Start world = doHtmlServer test world
test hst
= mkHtml "test" [BodyTag (download "back35.jpg")] hst
where
download url = [A [Lnk_Href url, Lnk_Target Trg__Blank] [Txt "click here"]]
// login page handling
loginhandling :: *HSt -> ([BodyTag],*HSt)
......@@ -53,6 +61,7 @@ derive gForm CurrPage
derive gUpd CurrPage
derive gPrint CurrPage
derive gParse CurrPage
derive gerda CurrPage
homePage :: Member -> CurrPage
homePage (ConfManager info) = RootHomePage
......@@ -181,6 +190,7 @@ derive gForm GuestPages
derive gUpd GuestPages
derive gParse GuestPages
derive gPrint GuestPages
derive gerda GuestPages
guestHomePage account accounts hst
# (subpagef,hst) = guestSubPages Init id hst
......
......@@ -34,6 +34,13 @@ derive gParse
RefPaper, Paper, PaperInfo, Co_authors, RefDiscussion,
PaperStatus, Discussion, DiscussionStatus, Message
derive gerda
Login, Account, Member, ManagerInfo, RefereeInfo, Conflicts,
RefPerson, Person,
Reports, RefReport, Report, Recommendation, Familiarity,
RefPaper, Paper, PaperInfo, Co_authors, RefDiscussion,
PaperStatus, Discussion, DiscussionStatus, Message
// Naming convention of shared persistent information
uniqueDBname :== "conferenceDBS" // accounts database
......
......@@ -168,3 +168,10 @@ derive gParse
Reports, RefReport, Report, Recommendation, Familiarity,
RefPaper, Paper, PaperInfo, Co_authors, RefDiscussion,
PaperStatus, Discussion, DiscussionStatus, Message
derive gerda
Login, Account, Member, ManagerInfo, RefereeInfo, Conflicts,
RefPerson, Person,
Reports, RefReport, Report, Recommendation, Familiarity,
RefPaper, Paper, PaperInfo, Co_authors, RefDiscussion,
PaperStatus, Discussion, DiscussionStatus, Message,
Ref2
......@@ -7,6 +7,7 @@ derive gForm Login
derive gUpd Login
derive gPrint Login
derive gParse Login
derive gerda Login
// this session login form will be used at every event to check whether the end user is indeed administrated
......
......@@ -66,6 +66,8 @@ example5 hst
derive gParse MInt
derive gPrint MInt
derive gUpd MInt
derive gerda MInt
gForm{|MInt|} (init,formid) hst = specialize asCounter (init,formid) hst
where
asCounter (init,formId) hst
......
......@@ -88,6 +88,7 @@ derive gUpd State
derive gForm State
derive gParse State
derive gPrint State
derive gerda State
derive gForm []
derive gUpd []
......
......@@ -10,20 +10,6 @@ import tree
Start world = doHtmlServer MyPage world
MyPage hst
# (mycircuitf,hst) = startCircuit mycircuit 0 hst
# [form,displ:_] = mycircuitf.form
= mkHtml "List to Balance Tree"
[ H1 [] "List to Balance Tree"
, form
, displ
] hst
where
mycircuit = edit (nFormId "getal" 0) >>> loops (
arr (\(a,b) -> (a,b+1)) >>>
arr (\(a,b) -> (a+b,b))) >>> display (nFormId "uitkomst" 0)
MyPage hst
# (mycircuitf,hst) = startCircuit mycircuit [1] hst
# [list,tree:_] = mycircuitf.form
......
......@@ -8,14 +8,15 @@ import tree
derive gForm []
derive gUpd []
derive gForm Record
derive gUpd Record
derive gParse Record
derive gPrint Record
derive gerda Record
Start world = doHtmlServer MyPage4 world
//Start world = doHtml MyPage world
//Start world = doHtmlServer MyPage4 world
Start world = doHtmlServer MyPage world
:: Record = {name :: String, address :: String, zipcode :: Int}
......@@ -31,9 +32,7 @@ MyPage4 hst
, BodyTag myrecord.form
] hst
myBalancedTree = nFormId "BalancedTree" (fromListToBalTree [0])
myBalancedTree = pFormId "BalancedTree" (fromListToBalTree [0])
mySortedList = nFormId "SortedList" [0]
MyPage hst
......
......@@ -7,6 +7,7 @@ derive gForm Machine, Output, Product
derive gUpd Machine, Output, Product
derive gPrint Machine, Output, Product
derive gParse Machine, Output, Product
derive gerda Machine, Output, Product
//Start world = doHtml coffeemachine world
Start world = doHtmlServer coffeemachine world
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment