Node Director
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
sfi.director.application.autodoc.DocBuilder Class Reference

Builds documentation from the information in the configuration repository. More...

Public Member Functions

 DocBuilder () throws DirectorException
 DocBuilder (String audience) throws DirectorException
void generate (String filename, String format) throws DirectorException
 output the documentation formerly built by build()
void build () throws DirectorException
 build the entire documentation.
void genRawDoc ()
 Makes raw xhtml from the current chapters.
void slurpExternalDocs () throws DirectorException
void sortChapters ()
 Sort chapters so that they appear in the chapters Vector in the same order they will appear in the final document.
String rawText ()
void makeStructure ()
 Add missing chapters / levels.
void genericDocu (String directoryName, String chapterTitle, String chapterSubtitle, String intro) throws DirectorException
void genericDocu (String directoryName, String chapterTitle, String chapterSubtitle, String intro, boolean includeInServiceTree) throws DirectorException
 build the documentation for generic documentation elements.
void genericObjDoc (DBObject obj, String directoryName, DocChapter masterChapter, boolean includeInServiceTree) throws DirectorException
 build the documentation for a single generic object
void users () throws DirectorException
 build the documentation for users
void concepts () throws DirectorException
 build the documentation for Concepts
void tools () throws DirectorException
 build the documentation for Tools
void components () throws DirectorException
 build the documentation for Components
void suppliers () throws DirectorException
 build the documentation for Suppliers
void contracts () throws DirectorException
 build the documentation for Contracts
void services () throws DirectorException
 build the documentation for Services
void software () throws DirectorException
 build the documentation for Software
void locations () throws DirectorException
 build the documentation for Locations
void locationdoc (DBObject location) throws DirectorException
 build the documentation for a single domain
void domaindoc () throws DirectorException
 build the documentation for DSDomains
void domaindoc (DBObject domain) throws DirectorException
 build the documentation for a single domain
void hostdoc () throws DirectorException
 build the documentation for all hosts.
void hostdoc (String name) throws DirectorException
 build the documentation for one single, named host.
void hostdoc (DBObject host) throws DirectorException
 build the documentation for one single host, given its host DBObject.
void configfilesdoc ()
void configfilesdoc (Vector cfgCollection)
void insertDependencyGraphs () throws DirectorException
void insertDependencyGraph (DocInfo info, DBObject graphdef, DocChapter parentChapter, DocCategory category) throws DirectorException
boolean haveChapterFor (DocInfo what)
 Test if a chapter for the DocInfo object already exists.
Hashtable chapterIndex ()
 Accessor for attribute chapterIndex.
Hashtable chapterIndex (Hashtable chapterIndex)
 Mutator for attribute chapterIndex.
Vector chapters ()
 Accessor for attribute chapters.
Vector chapters (Vector chapters)
 Mutator for attribute chapters.
void addChapter (DocChapter chapter)
 Add a chapter.
DocChapter addMasterChapter (String heading, String subheading, String filename) throws DirectorException
 Create and add a chapter with heading and subheading, read contents from a file.
DocChapter getChapter (DocChapter like)
 Search for an existing chapter by a DocChapter with the same title.
DocChapter getChapterById (String id)
 Search for an existing chapter by a DocChapter ID.
DocChapter getChapter (String label)
 Search for an existing chapter by its label.
boolean isReferred (String ref)
 check if a reference is referred to in one of the existing chapters.
String audience ()
 Accessor for attribute audience.
String audience (String audience)
 Mutator for attribute audience.
boolean testMode ()
 Accessor for attribute testMode.
boolean testMode (boolean testMode)
 Mutator for attribute testMode.
Vector dependencyGraphs ()
 Accessor for attribute dependencyGraphs.
void addDependencyGraph (DocInfo info, DocChapter parent, DocCategory category)
 Add dependencyGraphs.
Vector configfiles ()
 Accessor for attribute configfiles.
void addConfigFile (ConfigFile configfile)
 Mutator for attribute configfiles.
String addMediaFile (String fname)
void copyMedia (File target) throws DirectorException, IOException
void mkMediaFrom (String text, File mediaFile) throws DirectorException
void cleanDocMedia () throws DirectorException

Static Public Member Functions

static String readableTime (long time)
static String readableTime (Date time)
static File mediafile (String filename)
 Helper function - return a file within the docmedia dir.
static String humanReadableSize (long bytes)

Public Attributes

ServiceDepContainer serviceTree = new ServiceDepContainer()

Protected Member Functions

String _shortMediaName (int i, String filename)
int nextId ()
 returns a unique identifier.
File nextPath ()
 returns a unique file.

Protected Attributes

TempFile tmpdir = TempFile.create( "docbuild" )
StringBuffer rawText = new StringBuffer()
Hashtable chapterIndex = new Hashtable()
 index chapter title => chapter
Hashtable chapterIndexByLabel = new Hashtable()
 index chapter label => chapter
Vector chapters = new Vector()
 set of chapters
String audience = "public"
 The target audience we build the documentation for.
boolean testMode = false
 If set, only partial doc is built.
Vector dependencyGraphs = new Vector()
 List of dependency graphs.
Vector configfiles = new Vector()
 List of ConfigFiles.
Vector media = new Vector()

Detailed Description

Builds documentation from the information in the configuration repository.

Constructor & Destructor Documentation

sfi.director.application.autodoc.DocBuilder.DocBuilder ( ) throws DirectorException
sfi.director.application.autodoc.DocBuilder.DocBuilder ( String  audience) throws DirectorException

Member Function Documentation

String sfi.director.application.autodoc.DocBuilder._shortMediaName ( int  i,
String  filename 
)
protected
void sfi.director.application.autodoc.DocBuilder.addChapter ( DocChapter  chapter)
void sfi.director.application.autodoc.DocBuilder.addConfigFile ( ConfigFile  configfile)

Mutator for attribute configfiles.

List of ConfigFiles. During the docu generation ConfigFile objects are piled up in this Vector by the various steps. At the end of the process they are flushed and inserted into the docu by configfiles() *

References sfi.director.application.autodoc.DocBuilder.configfiles().

Referenced by sfi.director.application.autodoc.DocBuilder.domaindoc(), and sfi.director.application.autodoc.DocBuilder.hostdoc().

void sfi.director.application.autodoc.DocBuilder.addDependencyGraph ( DocInfo  info,
DocChapter  parent,
DocCategory  category 
)

Add dependencyGraphs.

List of dependency graphs. During docu creation, graphs pending rendering are piled up in this Vector. At the end of the process they are flushed and inserted into the docu by insertDepGraphs(). That's because dependencies are collected during documentation processing and thus, dependency information is only complete at the end of processing.

References sfi.director.application.autodoc.DocBuilder.dependencyGraphs(), and sfi.director.application.autodoc.DocInfo.searchAndRevise().

Referenced by sfi.director.application.autodoc.DocBuilder.genericObjDoc(), and sfi.director.application.autodoc.DocBuilder.hostdoc().

DocChapter sfi.director.application.autodoc.DocBuilder.addMasterChapter ( String  heading,
String  subheading,
String  filename 
) throws DirectorException
String sfi.director.application.autodoc.DocBuilder.addMediaFile ( String  fname)
String sfi.director.application.autodoc.DocBuilder.audience ( )

Accessor for attribute audience.

The target audience we build the documentation for. This has influence on the detail level and is usually also used for preventing internal information to be revealed to the public.

Referenced by sfi.director.application.autodoc.DocBuilder.audience(), sfi.director.application.autodoc.DocBuilder.domaindoc(), sfi.director.application.autodoc.DocBuilder.genericObjDoc(), sfi.director.application.autodoc.DocBuilder.hostdoc(), sfi.director.application.autodoc.DocBuilder.locationdoc(), and sfi.director.application.autodoc.DocBuilder.slurpExternalDocs().

String sfi.director.application.autodoc.DocBuilder.audience ( String  audience)

Mutator for attribute audience.

The target audience we build the documentation for. This has influence on the detail level and is usually also used for preventing internal information to be revealed to the public.

References sfi.director.application.autodoc.DocBuilder.audience().

void sfi.director.application.autodoc.DocBuilder.build ( ) throws DirectorException
Hashtable sfi.director.application.autodoc.DocBuilder.chapterIndex ( )
Hashtable sfi.director.application.autodoc.DocBuilder.chapterIndex ( Hashtable  chapterIndex)

Mutator for attribute chapterIndex.

index chapter title => chapter

References sfi.director.application.autodoc.DocBuilder.chapterIndex().

Vector sfi.director.application.autodoc.DocBuilder.chapters ( )
Vector sfi.director.application.autodoc.DocBuilder.chapters ( Vector  chapters)

Mutator for attribute chapters.

set of chapters

References sfi.director.application.autodoc.DocBuilder.chapters().

void sfi.director.application.autodoc.DocBuilder.cleanDocMedia ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.components ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.concepts ( ) throws DirectorException
Vector sfi.director.application.autodoc.DocBuilder.configfiles ( )

Accessor for attribute configfiles.

List of ConfigFiles. During the docu generation ConfigFile objects are piled up in this Vector by the various steps. At the end of the process they are flushed and inserted into the docu by configfiles() *

Referenced by sfi.director.application.autodoc.DocBuilder.addConfigFile(), and sfi.director.application.autodoc.DocBuilder.configfilesdoc().

void sfi.director.application.autodoc.DocBuilder.configfilesdoc ( )
void sfi.director.application.autodoc.DocBuilder.configfilesdoc ( Vector  cfgCollection)
void sfi.director.application.autodoc.DocBuilder.contracts ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.copyMedia ( File  target) throws DirectorException, IOException
Vector sfi.director.application.autodoc.DocBuilder.dependencyGraphs ( )

Accessor for attribute dependencyGraphs.

List of dependency graphs. During docu creation, graphs pending rendering are piled up in this Vector. At the end of the process they are flushed and inserted into the docu by insertDepGraphs(). That's because dependencies are collected during documentation processing and thus, dependency information is only complete at the end of processing.

Referenced by sfi.director.application.autodoc.DocBuilder.addDependencyGraph(), and sfi.director.application.autodoc.DocBuilder.insertDependencyGraphs().

void sfi.director.application.autodoc.DocBuilder.domaindoc ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.domaindoc ( DBObject  domain) throws DirectorException

build the documentation for a single domain

References sfi.director.application.autodoc.DocBuilder.addChapter(), sfi.director.application.autodoc.DocChapter.addChapterRef(), sfi.director.application.autodoc.DocBuilder.addConfigFile(), sfi.director.application.autodoc.DocChapter.addImage(), sfi.director.application.autodoc.DocInfo.addIntroChapter(), sfi.director.application.autodoc.DocChapter.addText(), sfi.director.application.autodoc.DocChapter.addToRefChapter(), sfi.director.application.autodoc.DocBuilder.audience(), sfi.director.util.Tools.debug(), sfi.director.application.autodoc.DocCategory.detaillevel, sfi.director.application.autodoc.DocDSDomain.dotGraph, sfi.director.util.Logger.ERR, sfi.director.application.autodoc.GraphvizGraph.genPNG(), sfi.director.application.autodoc.GraphvizGraph.genPS(), sfi.director.repository.config.DirectoryAccess.getAssignedMembers(), sfi.director.application.autodoc.DocCategory.getCategoryFor(), sfi.director.application.autodoc.DocBuilder.getChapter(), sfi.director.repository.config.Directory.getDirectory(), sfi.director.application.autodoc.ConfigFile.getFiles(), sfi.director.application.autodoc.GraphvizGraph.graphdef, sfi.director.application.autodoc.DocBuilder.haveChapterFor(), sfi.director.util.Setup.hostsdir, sfi.director.util.Tools.log(), sfi.director.application.autodoc.DocBuilder.mkMediaFrom(), sfi.director.application.autodoc.DocInfo.name, sfi.director.application.autodoc.DocBuilder.nextPath(), sfi.director.application.autodoc.ConfigFile.owner, sfi.director.application.autodoc.DocDSDomain.targetsOnMaster, sfi.director.application.autodoc.DocDSDomain.targetsOnTarget, and sfi.director.application.autodoc.DocInfo.title.

void sfi.director.application.autodoc.DocBuilder.generate ( String  filename,
String  format 
) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.genericDocu ( String  directoryName,
String  chapterTitle,
String  chapterSubtitle,
String  intro 
) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.genericDocu ( String  directoryName,
String  chapterTitle,
String  chapterSubtitle,
String  intro,
boolean  includeInServiceTree 
) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.genericObjDoc ( DBObject  obj,
String  directoryName,
DocChapter  masterChapter,
boolean  includeInServiceTree 
) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.genRawDoc ( )

Makes raw xhtml from the current chapters.

The result of this is is not a nicely formatted HTML document.

Note
as a side effect this method does re-sort the chapter() Vector so that it contains the chapters in the same order they appear in the document.

References sfi.director.application.autodoc.DocBuilder.rawText().

Referenced by sfi.director.application.autodoc.DocBuilder.generate().

DocChapter sfi.director.application.autodoc.DocBuilder.getChapter ( DocChapter  like)
DocChapter sfi.director.application.autodoc.DocBuilder.getChapter ( String  label)

Search for an existing chapter by its label.

References sfi.director.application.autodoc.DocBuilder.chapterIndexByLabel.

DocChapter sfi.director.application.autodoc.DocBuilder.getChapterById ( String  id)

Search for an existing chapter by a DocChapter ID.

References sfi.director.application.autodoc.DocBuilder.chapterIndex().

boolean sfi.director.application.autodoc.DocBuilder.haveChapterFor ( DocInfo  what)
void sfi.director.application.autodoc.DocBuilder.hostdoc ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.hostdoc ( String  name) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.hostdoc ( DBObject  host) throws DirectorException

build the documentation for one single host, given its host DBObject.

References sfi.director.application.autodoc.DocBuilder.addChapter(), sfi.director.application.autodoc.DocChapter.addChapterRef(), sfi.director.application.autodoc.DocChapter.addChapterRefWithTemplate(), sfi.director.application.autodoc.DocBuilder.addConfigFile(), sfi.director.application.autodoc.ServiceDepContainer.addDependencies(), sfi.director.application.autodoc.DocBuilder.addDependencyGraph(), sfi.director.application.autodoc.DocInfo.addIntroChapter(), sfi.director.application.PackageList.addQualifiedPackages(), sfi.director.repository.DBObject.addSetting(), sfi.director.application.autodoc.DocChapter.addText(), sfi.director.application.autodoc.DocChapter.addToRefChapter(), sfi.director.application.autodoc.DocBuilder.audience(), sfi.director.application.autodoc.DocChapter.childTitle(), sfi.director.util.Tools.debug(), sfi.director.application.autodoc.DocCategory.detaillevel, sfi.director.application.PackageList.elements(), sfi.director.repository.config.DirectoryAccess.get(), sfi.director.repository.DBObject.getAttribute(), sfi.director.application.autodoc.DocCategory.getCategoryFor(), sfi.director.application.autodoc.DocBuilder.getChapter(), sfi.director.repository.config.Directory.getDirectory(), sfi.director.repository.DBObject.getEValue(), sfi.director.application.autodoc.ConfigFile.getFiles(), sfi.director.repository.DBObject.getValue(), sfi.director.application.autodoc.DocBuilder.haveChapterFor(), sfi.director.util.Setup.hostsdir, sfi.director.application.autodoc.DocBuilder.humanReadableSize(), sfi.director.application.autodoc.DocInfo.label, sfi.director.application.autodoc.DocInfo.locationDocu(), sfi.director.application.autodoc.DocInfo.name, sfi.director.application.autodoc.ConfigFile.owner, sfi.director.application.autodoc.ConfigFile.revisedAlternatives, sfi.director.application.autodoc.DocInfo.searchAndRevise(), sfi.director.application.autodoc.DocBuilder.services(), sfi.director.application.autodoc.DocBuilder.serviceTree, sfi.director.application.autodoc.DocBuilder.software(), sfi.director.util.Tools.split(), sfi.director.application.autodoc.DocCategory.subtitle, sfi.director.application.autodoc.DocInfo.templateParams, sfi.director.application.autodoc.DocInfo.title, and sfi.director.application.autodoc.DocChapter.verbatim().

static String sfi.director.application.autodoc.DocBuilder.humanReadableSize ( long  bytes)
static
void sfi.director.application.autodoc.DocBuilder.insertDependencyGraph ( DocInfo  info,
DBObject  graphdef,
DocChapter  parentChapter,
DocCategory  category 
) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.insertDependencyGraphs ( ) throws DirectorException
boolean sfi.director.application.autodoc.DocBuilder.isReferred ( String  ref)

check if a reference is referred to in one of the existing chapters.

References sfi.director.application.autodoc.DocBuilder.chapters().

void sfi.director.application.autodoc.DocBuilder.locationdoc ( DBObject  location) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.locations ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.makeStructure ( )

Add missing chapters / levels.

The diverse content generating procedures are allowed to add chapters at the level they wish without caring for the parent chapters to exist. This procedure adds missing parents.

References sfi.director.application.autodoc.DocBuilder.addChapter(), sfi.director.application.autodoc.DocBuilder.chapterIndex(), sfi.director.application.autodoc.DocBuilder.chapters(), sfi.director.application.autodoc.DocChapter.parentToString(), and sfi.director.application.autodoc.DocChapter.title.

Referenced by sfi.director.application.autodoc.DocBuilder.generate().

static File sfi.director.application.autodoc.DocBuilder.mediafile ( String  filename)
static
void sfi.director.application.autodoc.DocBuilder.mkMediaFrom ( String  text,
File  mediaFile 
) throws DirectorException
int sfi.director.application.autodoc.DocBuilder.nextId ( )
protected

returns a unique identifier.

Use this e.g. in order to name generated media files.

Referenced by sfi.director.application.autodoc.DocBuilder.nextPath().

File sfi.director.application.autodoc.DocBuilder.nextPath ( )
protected
String sfi.director.application.autodoc.DocBuilder.rawText ( )
static String sfi.director.application.autodoc.DocBuilder.readableTime ( long  time)
static
static String sfi.director.application.autodoc.DocBuilder.readableTime ( Date  time)
static
void sfi.director.application.autodoc.DocBuilder.services ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.slurpExternalDocs ( ) throws DirectorException

References sfi.director.application.autodoc.DocChapter.addFile(), sfi.director.application.autodoc.DocInfo.addIntroChapter(), sfi.director.application.autodoc.DocBuilder.addMediaFile(), sfi.director.application.autodoc.DocPHTML.anchorPrefix, sfi.director.application.autodoc.DocBuilder.audience(), sfi.director.application.autodoc.DocBuilder.chapters(), sfi.director.util.Tools.debug(), sfi.director.application.autodoc.DocCategory.detaillevel, sfi.director.application.autodoc.DocExtDocu.file, sfi.director.application.autodoc.DocChapter.findReferences(), sfi.director.application.autodoc.DocCategory.getCategoryFor(), sfi.director.application.autodoc.DocBuilder.haveChapterFor(), sfi.director.application.autodoc.DocPHTML.headingLevel, sfi.director.application.autodoc.DocPHTML.injectInline(), sfi.director.application.autodoc.DocExtDocu.isInclude(), sfi.director.application.autodoc.DocExtDocu.isInline(), sfi.director.application.autodoc.DocChapter.label, sfi.director.application.autodoc.DocInfo.name, sfi.director.application.autodoc.DocPHTML.parse(), sfi.director.application.autodoc.DocPHTML.refReplace, sfi.director.application.autodoc.DocChapter.resetText(), sfi.director.application.autodoc.DocExtDocu.retrieve(), sfi.director.application.autodoc.DocCategory.subtitle, sfi.director.application.autodoc.DocPHTML.text, sfi.director.application.autodoc.DocChapter.text, sfi.director.application.autodoc.DocInfo.title, sfi.director.application.autodoc.DocChapter.title, and sfi.director.application.autodoc.DocExtDocu.toDBObject().

Referenced by sfi.director.application.autodoc.DocBuilder.build().

void sfi.director.application.autodoc.DocBuilder.software ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.sortChapters ( )

Sort chapters so that they appear in the chapters Vector in the same order they will appear in the final document.

References sfi.director.application.autodoc.DocBuilder.chapters().

Referenced by sfi.director.application.autodoc.DocBuilder.generate().

void sfi.director.application.autodoc.DocBuilder.suppliers ( ) throws DirectorException
boolean sfi.director.application.autodoc.DocBuilder.testMode ( )
boolean sfi.director.application.autodoc.DocBuilder.testMode ( boolean  testMode)

Mutator for attribute testMode.

If set, only partial doc is built.

References sfi.director.application.autodoc.DocBuilder.testMode().

void sfi.director.application.autodoc.DocBuilder.tools ( ) throws DirectorException
void sfi.director.application.autodoc.DocBuilder.users ( ) throws DirectorException

Member Data Documentation

String sfi.director.application.autodoc.DocBuilder.audience = "public"
protected

The target audience we build the documentation for.

This has influence on the detail level and is usually also used for preventing internal information to be revealed to the public.

Referenced by sfi.director.cli.docu.run().

Hashtable sfi.director.application.autodoc.DocBuilder.chapterIndex = new Hashtable()
protected

index chapter title => chapter

Hashtable sfi.director.application.autodoc.DocBuilder.chapterIndexByLabel = new Hashtable()
protected
Vector sfi.director.application.autodoc.DocBuilder.chapters = new Vector()
protected
Vector sfi.director.application.autodoc.DocBuilder.configfiles = new Vector()
protected

List of ConfigFiles.

During the docu generation ConfigFile objects are piled up in this Vector by the various steps. At the end of the process they are flushed and inserted into the docu by configfiles() *

Vector sfi.director.application.autodoc.DocBuilder.dependencyGraphs = new Vector()
protected

List of dependency graphs.

During docu creation, graphs pending rendering are piled up in this Vector. At the end of the process they are flushed and inserted into the docu by insertDepGraphs(). That's because dependencies are collected during documentation processing and thus, dependency information is only complete at the end of processing.

Vector sfi.director.application.autodoc.DocBuilder.media = new Vector()
protected
StringBuffer sfi.director.application.autodoc.DocBuilder.rawText = new StringBuffer()
protected
ServiceDepContainer sfi.director.application.autodoc.DocBuilder.serviceTree = new ServiceDepContainer()
boolean sfi.director.application.autodoc.DocBuilder.testMode = false
protected

If set, only partial doc is built.

Referenced by sfi.director.cli.docu.run().

TempFile sfi.director.application.autodoc.DocBuilder.tmpdir = TempFile.create( "docbuild" )
protected

The documentation for this class was generated from the following file: