Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-1427

User Stories 4 Independent Query API for XWiki

    XMLWordPrintable

Details

    • 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

          Activity

            People

              amelentev Artem Melentev
              amelentev Artem Melentev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: