Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

DocAPI.v1.Content

This class, which supports DocAPI.v1.REST, provides an API to retrieve content from the DocBook database. Depending on the element accessed, it returns either a table of contents or the full content (every last character). The methods in this class can return either an instance of %Library.DynamicObject or a JSON string. The returned object has the following properties:

These methods have the following arguments:

Method Inventory

Methods

classmethod GetContent(DocBookId As %String = "", getDescriptions As %Boolean = 0) as %Library.DynamicAbstractObject
This method is the primary way to retrieve content.

There are some special values of DocBookId:

  • GSTD_SYNTAX is hardcoded to get content for ROBJ_classdef, for reasons of history.
  • GSTU_INSTDIST_INSTALLER is hardcoded to get content for GCI_manifest, for reasons of history.
  • GettingStarted is hardcoded to get the home page.
  • ALL is hardcoded to get "all content" -- a generated structure
  • NOHELPFOUND gets the "no help found object". For this, if GSA is loaded in the database, the content object displays the table of contents for that book. If GSA is not loaded, the content object says to see the System Administration Guide, but there is no link.

Given a DocBookId, GetContent() returns an instance of %Library.DynamicAbstractObject that contains the content of that DocBookId, according to these rules.

  • If DocBookId corresponds to a <set>, a <book>, or a <reference>, the "content" is just the table of contents for that element.
  • If the DocBookId is any of the special hardcoded items, the "content" is a table of contents.
  • In all other cases, the object contains the full content of the given DocBookId.
In other words, apart from the ability to control the TOC depth, what you get back is the same content we currently display in the application given any of those DocBookIds.
classmethod GetContentFromOBJ(object As %DynamicObject) as %String
classmethod GetExternalDoc() as %DynamicObject
classmethod GetFlattenedContent(key As %String) as %String
classmethod GetHomePageArray() as %Library.DynamicArray
classmethod GetIndexTokens(DocBookId As %String = "") as %DynamicArray
classmethod GetLoadType(docbookid As %String, ByRef topLevel As %Boolean) as %String
Given a DocBookId, return the loadtype of item so that we know how to load it. The types are "article", "component" (a file within a book), "book", "set", and "navpage"
classmethod GetLoadTypeFromFilename(filename As %String) as %String
Given a complete path and filename, return the type of the file. See GetLoadType() for types.
classmethod GetNavParents(DocBookId As %String = "") as %String
Returns an $LB list of "parents" (all at the same level). This is the KEY of the container of the item.
classmethod GetNavParentsArray(DocBookId As %String = "") as %DynamicArray
Returns a dynamic array of "parents" according to the hierarchy determined by following links from the home page. Each object in the array has the properties title and url.
classmethod GetPageCount(DocBookId As %String = "") as %Integer
classmethod GetShowPageTOC(docbookid As %String = "") as %Boolean
Given a DocBookId, returns 1 or 0 depending on whether it is suitable show a page TOC in addition to the normal content returned by GetContent
classmethod GetTOC(DocBookId As %String = "", lowestSectLevel As %Integer = 2, includeDescriptions As %Boolean = 0, forRightTOC As %Boolean = 0) as %Library.DynamicAbstractObject
This method is provided to help with diagnosis.

Given a DocBookId (e.g., the value you provide via the KEY parameter in a request to the DocBook app.), this method returns an instance of %Library.DynamicAbstractObject that contains the TOC for that DocBookId. See comments for GetContent(). GetTOC() returns an empty object if the DocBookId does not directly contain headings.

classmethod GetTopIdFromKey(DocBookId As %String = "") as %String
Given a DocBook ID, return the Topid to which that item belongs
classmethod GetTypeFromKey(DocBookId As %String = "") as %String
Given a DocBook ID, return the name of the DocBook element it represents.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab