where
extMap :: [(String, MIMEType)]
extMap = [ ("html", read "application/xhtml+xml")
- , ( "rdf", read "application/rdf+xml" )
+ , ( "rdf", read "application/rss+xml" )
, ( "xml", read "text/xml" )
]
import Rakka.W3CDateTime
import Rakka.Wiki.Engine
import System.FilePath
+import Text.HyperEstraier hiding (getText)
import Text.XML.HXT.Arrow.Namespace
import Text.XML.HXT.Arrow.WriteDocument
import Text.XML.HXT.Arrow.XmlArrow
rev -> foundEntity (strongETag $ show rev) (entityLastMod page)
outputXmlPage tree [ (MIMEType "application" "xhtml+xml" [], entityToXHTML env)
- , (MIMEType "application" "rdf+xml" [], entityToRSS env)
+ , (MIMEType "application" "rss+xml" [], entityToRSS env)
]
let cssHref = [uriToString id (mkObjectURI baseURI styleSheet) ""]
scriptSrc = [uriToString id (baseURI { uriPath = uriPath baseURI </> "js" }) ""]
+ feeds <- arrIO0 (findFeeds (envStorage env)) -< ()
+
pageTitle <- listA (readSubPage env) -< (name, Just page, "PageTitle")
leftSideBar <- listA (readSubPage env) -< (name, Just page, "SideBar/Left")
rightSideBar <- listA (readSubPage env) -< (name, Just page, "SideBar/Right")
+= sattr "type" "text/css"
+= attr "href" (arr id >>> mkText)
)
+ += ( constL feeds
+ >>>
+ eelem "link"
+ += sattr "rel" "alternate"
+ += sattr "type" "application/rss+xml"
+ += attr "title" (txt siteName <+> txt " - " <+> mkText)
+ += attr "href" (arr (mkFeedURIStr baseURI) >>> mkText)
+ )
+= ( constL scriptSrc
>>>
eelem "script"
+= sattr "xmlns:dc" "http://purl.org/dc/elements/1.1/"
+= sattr "xmlns:trackback" "http://madskills.com/public/xml/rss/module/trackback/"
+= ( eelem "channel"
- += sattr "rdf:about" (uriToString id (mkRDFURI baseURI name) "")
+ += sattr "rdf:about" (uriToString id (mkFeedURI baseURI name) "")
+= ( eelem "title"
+= txt siteName
+= txt " - "
= do userID <- getUserID env
status <- deletePage (envStorage env) userID name
setStatus status
+
+
+findFeeds :: Storage -> IO [PageName]
+findFeeds sto
+ = do cond <- newCondition
+ setPhrase cond "[UVSET]"
+ addAttrCond cond "rakka:isFeed STREQ yes"
+ setOrder cond "@uri STRA"
+ result <- searchPages sto cond
+ return (map fst result)
+
+
+mkFeedURIStr :: URI -> PageName -> String
+mkFeedURIStr baseURI name
+ = uriToString id (mkFeedURI baseURI name) ""
\ No newline at end of file
pIsBinary <- getXPathTreesInDoc "/page/@isBinary/text()" >>> getText -< tree
pRevision <- getXPathTreesInDoc "/page/@revision/text()" >>> getText -< tree
pLang <- maybeA (getXPathTreesInDoc "/page/@lang/text()" >>> getText) -< tree
- pFileName <- maybeA (getXPathTreesInDoc "/page/@fileName/text()" >>> getText) -< tree
pIsTheme <- maybeA (getXPathTreesInDoc "/page/@isTheme/text()" >>> getText) -< tree
pIsFeed <- maybeA (getXPathTreesInDoc "/page/@isFeed/text()" >>> getText) -< tree
pSummary <- maybeA (getXPathTreesInDoc "/page/summary/text()" >>> getText) -< tree
arrIO2 (flip setAttribute "@type" ) -< (doc, Just pType)
arrIO2 (flip setAttribute "@mdate" ) -< (doc, Just pLastMod)
arrIO2 (flip setAttribute "@lang" ) -< (doc, pLang)
- arrIO2 (flip setAttribute "rakka:fileName") -< (doc, pFileName)
arrIO2 (flip setAttribute "rakka:isLocked") -< (doc, Just pIsLocked)
arrIO2 (flip setAttribute "rakka:isBinary") -< (doc, Just pIsBinary)
arrIO2 (flip setAttribute "rakka:revision") -< (doc, Just pRevision)