)
where
+import qualified Codec.Binary.UTF8.String as UTF8
import Network.HTTP.Lucu
-import Network.HTTP.Lucu.Utils
import Rakka.Environment
import Rakka.Page
import Rakka.Storage
import Rakka.SystemConfig
+import System.FilePath.Posix
resObject :: Environment -> ResourceDef
}
where
toPageName :: [String] -> PageName
- toPageName = decodePageName . joinWith "/"
+ toPageName = UTF8.decodeString . joinPath
handleGet :: Environment -> PageName -> Resource ()
fallbackPageEntity :: Environment -> [String] -> IO (Maybe ResourceDef)
fallbackPageEntity env path
- | null path = return Nothing
- | null $ head path = return Nothing
- | isLower $ head $ head path = return Nothing -- 先頭の文字が小文字であってはならない
+ | null name = return Nothing
+ | isLower $ head name = return Nothing -- 先頭の文字が小文字であってはならない
| otherwise
= return $ Just $ ResourceDef {
resUsesNativeThread = False
, resIsGreedy = True
- , resGet = Just $ handleGet env (toPageName path)
+ , resGet = Just $ handleGet env name
, resHead = Nothing
, resPost = Nothing
- , resPut = Just $ handlePut env (toPageName path)
- , resDelete = Just $ handleDelete env (toPageName path)
+ , resPut = Just $ handlePut env name
+ , resDelete = Just $ handleDelete env name
}
where
- toPageName :: [String] -> PageName
- toPageName = decodePageName . dropExtension . joinPath
+ name :: PageName
+ name = (dropExtension . UTF8.decodeString . joinPath) path
handleGet :: Environment -> PageName -> Resource ()
)
where
+import qualified Codec.Binary.UTF8.String as UTF8
import Control.Arrow
import Control.Arrow.ArrowIO
import Control.Arrow.ArrowList
import Control.Monad.Trans
import qualified Data.ByteString.Lazy as Lazy
import Network.HTTP.Lucu
-import Network.HTTP.Lucu.Utils
import OpenSSL.EVP.Base64
import Rakka.Environment
import Rakka.Page
import Rakka.Utils
import Rakka.Wiki.Engine
+import System.FilePath.Posix
import Text.XML.HXT.Arrow.Namespace
import Text.XML.HXT.Arrow.WriteDocument
import Text.XML.HXT.Arrow.XmlArrow
}
where
toPageName :: [String] -> PageName
- toPageName = decodePageName . joinWith "/"
+ toPageName = UTF8.decodeString . joinPath
{-
import Network.HTTP
import Network.HTTP.Lucu
import Network.HTTP.Lucu.Response
-import Network.HTTP.Lucu.Utils
import Network.URI
import Rakka.Environment
import Rakka.Page
}
where
toPageName :: [String] -> PageName
- toPageName = decodePageName . joinWith "/"
+ toPageName = UTF8.decodeString . joinPath
handlePost :: Environment -> PageName -> Resource ()