Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 94 lines (80 sloc) 2.857 kb
daaafff @alsonkemp Initial commit
authored
1 module Turbinado.Controller (
2 -- limited export from Turbinado.Controller.Monad
3 Controller,
4 runController,
5 -- * Functions
1e33cd0 @alsonkemp Switching to HasEnvironment class; adding 'Components'; improving the OR...
authored
6 liftIO, catch,
daaafff @alsonkemp Initial commit
authored
7
c59c8d3 Checking in all of the Environment + Website changes
alson authored
8 redirectTo,
9 -- * Database
4c5c1b2 syncing with website code
alsonk authored
10 --quickQuery,
11 --quickQuery',
12 --run,
c59c8d3 Checking in all of the Environment + Website changes
alson authored
13 HDBC.SqlValue(..),
4c5c1b2 syncing with website code
alsonk authored
14 HDBC.toSql,
15 HDBC.fromSql,
16 HDBC.safeFromSql,
17 HDBC.nToSql,
18 HDBC.iToSql,
19 HDBC.posixToSql,
c59c8d3 Checking in all of the Environment + Website changes
alson authored
20
21 module Data.Maybe,
22
194a9f8 @alsonkemp Syncing with turbinado-website
authored
23 module Config.Master,
da95eda @alsonkemp Updating to match turbinado-website
authored
24 module Turbinado.Controller.Routes,
daaafff @alsonkemp Initial commit
authored
25 module Turbinado.Environment.CodeStore,
da95eda @alsonkemp Updating to match turbinado-website
authored
26 module Turbinado.Environment.Cookie,
727bbd2 @alsonkemp Syncing with website
authored
27 module Turbinado.Environment.Files,
a1aa2cd @alsonkemp Updating the ORM; Adding a mini-CMS; Adding a little HAML translator
authored
28 module Turbinado.Environment.Header,
c59c8d3 Checking in all of the Environment + Website changes
alson authored
29 module Turbinado.Environment.Logger,
a1aa2cd @alsonkemp Updating the ORM; Adding a mini-CMS; Adding a little HAML translator
authored
30 module Turbinado.Environment.Params,
daaafff @alsonkemp Initial commit
authored
31 module Turbinado.Environment.Request,
32 module Turbinado.Environment.Response,
c59c8d3 Checking in all of the Environment + Website changes
alson authored
33 module Turbinado.Environment.Settings,
34 module Turbinado.Environment.Types,
35 module Turbinado.Environment.ViewData
daaafff @alsonkemp Initial commit
authored
36 ) where
37
4c5c1b2 syncing with website code
alsonk authored
38 import Control.OldException (catchDyn)
daaafff @alsonkemp Initial commit
authored
39 import Control.Monad
40 import Control.Monad.State
41 import Control.Monad.Trans (MonadIO(..))
c59c8d3 Checking in all of the Environment + Website changes
alson authored
42 import Data.Maybe
daaafff @alsonkemp Initial commit
authored
43 import qualified Network.HTTP as HTTP
44 import Prelude hiding (catch)
c59c8d3 Checking in all of the Environment + Website changes
alson authored
45 import qualified Database.HDBC as HDBC
daaafff @alsonkemp Initial commit
authored
46
194a9f8 @alsonkemp Syncing with turbinado-website
authored
47 import Config.Master
a1aa2cd @alsonkemp Updating the ORM; Adding a mini-CMS; Adding a little HAML translator
authored
48 import Turbinado.Environment.CodeStore
da95eda @alsonkemp Updating to match turbinado-website
authored
49 import Turbinado.Environment.Cookie
c59c8d3 Checking in all of the Environment + Website changes
alson authored
50 import Turbinado.Environment.Database
727bbd2 @alsonkemp Syncing with website
authored
51 import Turbinado.Environment.Files
a1aa2cd @alsonkemp Updating the ORM; Adding a mini-CMS; Adding a little HAML translator
authored
52 import Turbinado.Environment.Header
c59c8d3 Checking in all of the Environment + Website changes
alson authored
53 import Turbinado.Environment.Logger
a1aa2cd @alsonkemp Updating the ORM; Adding a mini-CMS; Adding a little HAML translator
authored
54 import Turbinado.Environment.Params
daaafff @alsonkemp Initial commit
authored
55 import Turbinado.Environment.Request
56 import Turbinado.Environment.Response
a8f9a12 @alsonkemp still learning git... updates...
authored
57 import Turbinado.Environment.Settings
c59c8d3 Checking in all of the Environment + Website changes
alson authored
58 import Turbinado.Environment.Types
59 import Turbinado.Environment.ViewData
daaafff @alsonkemp Initial commit
authored
60 import Turbinado.Controller.Monad
da95eda @alsonkemp Updating to match turbinado-website
authored
61 import Turbinado.Controller.Routes
daaafff @alsonkemp Initial commit
authored
62 import Turbinado.Utility.General
c59c8d3 Checking in all of the Environment + Website changes
alson authored
63 import Turbinado.Server.StandardResponse
daaafff @alsonkemp Initial commit
authored
64
c59c8d3 Checking in all of the Environment + Website changes
alson authored
65 -- evalController :: Controller () -> Environment -> IO Environment
66 -- evalController p = runController p e
daaafff @alsonkemp Initial commit
authored
67
c59c8d3 Checking in all of the Environment + Website changes
alson authored
68 --
69 -- * Helper functions
70 --
daaafff @alsonkemp Initial commit
authored
71
c59c8d3 Checking in all of the Environment + Website changes
alson authored
72 redirectTo :: String -> Controller ()
73 redirectTo l = redirectResponse l
daaafff @alsonkemp Initial commit
authored
74
75 --
c59c8d3 Checking in all of the Environment + Website changes
alson authored
76 -- * Database functions
daaafff @alsonkemp Initial commit
authored
77 --
78
4c5c1b2 syncing with website code
alsonk authored
79 --quickQuery :: String -> [HDBC.SqlValue] -> Controller [[HDBC.SqlValue]]
80 --quickQuery s vs = do e <- get
81 -- let c = fromJust $ getDatabase e
82 -- liftIO $ HDBC.handleSqlError $ HDBC.quickQuery c s vs
c59c8d3 Checking in all of the Environment + Website changes
alson authored
83
4c5c1b2 syncing with website code
alsonk authored
84 --quickQuery' :: String -> [HDBC.SqlValue] -> Controller [[HDBC.SqlValue]]
85 --quickQuery' s vs = do e <- get
86 -- let c = fromJust $ getDatabase e
87 -- liftIO $ HDBC.handleSqlError $ HDBC.quickQuery' c s vs
c59c8d3 Checking in all of the Environment + Website changes
alson authored
88
4c5c1b2 syncing with website code
alsonk authored
89 --run :: String -> [HDBC.SqlValue] -> Controller Integer
90 --run s vs = do e <- get
91 -- let c = fromJust $ getDatabase e
92 -- liftIO $ HDBC.handleSqlError $ HDBC.run c s vs
c59c8d3 Checking in all of the Environment + Website changes
alson authored
93
Something went wrong with that request. Please try again.