Skip to content
This repository
Browse code

More cleanup...

  • Loading branch information...
commit 1a1e99ee618d29579290bd5f7c3fc30ba775eb2e 1 parent e3c988f
Alson Kemp authored December 26, 2008
2  Turbinado/Environment/Types.hs
@@ -63,7 +63,7 @@ data CodeStore  = CodeStore (MVar CodeMap)
63 63
 type CodeMap    = M.Map CodeLocation CodeStatus
64 64
 data CodeStatus = CodeLoadMissing |
65 65
                   CodeLoadFailure String |
66  
-                  CodeLoadController (StateT Environment IO ()) Module CodeDate |
  66
+                  CodeLoadController          (StateT Environment IO ())                 Module CodeDate |
67 67
                   CodeLoadView                (XMLGenT (StateT Environment IO) XML     ) Module CodeDate |
68 68
                   CodeLoadComponentController (StateT Environment IO ())                 Module CodeDate |
69 69
                   CodeLoadComponentView       (XMLGenT (StateT Environment IO) XML     ) Module CodeDate
2  Turbinado/Server.hs
@@ -68,7 +68,7 @@ startServer pnr
68 68
     = withSocketsDo $ 
69 69
       do e <- runController 
70 70
                (sequence_ $ [ addLoggerToEnvironment
71  
-                                       , addCodeStoreToEnvironment
  71
+                            , addCodeStoreToEnvironment
72 72
                             , addMimeTypesToEnvironment "Config/mime.types"]
73 73
                             ++ customSetupFilters
74 74
                ) 
19  Turbinado/View.hs
@@ -60,6 +60,25 @@ evalView p = do e <- getEnvironment
60 60
 defaultContentType :: String
61 61
 defaultContentType = "text/html; charset=ISO-8859-1"
62 62
 
  63
+insertDefaultView :: View XML
  64
+insertDefaultView = 
  65
+             do cl <- getView
  66
+                debugM $ "    Layout: insertDefaultView : loading   " ++ (fst cl) ++ " - " ++ (snd cl)
  67
+                c <- retrieveCode CTView cl
  68
+                case c of
  69
+                  CodeLoadView       v _ _ -> v 
  70
+                  CodeLoadController _ _ _ -> error "retrieveAndRunLayout called, but returned CodeLoadController"
  71
+                  CodeLoadFailure    e     -> return $ cdata e
  72
+
  73
+insertView :: String -> String -> View XML
  74
+insertView c a = 
  75
+             do debugM $ "    Layout: insertView : loading   " ++ c ++ " - " ++ a
  76
+                c <- retrieveCode CTView (c, (toLower (head a)):(tail a))
  77
+                case c of
  78
+                  CodeLoadView       v _ _ -> v 
  79
+                  CodeLoadController _ _ _ -> error "retrieveAndRunLayout called, but returned CodeLoadController"
  80
+                  CodeLoadFailure    e     -> return $ cdata e
  81
+ 
63 82
 insertComponent :: String -> String -> [(String, String)] -> View XML
64 83
 insertComponent controller action opts =
65 84
            do debugM $ " insertComponent: Starting"

0 notes on commit 1a1e99e

Please sign in to comment.
Something went wrong with that request. Please try again.