content: -- ----------------------------------------------------------------------------
  {- |
  
    Module     : 
    Copyright  : Copyright (C) 2008 Stefan Schmidt
    License    : MIT
  
    Maintainer : Stefan Schmidt (stefanschmidt@web.de)
    Stability  : experimental
    Portability: portable
    Version    : 0.1
  
  
  -}
  -- ----------------------------------------------------------------------------
  
  module Main(main) where
  
  import           Holumbus.Common.Logging
  import           Holumbus.Common.Utils                         	( handleAll )
  import           Holumbus.Network.PortRegistry.PortRegistryPort
  import qualified Holumbus.FileSystem.FileSystem 		as FS
  import qualified Holumbus.FileSystem.UserInterface 		as UI
  
  
  version :: String
  version = "Holumbus-FileSystem Standalone-Controller 0.1"
  
  
  main :: IO ()
  main
    = do
      putStrLn version
      handleAll (\e -> putStrLn $ "EXCEPTION: " ++ show e) $
        do
        initializeLogging []
        p <- newPortRegistryFromXmlFile "/tmp/registry.xml"
        setPortRegistry p
        fs <- initializeData
        UI.runUI fs version      
        deinitializeData fs
  
  
  initializeData :: IO (FS.FileSystem)
  initializeData 
    = do
      fs <- FS.mkFileSystemController FS.defaultFSControllerConfig
      return fs
  
  
  deinitializeData :: FS.FileSystem -> IO ()
  deinitializeData fs
    = do
      FS.closeFileSystem fs
  
  -- ----------------------------------------------------------------------------
  