Changes for page Query API
Last modified by Vincent Massol on 2024/02/26 17:31
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- ExtensionCode.ExtensionClass[0]
-
- Description
-
... ... @@ -22,7 +22,7 @@ 22 22 |Search blogs per category|##where doc.fullName <> 'XWiki.ArticleClassTemplate' and :category member of doc.object(XWiki.ArticleClass).category##|##, BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate desc## 23 23 |List all tags|##select distinct obj.tags from Document doc, doc.object(XWiki.TagClass) as obj##|##select distinct tag from BaseObject as obj, DBStringListProperty as prop join prop.list as tag where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags'## 24 24 |List all blog posts, published and not hidden (filter by multiple properties of an object)|##from doc.object(Blog.BlogPostClass) as blog where blog.published = '1' and :category member of blog.category and blog.hidden = '0' and doc.web = 'Blog' order by blog.publishDate desc##|##, BaseObject as obj, IntegerProperty publishedProp, IntegerProperty hiddenProp, DateProperty publishDateProp, DBStringListProperty as categoryProp join categoryProp.list list where obj.name=doc.fullName and obj.className='Blog.BlogPostClass' and doc.space = 'Blog' and obj.id=categoryProp.id.id and categoryProp.id.name='category' and list='$category' and publishedProp.id.id = obj.id and publishedProp.id.name = 'published' and publishedProp.value = '1' and hiddenProp.id.id = obj.id and hiddenProp.id.name='hidden' and hiddenProp.value = '0' and publishDateProp.id.id = obj.id and publishDateProp.id.name='publishDate' order by publishDateProp.value desc##| 25 -|List documents having at least tags ##tag1## and ##tag2##|##from doc.object(XWiki.TagClass) as tag where 'tag1' member of tag.tags and 'tag2' member of tag.tags|, BaseObject as obj, DBStringListProperty as prop join prop.list item where obj.className='XWiki.TagClass' and obj.name=doc.fullName and obj.id=prop.id.id and prop.id.name='tags' and (lower(item)=lower('tag1' and 'tag2')) 25 +|List documents having at least tags ##tag1## and ##tag2##|##from doc.object(XWiki.TagClass) as tag where 'tag1' member of tag.tags and 'tag2' member of tag.tags|, BaseObject as obj, DBStringListProperty as prop join prop.list item where obj.className='XWiki.TagClass' and obj.name=doc.fullName and obj.id=prop.id.id and prop.id.name='tags' and (lower(item)=lower('tag1') and (lower(item)=lower('tag2')) 26 26 |Make a join between two objects that are not on the same document and are bound by a property|##from doc.object('Space.Class') as obj, Document doc1, doc1.object('Space.Class1') obj1 where obj.prop1 = doc1.fullName and obj1.prop2 like '%text%' order by obj1.prop3 |{{todo/}} 27 27 28 28 {{warning}}Note that when using XWQL, it's mandatory to use aliases when filtering for multiple properties of an object; it's not possible to use the abbreviated syntax ##doc.object(Blog.BlogPostClass).propertyName## multiple times in the same query. {{/warning}}