On Fri, May 11, 2012 at 10:54 AM, Jean-Vincent Drean <jv(a)xwiki.com> wrote:
On Fri, May 11, 2012 at 10:25 AM, Marius Dumitru
Florea
<mariusdumitru.florea(a)xwiki.com> wrote:
Hi devs,
While debugging the failing REST integration tests I discovered an
inconsistency in the page REST resource. Take for instance the
response returned for this URL:
/xwiki/rest/wikis/xwiki/spaces/Blog/pages/BlogIntroduction
* The returned content is the raw (not rendered) content. In this
particular case, since the blog post content is saved in the blog post
object, and also because the blog uses the new sheet system, the raw
content of Blog.BlogIntroduction page is empty
* The returned title is the display title (i.e. the rendered title).
In this particular case, since the raw title is empty, but the blog
post sheet, which controls how the title is displayed, renders the
'title' property of the blog post.
The inconsistency is that the content is raw while the title is
rendered. I think the page REST resource should provide data in the
first place, so raw title. It could provide the rendered title or
content additionally, but that is secondary IMO.
WDYT?
I think it should provide both the raw and rendered title. I also
think we should provide both raw and rendered content, being able to
get the raw content is nice when you want to write an editor but I
think there are a lot of use cases where you'd like to be able to get
the rendered html.
Sure we want to be able to get renderer result in REST but we are
talking about default behavior here only. You might get the
rendered/content using URL parameters.
Note: the rendered title is used for example in the AllDocs tree.
I'll fix the REST integration tests by using
a page that doesn't have a sheet.
Thanks,
Marius
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Jean-Vincent Drean,
XWiki.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs