Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More cleanup...

  • Loading branch information...
commit 1a1e99ee618d29579290bd5f7c3fc30ba775eb2e 1 parent e3c988f
@alsonkemp alsonkemp authored
View
2  Turbinado/Environment/Types.hs
@@ -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
View
2  Turbinado/Server.hs
@@ -68,7 +68,7 @@ startServer pnr
= withSocketsDo $
do e <- runController
(sequence_ $ [ addLoggerToEnvironment
- , addCodeStoreToEnvironment
+ , addCodeStoreToEnvironment
, addMimeTypesToEnvironment "Config/mime.types"]
++ customSetupFilters
)
View
19 Turbinado/View.hs
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.