Load TOC levels
Loads the XML representation of the TOC. Because TOC files can be very large, this API call is designed to be able to grab specific sections of the TOC on demand, while not loading other sections. The eid parameter allows the API call to grab a specific section of the TOC, while the levels parameter allows the depth of the returned XML to be shortened for performance. The shorter the depth of the returned XML, the more frequently the client will need to return to the server for more TOC XML. Therefore, a balance between size of XML fragments and frequency of requests needs to be struck, based upon the structure, size, and content of the TOC.
Example API call
/servlets3/wietmsd?id=1460038885460&book=s1000d_bike_41&collection=default&target=toc&action=tree&eid=root&levels=1
Parameters
| Parameter | Description |
|---|---|
target | toc |
action | tree |
levels | The level of depth to load from the point of the targeted TOC element, identified by the eid parameter. If levels is set to 2, then two levels of children elements below the targeted element will be loaded and returned. If levels is not set, the API call will load the maximum possible depth. |
eid | root |
id | A session ID that is valid for this collection and publication combination. |
collection | The name of the collection that the publication is registered in, such as default. |
book | The name of the publication, such as s1000d_bike_41. |
Returns
- On success
-
<script xmlns:xlink="http://www.w3.org/1999/xlink" type="text/javascript"> reSetDisplay(); </script> <div xmlns:xlink="http://www.w3.org/1999/xlink" id="TOC_MAIN_TREE"> <div class="tocItem" type="SYSTEM" ID="2" EID="2" TOP="1" STYLE="margin-left:0px;" ROOT="yes"> <span class="normal" onclick="CVPortal.components['cvTOC'].toggleExpand(event)"> <img class="link" ID="I_2" SRC="/servlets3/wietmsd?target=resource&action=image&file_name=plus.png"> <span class="counter" style="display:none" ID="CNTR_2">0</span> <span class="normal" cvTocTitle="1" ID="S_2"> Bike 4.1</span> </span> <div class="container" style="display:none" ID="D_2"> </div> </div> <div class="tocItem" type="SYSTEM" ID="742" EID="742" TOP="1" STYLE="margin-left:0px;" ROOT="yes"> <span class="normal" onclick="CVPortal.components['cvTOC'].toggleExpand(event)"> <img class="link" ID="I_742" SRC="/servlets3/wietmsd?target=resource&action=image&file_name=plus.png"> <span class="counter" style="display:none" ID="CNTR_742">0</span> <span class="normal" cvTocTitle="1" ID="S_742"> Lighting</span> </span> <div class="container" style="display:none" ID="D_742"> </div> </div> </div> - On failure
-
Appropriate error message.
<ERROR> <MESSAGE>Failed to find TOC node.</MESSAGE> </ERROR>