sto = ctxStorage ctx
cond <- newCondition
- setPhrase cond "[UVSET]"
when onlyEntity
$ addAttrCond cond "@type STRNE application/x-rakka-redirection"
when onlySummarized
$ addAttrCond cond "rakka:summary STRNE" -- summary が空でない
- setOrder cond "@mdate NUMD"
- setMax cond items
+ setPhrase cond "[UVSET]"
+ setOrder cond "@mdate NUMD"
+ setMax cond items
result <- searchPages sto cond
- pages <- mapM ( \ (name, rev)
- -> getPage sto name (Just rev) >>= return . fromJust
- ) result
+ pages <- mapM (getPageByHP sto) (srPages result)
mkPageList showSummary pages
}
where
+ getPageByHP :: Storage -> HitPage -> IO Page
+ getPageByHP sto hp
+ = getPage sto (hpPageName hp) (Just (hpPageRev hp)) >>= return . fromJust
+
mkPageList :: Bool -> [Page] -> IO BlockElement
mkPageList showSummary pages
= do items <- mapM (mkListItem showSummary) pages