, entityIsTheme :: !Bool -- text/css 以外では無意味
, entityIsFeed :: !Bool -- text/x-rakka 以外では無意味
, entityIsLocked :: !Bool
- , entityIsBoring :: !Bool
, entityIsBinary :: !Bool
, entityRevision :: RevNum
, entityLastMod :: UTCTime
isEntity :: Page -> Bool
-isEntity (Entity _ _ _ _ _ _ _ _ _ _ _ _ _ _) = True
-isEntity _ = False
+isEntity (Entity _ _ _ _ _ _ _ _ _ _ _ _ _) = True
+isEntity _ = False
pageName :: Page -> PageName
-> none
)
+= sattr "isLocked" (yesOrNo $ entityIsLocked page)
- += sattr "isBoring" (yesOrNo $ entityIsBoring page)
+= sattr "isBinary" (yesOrNo $ entityIsBinary page)
+= sattr "revision" (show $ entityRevision page)
+= sattr "lastModified" (formatW3CDateTime lastMod)
>>> parseYesOrNo) -< tree
isLocked <- (withDefault (getXPathTreesInDoc "/page/@isLocked/text()" >>> getText) "no"
>>> parseYesOrNo) -< tree
- isBoring <- (withDefault (getXPathTreesInDoc "/page/@isBoring/text()" >>> getText) "no"
- >>> parseYesOrNo) -< tree
summary <- (maybeA (getXPathTreesInDoc "/page/summary/text()"
>>> getText
, entityIsTheme = isTheme
, entityIsFeed = isFeed
, entityIsLocked = isLocked
- , entityIsBoring = isBoring
, entityIsBinary = isBinary
, entityRevision = undefined
, entityLastMod = undefined
, entityIsTheme = any ((== "rakka:isTheme") . fst) props
, entityIsFeed = any ((== "rakka:isFeed") . fst) props
, entityIsLocked = any ((== "rakka:isLocked") . fst) props
- , entityIsBoring = any ((== "rakka:isBoring") . fst) props
, entityIsBinary = case mimeType of
MIMEType "text" _ _
-> any ((== "rakka:isBinary") . fst) props
setNodeProp path "rakka:isTheme" Nothing
setNodeProp path "rakka:isFeed" Nothing
setNodeProp path "rakka:isLocked" Nothing
- setNodeProp path "rakka:isBoring" Nothing
setNodeProp path "rakka:isBinary" Nothing
setNodeProp path "rakka:summary" Nothing
setNodeProp path "rakka:otherLang" Nothing
setNodeProp path "rakka:isTheme" (encodeFlag $ entityIsTheme page)
setNodeProp path "rakka:isFeed" (encodeFlag $ entityIsFeed page)
setNodeProp path "rakka:isLocked" (encodeFlag $ entityIsLocked page)
- setNodeProp path "rakka:isBoring" (encodeFlag $ entityIsBoring page)
setNodeProp path "rakka:isBinary" (encodeFlag $ entityIsBinary page)
setNodeProp path "rakka:summary" (entitySummary page)
setNodeProp path "rakka:otherLang" (let otherLang = entityOtherLang page
pType <- getXPathTreesInDoc "/page/@type/text()" >>> getText -< tree
pLastMod <- getXPathTreesInDoc "/page/@lastModified/text()" >>> getText -< tree
pIsLocked <- getXPathTreesInDoc "/page/@isLocked/text()" >>> getText -< tree
- pIsBoring <- getXPathTreesInDoc "/page/@isBoring/text()" >>> getText -< tree
pIsBinary <- getXPathTreesInDoc "/page/@isBinary/text()" >>> getText -< tree
pRevision <- getXPathTreesInDoc "/page/@revision/text()" >>> getText -< tree
pLang <- maybeA (getXPathTreesInDoc "/page/@lang/text()" >>> getText) -< tree
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:isBoring") -< (doc, Just pIsBoring)
arrIO2 (flip setAttribute "rakka:isBinary") -< (doc, Just pIsBinary)
arrIO2 (flip setAttribute "rakka:revision") -< (doc, Just pRevision)
arrIO2 (flip setAttribute "rakka:summary" ) -< (doc, pSummary)
cond <- newCondition
setPhrase cond "[UVSET]"
- addAttrCond cond "rakka:isBoring STREQ no"
addAttrCond cond "rakka:summary STRNE" -- summary が空でない
setOrder cond "@mdate NUMD"
setMax cond items
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
- type="image/jpeg"
- isBoring="yes">
+ type="image/jpeg">
<binaryData>
/9j/4AAQSkZJRgABAQEAYABgAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD/2wBDABgREhUS
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
- type="image/jpeg"
- isBoring="yes">
+ type="image/jpeg">
<binaryData>
/9j/4AAQSkZJRgABAQEAYABgAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD/2wBDAAUDBAQE
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
type="text/x-rakka"
- isBoring="yes"
lang="en">
<textData><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
type="text/x-rakka"
- isBoring="yes"
lang="en">
<otherLang>
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
- type="text/x-rakka"
- isBoring="yes">
+ type="text/x-rakka">
<textData><![CDATA[
<pageName />
]]></textData>
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
- type="text/x-rakka"
- isBoring="yes">
+ type="text/x-rakka">
<textData><![CDATA[
= Outline =
<outline />
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
- type="text/x-rakka"
- isBoring="yes">
+ type="text/x-rakka">
<textData><![CDATA[
= Control =
* <newPage />
<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://cielonegro.org/schema/Rakka/Page/1.0"
type="text/css"
- isBoring="yes"
isTheme="yes">
<textData>
/* global configuration *******************************************************/
</attribute>
</optional>
- <optional>
- <!-- 更新履歴や RSS から削除されるフラグ -->
- <attribute name="isBoring">
- <choice>
- <value>yes</value>
- <value>no</value>
- </choice>
- </attribute>
- </optional>
-
<interleave>
<optional>
<element name="summary">