Skip to content

Commit

Permalink
More cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
alsonkemp committed Dec 27, 2008
1 parent e3c988f commit 1a1e99e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Turbinado/Environment/Types.hs
Expand Up @@ -63,7 +63,7 @@ data CodeStore = CodeStore (MVar CodeMap)
type CodeMap = M.Map CodeLocation CodeStatus
data CodeStatus = CodeLoadMissing |
CodeLoadFailure String |
CodeLoadController (StateT Environment IO ()) Module CodeDate |
CodeLoadController (StateT Environment IO ()) Module CodeDate |
CodeLoadView (XMLGenT (StateT Environment IO) XML ) Module CodeDate |
CodeLoadComponentController (StateT Environment IO ()) Module CodeDate |
CodeLoadComponentView (XMLGenT (StateT Environment IO) XML ) Module CodeDate
Expand Down
2 changes: 1 addition & 1 deletion Turbinado/Server.hs
Expand Up @@ -68,7 +68,7 @@ startServer pnr
= withSocketsDo $
do e <- runController
(sequence_ $ [ addLoggerToEnvironment
, addCodeStoreToEnvironment
, addCodeStoreToEnvironment
, addMimeTypesToEnvironment "Config/mime.types"]
++ customSetupFilters
)
Expand Down
19 changes: 19 additions & 0 deletions Turbinado/View.hs
Expand Up @@ -60,6 +60,25 @@ evalView p = do e <- getEnvironment
defaultContentType :: String
defaultContentType = "text/html; charset=ISO-8859-1"

insertDefaultView :: View XML
insertDefaultView =
do cl <- getView
debugM $ " Layout: insertDefaultView : loading " ++ (fst cl) ++ " - " ++ (snd cl)
c <- retrieveCode CTView cl
case c of
CodeLoadView v _ _ -> v
CodeLoadController _ _ _ -> error "retrieveAndRunLayout called, but returned CodeLoadController"
CodeLoadFailure e -> return $ cdata e

insertView :: String -> String -> View XML
insertView c a =
do debugM $ " Layout: insertView : loading " ++ c ++ " - " ++ a
c <- retrieveCode CTView (c, (toLower (head a)):(tail a))
case c of
CodeLoadView v _ _ -> v
CodeLoadController _ _ _ -> error "retrieveAndRunLayout called, but returned CodeLoadController"
CodeLoadFailure e -> return $ cdata e

insertComponent :: String -> String -> [(String, String)] -> View XML
insertComponent controller action opts =
do debugM $ " insertComponent: Starting"
Expand Down

0 comments on commit 1a1e99e

Please sign in to comment.