packages feed

bein 0.3 → 0.3.1

raw patch · 6 files changed

+34/−12 lines, 6 files

Files

Bein/Configuration.hs view
@@ -25,6 +25,7 @@   vminion_port <- readKey stmt "minion_port"   vhttp_port <- readKey stmt "http_port"   vhttp_base_url <- readKey stmt "http_base_url"+  vhttp_base_path <- readKey stmt "http_base_path"   vauthentication <- readKey stmt "authentication"   vtemplate_path <- readKey stmt "template_path"   vstatic_content_directory <- readKey stmt "static_content_directory"@@ -39,6 +40,7 @@     daemon_port = vdaemon_port,     minion_port = vminion_port,     http_port = vhttp_port,+    http_base_path = vhttp_base_path,     http_base_url = vhttp_base_url,      template_path = vtemplate_path,     authentication = vauthentication }
Bein/Types.hs view
@@ -37,6 +37,7 @@   minion_port :: String, -- By default .s.minion in the execution directory   http_port :: Int, -- default 8082   http_base_url :: String,+  http_base_path :: String,   template_path :: String,   authentication :: Authentication } deriving (Eq,Show,Read)
Bein/Web/Commands/Local.hs view
@@ -299,7 +299,10 @@ withUser act user = local (\st -> st { stUser = Just user }) act  asksBaseUrl :: BeinServerPart URL-asksBaseUrl = lift $ configField http_base_url >>= \b -> return $ if b == "" then "/" else b+asksBaseUrl = do+  bu <- lift $ configField http_base_url            +  bp <- lift $ configField http_base_path+  return $ joinURL bu bp  fullUrl :: URL -> BeinServerPart URL fullUrl b' = do
Bein/Web/Routing.hs view
@@ -1,5 +1,6 @@ module Bein.Web.Routing where +import Control.Monad import Data.Monoid import Bein.Web.Types import Bein.Web.Commands@@ -8,21 +9,34 @@ import Bein.Web.Pages.Settings import Bein.Web.Pages.SignOut import Bein.Web.Pages.New-import Happstack.Server+import Happstack.Server hiding (dirs) import Control.Monad.Trans import System.FilePath import Bein.Web.Pages.Login +breakAll :: (a -> Bool) -> [a] -> [[a]]+breakAll _ [] = []+breakAll f l  = let (a,b) = break f l+                in a : breakAll f (safeTail b)+                  where safeTail [] = []+                        safeTail (_:b) = b++dirs :: (ServerMonad m, MonadPlus m) => String -> m a -> m a+dirs d r = let ds = breakAll ('/'==) d+           in foldr (\p q -> (dir p).q) id ds $ r+ routing :: BeinServerPart Response-routing = mconcat [-  nullDir >> index,-  dir "login" $ login,-  dir "settings" $ settings,-  guardObject $ object,-  exactDir "signout" $ signOut,-  dir "new" $ newObject,-  staticData-  ]+routing = do+  basePath <- lift $ configField http_base_path        +  dirs basePath $ mconcat [+    nullDir >> index,+    dir "login" $ login,+    dir "settings" $ settings,+    guardObject $ object,+    exactDir "signout" $ signOut,+    dir "new" $ newObject,+    staticData+    ]  staticData :: BeinServerPart Response   staticData = mconcat [ staticFile "default.css" "text/css; charset=utf-8" ]
bein.cabal view
@@ -1,5 +1,5 @@ name:                bein-version:             0.3+version:             0.3.1 synopsis:            Bein is a provenance and workflow management system for bioinformatics. description:         To avoid having thousands of files produced in a random way from a bunch of scripts, as is typically the case for a bioinformaticist, Bein keeps track of scripts, and their executions on various inputs.  It provides a web front end, and will integrate with LSF clusters. category:            Application
sql/core_tables.sql view
@@ -388,6 +388,7 @@        'minion_port',        'http_port',        'http_base_url',+       'http_base_path',        'template_path',        'authentication'); @@ -407,6 +408,7 @@ insert into configuration (key,value) values ('minion_port','.s.MINION'); insert into configuration (key,value) values ('http_port',8082); insert into configuration (key,value) values ('http_base_url','');+insert into configuration (key,value) values ('http_base_path',''); insert into configuration (key,value) values ('authentication','None'); insert into configuration (key,value) values ('template_path','/home/ross/bein/templates');