ibm-sbt

How to create the child page to parent page in wiki


I am posting a new query regarding wiki page creation programmatically using SBT.

I tried to create the wiki page under one parent page but did not find a link to map both parent and child. Every time I create the wiki page it gets created independently without community(non-community wiki page).

I working with a playground but it is throwing some exceptions.

Thanks in advance for your response.


Solution

  • There is no code specifically to set a child page. You'll have to extend the wiki service in the sbt to make it work for child pages.

    Per http://bastide.org/2014/05/06/creating-a-new-wiki-page-as-a-child/

    API Details URL: https://{hostname}:{port}/wikis/basic/api/wiki/{wiki-label}/feed Method: POST Content-Type: application/atom+xml

    You may have to add the X-Update-Nonce header.

    You have to update the XML with the parentUuid – eg bd586bb6-d9b2-4527-b9a0-0f9b0d3c1e3f

    When you complete the post, you’ll have a new page with a parent page.

    <entry xmlns="http://www.w3.org/2005/Atom">
    <category term="Test" label="Test"></category>
    <category term="page" label="page" scheme="tag:ibm.com,2006:td/type"></category>
    <parentUuid xmlns="urn:ibm.com/td">parentUuid</parentUuid>
    <title>Tes4</title>
    <summary></summary>
    <label xmlns="urn:ibm.com/td">Tes4</label>
    <content type="text/html"><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html [<!ENTITY amp "&#38;#38;"><!ENTITY lt "&#60;#60;"><!ENTITY gt "&#62;#62;"><!ENTITY nbsp "&#160;"><!ENTITY apos "&#39;"><!ENTITY quot "&#34;">]><div></div></content></entry>