I'm SO close with Services (REST), just need the final pieces

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
spoco2's picture

So, I have finally (After much mucking about) got myself a drupal REST service running using 2-Legged OAuth for authentication. This is working, in that I can request http://drupalsite/myEndPoint/node to get a list of nodes, and http://drupalsite/myEndPoint/node/1 to get a particular node in XML or JSON format... and that's SO CLOSE to all I want.

Except...

We're using Drupal to host and serve help documents for our Flash applications (built in Flex). I can have my flash app popup a webpage (my java servlet) that does all the talking to Drupal using OAuth, and it can return content back to the popup. But I have a couple of issues:

  • I've decided that having our help content in Drupal 'Books' would be awesome, as the way they display and create their own menus on the fly is fantastic, and naturally format themselves like a nice help document. Problem is when I call for any of the pages of the book (node/1, node/3, whatever) all I get is the core HTML of the page, the content as entered into the editor. I don't get all the other great formatting that goes around it when it's displayed from within Drupal itself (the Prev, Up, Next links at the bottom, and the book menu on the left). Even if I could just do a request for the book menu and get back all the links with their names and parents so I can lay them out myself in a hierarchy within the returned HTML. But I don't even know how to call for a menu, or the set of nodes defined by a book. Is there a path I can use to get a menu? /menu/menuid? Or is there a path I can call for a whole book with it's menu? /book/1 ?

  • Is there any way use the REST server to return the requested book page (node) as a html page as if you were just viewing it as a logged in user? Or can you always only get the basic node's content and never everything else that goes into a usual Drupal page?

Comments

Oh, and as a quick followup.

spoco2's picture

Oh, and as a quick followup. I almost seem to get what I want when I request a node that is a book page.

I get (in xml) a node called 'book' and that almost seems to have the table of contents, except it only lists the current page. This book page has three child pages under it, but you wouldn't know it.

<book>
<mlid>337</mlid>
<nid>1</nid>
<bid>1</bid>
<menu_name>book-toc-1</menu_name>
<plid>0</plid>
<link_path>node/1</link_path>
<router_path>node/%</router_path>
<link_title>My Help Book</link_title>
<options/>
<module>book</module>
<hidden>0</hidden>
<external>0</external>
<has_children>1</has_children>
<expanded>0</expanded>
<weight>0</weight>
<depth>1</depth>
<customized>0</customized>
<p1>337</p1>
<p2>0</p2>
<p3>0</p3>
<p4>0</p4>
<p5>0</p5>
<p6>0</p6>
<p7>0</p7>
<p8>0</p8>
<p9>0</p9>
<updated>0</updated>
<href>node/1</href>
<title>My Help Book</title>
</book>

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week