[xwiki-users] when creating a page via REST, it doesn't appear in children (via REST)
I have a Wiki called 'mywiki', and I've created some nested pages/spaces within the web interface. I use REST to walk the children tree recursively, and I see the following fullNames: mywiki.foo.WebHome mywiki.foo.bar.WebHome mywiki.foo.kitten.WebHome mywiki.dog.WebHome Now, I create a page via REST using this URL: http://myhost/xwiki/rest/wikis/xwiki/spaces/mywiki/spaces/foo/spaces/bar/spa... The page is successfully created and I see it on the web site. Under Navigation I see it in the tree: v mywiki v foo v bar • mynewpage I can go to the page http://myhost/xwiki/bin/view/mywiki/foo/bar/mynewpage, and the page text that I *PUT* there is there. If I go to http://myhost/xwiki/bin/view/mywiki/foo/bar/?viewer=children, mynewpage is listed there. However, if I go to http://myhost/xwiki/rest/wikis/mywiki/spaces/foo/spaces/bar/pages/WebHome/ch... .... mynewpage is NOT listed there. What am I doing wrong? Why does the web version of asking mynewpage for its children and the REST version of the same thing give me different results? -- View this message in context: http://xwiki.475771.n2.nabble.com/when-creating-a-page-via-REST-it-doesn-t-a... Sent from the XWiki- Users mailing list archive at Nabble.com.
A clue: Pages created via REST don't seem to get their parent set. The question then is - why does xwiki/bin/view/.....?viewer=children show pages that do not have that page set as parent? How can I either (a) set parent correctly, or (b) get the same view that the web version gets, but via REST? -- View this message in context: http://xwiki.475771.n2.nabble.com/when-creating-a-page-via-REST-it-doesn-t-a... Sent from the XWiki- Users mailing list archive at Nabble.com.
So, it looks like I need to *explicitly* set <parent>mywiki.foo.bar.WebHome</parent> <parentId>xwiki:mywiki.foo.bar.WebHome</parentId> in the XML I *PUT*. However, this appears to still be a bug or at least an inconsistency, because the web version of ?viewer=children shows the page even if this was not done, whereas REST's children method for the same page does NOT show it. -- View this message in context: http://xwiki.475771.n2.nabble.com/when-creating-a-page-via-REST-it-doesn-t-a... Sent from the XWiki- Users mailing list archive at Nabble.com.
On Mon, Oct 24, 2016 at 11:09 PM, dmd3eorg <[email protected]> wrote:
So, it looks like I need to *explicitly* set
<parent>mywiki.foo.bar.WebHome</parent> <parentId>xwiki:mywiki.foo.bar.WebHome</parentId>
in the XML I *PUT*.
However, this appears to still be a bug or at least an inconsistency, because the web version of ?viewer=children shows the page even if this was not done, whereas REST's children method for the same page does NOT show it.
The page "children" REST resource is probably using the parent-child hierarchy which was deprecated in favor of the nested-pages hierarchy starting with XWiki 8.2. See http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/Nested... . We need to fix this. Can you report an issue on http://jira.xwiki.org/browse/XWIKI/component/10821 ? Thanks, Marius
-- View this message in context: http://xwiki.475771.n2.nabble. com/when-creating-a-page-via-REST-it-doesn-t-appear-in-children-via-REST- tp7601706p7601708.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Yes it's a new inconsistency due to the fact that UI behavior changed regarding what parent/children means by default and REST should probably follow. Would be great if you could create an issue about that on http://jira.xwiki.org. On Mon, Oct 24, 2016 at 10:09 PM, dmd3eorg <[email protected]> wrote:
So, it looks like I need to *explicitly* set
<parent>mywiki.foo.bar.WebHome</parent> <parentId>xwiki:mywiki.foo.bar.WebHome</parentId>
in the XML I *PUT*.
However, this appears to still be a bug or at least an inconsistency, because the web version of ?viewer=children shows the page even if this was not done, whereas REST's children method for the same page does NOT show it.
-- View this message in context: http://xwiki.475771.n2.nabble.com/when-creating-a-page-via-REST-it-doesn-t-a... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Filed http://jira.xwiki.org/browse/XWIKI-13830 , thanks. -- View this message in context: http://xwiki.475771.n2.nabble.com/when-creating-a-page-via-REST-it-doesn-t-a... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
dmd3eorg -
Marius Dumitru Florea -
Thomas Mortagne