Details
-
Task
-
Resolution: Fixed
-
Major
-
None
-
None
-
soc
-
Description
User Story 1. Search by query
1/ John has an XWiki installation. He wants to show the list of users of his wiki
java-api:
//$xwiki.search.searchByClass("XWiki.XWikiUsers", String ordercolumn, String orderdirection, int count, int start)
$xwiki.query.searchByClass("XWiki.XWikiUsers", "creationDate", "desc", 10, 0);
sql-like:
$xwiki.query.sqlsearch("from XWiki.XWikiUsers order by creationDate desc")
//show users
xquery-like:
$xwiki.query.xqysearch(
"for $u in /XWiki/XWikiUsers"+
"return [$u/first_name $u/last_name>$u/name]\n"
)
2/ He wants to show the list of users which lastname_name is begining by 'A'
sql-like:
$xwiki.query.sqlsearch("from XWiki.XWikiUsers where lastname_name like 'A%'")
xquery-like:
$xwiki.query.xqysearch(
"for $u in /XWiki/XWikiUsers where $u/last_name like 'A%'"
...
)
To be continued..
//more Java-API, Insert & Delete query
Notes:
sqlsearch language is similar to hql. But it use special classes and flex-attributes (fields of special class editable by web). It will be translate to real hql with additionals joins.
xqysearch need to be full translate to hql for hibernate.
Questions:
name for xwiki.query
maybe need a simplify syntax?
Comments are welcomed.
Attachments
Issue Links
- blocks
-
XWIKI-1426 Independent Query API for XWiki Proposal
- Closed