I just released a version 7.4-1 of the helper to use as parent in
contrib Maven projects.
Fix two issues with enforcer plugin (for platform projects).
See https://github.com/xwiki-contrib/parent for more details about the project.
--
Thomas Mortagne
In our Xwiki, I've added some fields such as birthday (of type Date) to the
user profile. I'd like to implement a REST call that retrieves all of the
non-hidden users with birthdays in a specific month (typically the current
month) and some specific attribute values. Right now the values I want are
the first name, last name, birthday and the link to the avatar image file. I
have bits and pieces of the solution but am having trouble with some parts -
specifically how to put it together into a single REST call.
PROBLEM 1: I can create a page with a script like the following to filter
some users and display their names.
{{velocity}}
#set ($tags=$services.query.xwql("select obj.first_name from Document doc,
doc.object(XWiki.XWikiUsers) as obj where (obj.first_name LIKE '%a%' and
(doc.hidden <> true OR doc.hidden is null))").execute())
$tags
{{/velocity}}
But if I try to execute that query in a REST call like the following, the
result is different
.../rest/wikis/query?q=select+obj.first_name+from+Document+doc%2C+doc.object%28XWiki.XWikiUsers%29+as+obj+where+%28obj.first_name+LIKE+%27%25a%25%27+and+%28doc.hidden+%3C%3E+true+OR+doc.hidden+is+null%29%29&type=xwql
The REST call returns some data completely unrelated to the users:
<searchResults
template="http://...rest?q={solrquery}(&number={number})(&start={start})(&orderField={fieldname}(&order={asc|desc}))(&distinct=1)(&prettyNames={false|true})(&wikis={wikis})(&className={classname})"><searchResult><link
href="http://...rest/wikis/xwiki/spaces/XWiki/pages/DocumentTreeMacros"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:XWiki.DocumentTreeMacros</id><pageFullName>XWiki.DocumentTreeMacros</pageFullName><wiki>xwiki</wiki><space>XWiki</space><pageName>DocumentTreeMacros</pageName><modified>2016-02-15T12:14:34-03:00</modified><author>xwiki:XWiki.Admin</author><version>4.1</version><score>0.62450576</score></searchResult><searchResult><link
href="http://...rest/wikis/xwiki/spaces/XWiki/pages/DocumentTree"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:XWiki.DocumentTree</id><pageFullName>XWiki.DocumentTree</pageFullName><wiki>xwiki</wiki><space>XWiki</space><pageName>DocumentTree</pageName><modified>2016-01-27T10:23:05-03:00</modified><author>xwiki:XWiki.Admin</author><version>2.1</version><score>0.5804536</score></searchResult><searchResult><link
href="http://...rest/wikis/xwiki/spaces/Panels/pages/DocumentInformation"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:Panels.DocumentInformation</id><pageFullName>Panels.DocumentInformation</pageFullName><wiki>xwiki</wiki><space>Panels</space><pageName>DocumentInformation</pageName><modified>2016-01-12T09:56:52-03:00</modified><author>xwiki:XWiki.superadmin</author><version>1.1</version><score>0.4841085</score></searchResult>
PROBLEM 2: If I try to implement a query that retrieves multiple fields from
the user profile like the following:
{{velocity}}
#set ($tags=$services.query.xwql("select obj.first_name, obj.last_name,
obj.birthday from Document doc, doc.object(XWiki.XWikiUsers) as obj where
(obj.first_name LIKE '%a%' and (doc.hidden <> true OR doc.hidden is
null))").execute())
$tags
{{/velocity}}
the data displayed in the xwiki page looks like the following instead the
actual attribute values:
[[Ljava.lang.Object;@723f4d95, [Ljava.lang.Object;@4054e1bb,
[Ljava.lang.Object;@436c8d04, [Ljava.lang.Object;@5c93ddc1,
[Ljava.lang.Object;@54c86023, [Ljava.lang.Object;@33760a38,
[Ljava.lang.Object;@14d5b5ff, [Ljava.lang.Object;@566a1f71,
[Ljava.lang.Object;@41b4b4e7, [Ljava.lang.Object;@42904123,
[Ljava.lang.Object;@7b536ec3, [Ljava.lang.Object;@7d44674f,
[Ljava.lang.Object;@1933e78c, [Ljava.lang.Object;@59ea34d0,
[Ljava.lang.Object;@392f7c58, [Ljava.lang.Object;@678f1a2d,
[Ljava.lang.Object;@61868ed7, [Ljava.lang.Object;@69426a83,
[Ljava.lang.Object;@2bcd164f, [Ljava.lang.Object;@340c3f69,
[Ljava.lang.Object;@6129ef09, [Ljava.lang.Object;@1b4587dd,
[Ljava.lang.Object;@58799594, [Ljava.lang.Object;@d5b1e85,
[Ljava.lang.Object;@2324f980, [Ljava.lang.Object;@1468f956,
[Ljava.lang.Object;@290b7a]
Regards
Mark Sack
--
View this message in context: http://xwiki.475771.n2.nabble.com/REST-query-to-fetch-filtered-list-of-user…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I'm using the REST API to get the wiki users as per the example in
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI
i.e.
http://<server>/xwiki/rest/wikis/query?q=object:XWiki.XWikiUsers
This only returns 10 of the users in the wiki database. If I make the call
using curl, it returns 10 non-hidden users. If I make the call from a
browser, it returns almost the same set of 10 users except that 2 of them
are replaced with hidden users.
I can get around this by adding the start and number parameters to the query
and then repeating the call incrementing the start parameter until nothing
is returned.
This leads to a number of questions.
1. Is there a way to adjust the default limit of 10 results other than using
the number parameter?
2. Is there a way to get the count of the total number of users using the
REST API?
3. Is there an explanation for the different behaviour between curl and the
browser? Which behaviour should I expect if making the call from another
application (eg. Rails)?
4. Is there a more elegant way to get all of the users through the API?
5. Is this documented somewhere that I've missed or would it be useful to
add a comment to the RESTful API page?
6. Niggly point regarding the REST API page. In some places, the start
parameter is labeled as 'n' and in others as 'offset'. I assume this is
perhaps an artefact of updates by different authors. Should it really be
'offset' everywhere or is the distinction intentional?
Regards
Mark
--
View this message in context: http://xwiki.475771.n2.nabble.com/REST-query-returns-subset-of-results-tp75…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I have been looking everywhere for an article or an addon for this function. Has anyone managed to find a way to add a simple button or menu options to email the page via Outlook? My users really want to have the articles they are sending out in their own mailboxes as a sent item.
Please remove me from your email list. I have tried to do this through the unsubscribe link and it's been unsuccessful. Thank you for your help. Dld07sierra(a)gmail.com
Sent from my T-Mobile 4G LTE Device
1. The "tags" feature display a lot of jumbled text.
For example:
"运营" displays as "è¿è¥", if I click "è¿è¥", it becomes "è¿ÂèÂÂ¥", much worse.
2. The "Solr Search" feature display a log of jumbled text.
For example:
"表格" displays as "表格" in the search result page.
And of couse, it returns no hitted page, but it is actually appeared in the default "Sandbox" chinese page.
For example:
3. The Chinese Sandbox, incorrectly use ">" instead of ">" in wiki source text.
For example:
[[沙箱测试页面1>>Sandbox.TestPage1]]
Should be:
[[沙箱测试页面1>>Sandbox.TestPage1]]
For example, I have a page called “基础品质及小垂直团队”
The URL is ‘http://mysite/xwiki/bin/view/web_product/基础品质及小垂直团队/’
In the “Rename” Action, I can see both “Title” and “Page Name” is “基础品质及小垂直团队”
But, In the “Administrator Page”, its location shows: “EVA小组(评估、分析、垂直等)/ Preferences”,
and title is “Administration: web_product.基础品质及小垂直团队”
and URL is “…/xwiki/bin/admin/web_product/基础品质及小垂直团队/WebPreferences”
“EVA小组(评估、分析、垂直等)” is the old name of this page, I donot know why it is still here.
Version: XWiki-7.4.3, Mac Safari 9.1.1, Firefox 38.7.1esr
A encoding bug of page administration page.
When I do administrator a Chinese title page, click any label twice, the page would jump to a invalid page.
For example:
At beginning:
You can see: there is no left panel.
First Click at “Rights: Page”
It seems OK, and left panel appears:
Second Click at “Rights: Page”
It jumps to a invalid page with invalid title.
Per the Query Module documentation:
List of child spaces: select space.name from XWikiSpace as space where space.parent = 'Parent Space’
List of all nested documents in a space: where doc.space like 'Space' or doc.space like 'Space.%’
The first gives me the correct spaces but I want the documents (WebHome) and the second gives me every single document in every space below ‘Space’. How do you query for just the documents in the immediate child spaces? Anything I do to narrow the results seems to give me no results and no error. Thanks for any help.
Regards,
Jesse