Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

DocGenerator API: opaque articles



Opaque articles are articles which can be used in references, but for which no file will be generated in the wiki.

Use case

Opaque articles are useful if you are producing one wiki through several APIs.

This allows to generate a wiki through several applications, and merge their content (providing the wiki content is not cleaned in the generators).

Creating an opaque article

Several methods allow to create an opaque article, which is an article which can be used in references, but for which no file will be generated in the wiki: For example:
   DocGeneratorAPI api = new DocGeneratorAPI();
   api.createModel();
   api.setOutputDirectory(<the wiki directory>);

   // create an article which will be usable as a reference but will not be written
   OpaqueArticle opaqueArticle = api.createOpaqueArticle("the opaque article");
      
   // create a second article and adds a paragraph
   XMLArticle article2 = api.createArticle("the second article");
      
   // add a reference to the opaque article
   api.addReference(article2, "the opaque article", "the opaque reference");      
   // could also be done with:
   api.addReference(article2, opaqueArticle, "the reference");            

Setting a default content

It is possible to create an output file and set a default content for the opaque article if the article is not already existing. This avoids to make a reference to a non existing file if the other application did not create the article (yet). For example:
  DocGeneratorAPI api = new DocGeneratorAPI();
  api.createModel();
  api.setOutputDirectory(<the wiki directory>);

  // create an opaque article
  OpaqueArticle opaqueArticle = api.createOpaqueArticle("the opaque article");
  opaqueArticle.setDefaultContent("Default content for the opaque article");                

See also


Categories: api

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.