|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.sandev.generator.GeneratorCommon
org.sandev.generator.ProjectIndexGenerator
public class ProjectIndexGenerator
Write out a navigable web of documentation through interlinked index
pages. The index pages have a navigable tree of the build, with
SAND_HOME as the root. The index.html file for a given project is
regenerated if any structs or nodes have been added or deleted, but
this generator does not track changes in documentation source. If
you delete the index.html file, it will be rebuilt.
Index page construction hooks:
docs/intro.html (if found) are placed
into the main display portion of the page.
docs directory are linked
into the navigation bar
loclink.html is used to create the local links for
any given project.
SAND_HOME/docs/globlink.html is used to create the
global links for all projects.
The index page automatically provides:
The structure and look of the index page may change between SAND
environments, which is why this is part of the platform code.
| Field Summary | |
|---|---|
protected org.sandev.sandbuild.SandProject[] |
elemprojects
An array of projects corresponding to the webelems elements. |
static java.lang.String |
FILE_GLOBLINK
The name of the one file stored in the top level docs directory which contains links useful for all defined projects. |
static java.lang.String |
FILE_LOCLINK
The name of the file which is defined in the local project's docs directory to hold useful links to other projects. |
static int |
MODE_CONDWRITE
|
static int |
MODE_DELETE
|
static int |
MODE_FORCEWRITE
|
protected java.lang.String |
sandhome
The directory specification for SAND_HOME. |
protected java.lang.String[] |
webelems
Holds all the navtree elements as a list of canonical paths. |
| Fields inherited from class org.sandev.generator.GeneratorCommon |
|---|
CONTEXT_CONFIGURATION, CONTEXT_CONTROL, CONTEXT_FRAMEWORK, CONTEXT_MESSAGING, CONTEXT_PERSISTENCE, CONTEXT_UI, DEFAULT_LINE_LENGTH, MESSAGE_INTERFACES |
| Constructor Summary | |
|---|---|
ProjectIndexGenerator()
|
|
| Method Summary | |
|---|---|
void |
cleanup(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.lang.String extra)
Clean up the index html files. |
protected int |
countSlashes(java.lang.String val)
Count the number of forward slashes in the given String. |
protected void |
dumpDeployTools(int elemindex,
java.io.PrintStream out)
If this is a deployment, dump links to the local deployment tools. |
protected void |
dumpDocwebSummary(int elemindex,
java.io.PrintStream out)
Dump out a summary of what project drove this build and what the overall structure is. |
protected void |
dumpIntroContents(int elemindex,
java.io.PrintStream out)
Retrieve the contents of the intro html file to display as the contents here. |
protected void |
dumpLink(java.io.PrintStream out,
java.io.File file)
Write out a link to this file, including the description if this is an html file. |
protected void |
dumpStructNodeSummary(int elemindex,
java.io.PrintStream out)
Dump a summary of the struct and node declarations for this project. |
protected java.lang.String |
filterHTMLLine(java.lang.String line)
If the given line contains a node documentation link to be substituted then make that happen. |
void |
generate(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.util.Collection dirtyFiles,
java.lang.String extra)
Write the index html files. |
protected java.lang.String |
getCoreSpec(int elemindex)
Returns the core specification for a webelem. |
protected java.lang.String |
getFileNameForWebElem(java.lang.String elem)
Given a canonical webelem specification, return a platform appropriate filename. |
protected java.lang.String |
getIndent(int depth)
Return a String with the appropriate amount of indenting for the depth given. |
protected java.lang.String |
getIntroFileSpec(int elemindex)
Return the full file spec of the intro.html file |
protected java.lang.String |
getLinkForNodeName(java.lang.String nodename)
Given a general node project name, return a relative link to the docs for it. |
protected java.lang.String |
getLinkFromSourceDecl(java.lang.String nodename,
org.sandev.sandbuild.SandDecl currnode)
Given a node name and the corresponding SandDecl, return a link to the docs for it. |
protected java.lang.String |
getRelSandHome(int elemindex)
Return the relative path from a current element to SAND_HOME. |
protected java.lang.String |
getSandHome(java.io.File baseDir)
Return the SAND_HOME directory with no trailing file separator. |
protected org.sandev.sandbuild.SandProject[] |
getSandProjects()
Return an array of SandProjects for this build |
protected void |
getSandProjectsRec(java.util.ArrayList al,
org.sandev.sandbuild.SandProject proj)
Recursive workhorse for getSandProjects that walks the project tree and adds each element to the given ArrayList. |
protected java.lang.String |
getTitleForElem(int elemindex)
Given a web element index, return the title for it. |
protected void |
initNavTreeElements()
Set up the webelems and elemprojects arrays. |
protected boolean |
isGenDocFile(java.lang.String filespec)
Return true if the given filename is a known generator file. |
protected java.lang.String |
makelink(int rootindex,
int targindex,
java.lang.String val)
Return a hyperlink for the given entry. |
protected boolean |
projectChanged(org.sandev.sandbuild.SandProject proj,
int elemindex)
Return true if the given project exists, and a struct or node declaration was added or deleted, or the intro was changed. |
protected void |
writeBuildFileLink(int elemindex,
java.io.PrintStream out)
Write a link to the local build xml file if there is one. |
protected void |
writeDocLinks(int elemindex,
java.io.PrintStream out)
Write out links to the local top level docs. |
protected void |
writeGeneratorDocLink(int elemindex,
java.io.PrintStream out)
If there are generators defined for this project, then dump a link out to their javadoc. |
protected void |
writeGlobLinks(int elemindex,
java.io.PrintStream out)
Write the global links. |
protected void |
writeIndexFile(int elemindex)
Write the web index file specified by the web element at the given index. |
protected void |
writeIndexFileContents(int elemindex,
java.io.PrintStream out)
Write the bulk of the index file. |
protected void |
writeLocalLinks(int elemindex,
java.io.PrintStream out)
Write the local links. |
protected void |
writeMainContents(int elemindex,
java.io.PrintStream out)
Write the contents of the right hand "main" area. |
protected void |
writeNavBarContents(int elemindex,
java.io.PrintStream out)
Write the contents of the left hand "navbar" area. |
protected void |
writeNavTree(int elemindex,
java.io.PrintStream out)
Write the navigation tree for the build |
protected void |
writeNodeTableEntry(org.sandev.sandbuild.SandDecl decl,
java.lang.String docbase,
java.io.PrintStream out)
Write out a node entry cell for the struct and node summary table. |
protected void |
writeProjectLinks(int elemindex,
java.io.PrintStream out)
Write the navigation tree for the build |
void |
writeSandWeb(int mode,
java.io.File baseDir)
Starting from SAND_HOME, update the index pages according to the mode specified. |
protected void |
writeSourceDocLink(int elemindex,
java.io.PrintStream out)
If there is source defined for this project, then dump a link out to the javadoc for it. |
protected void |
writeStructTableEntry(org.sandev.sandbuild.SandDecl decl,
java.lang.String docbase,
java.io.PrintStream out)
Write out a struct entry cell for the struct and node summary table. |
| Methods inherited from class org.sandev.generator.GeneratorCommon |
|---|
capitalize, copyfile, deletefile, findStructDeclByShortname, getDeclaredFields, getFields, getInheritanceHierarchy, getLastAppProject, getLastUtilDir, getLongInstanceName, getPrintStream, getSandProject, getShortInstanceName, getUtilPackage, getVisibleFields, hasSubStructs, isArray, isBasic, isLongReferenceArray, isMessageInterface, isParentAbstract, isPrimitive, isRootStruct, isVowel, log, nextToken, pluralize, rangeEscape, removePlatformDecls, trackFileDelete, trackFileWrite, uncapitalize, writeDefaultCtor, writeDescription, writeHTMLContents, writeMessageImports, writeSectionName, writeStandardCommentID, writeXHTMLFooter, writeXHTMLFooter, writeXHTMLHeader, writeXHTMLHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_FORCEWRITE
public static final int MODE_CONDWRITE
public static final int MODE_DELETE
public static final java.lang.String FILE_GLOBLINK
public static final java.lang.String FILE_LOCLINK
protected java.lang.String[] webelems
[0] "SAND_HOME/docs/index.html"
[1] "SAND_HOME/apps/docs/index.html"
[2] "SAND_HOME/apps/basics/docs/index.html"
[3] "SAND_HOME/apps/TaskHeap/docs/index.html"
[4] "SAND_HOME/deploy/docs/index.html"
[5] "SAND_HOME/deploy/TaskHeapDemo/docs/index.html"
[6] "SAND_HOME/platform/docs/index.html"
[7] "SAND_HOME/platform/tools/docs/index.html"
Where "SAND_HOME" will vary depending on the environment.
protected org.sandev.sandbuild.SandProject[] elemprojects
protected java.lang.String sandhome
| Constructor Detail |
|---|
public ProjectIndexGenerator()
| Method Detail |
|---|
public void generate(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.util.Collection dirtyFiles,
java.lang.String extra)
throws org.sandev.sandbuild.SandGeneratorException
generate in interface org.sandev.sandbuild.SandGeneratororg.sandev.sandbuild.SandGeneratorException
public void cleanup(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.lang.String extra)
throws org.sandev.sandbuild.SandGeneratorException
cleanup in interface org.sandev.sandbuild.SandGeneratororg.sandev.sandbuild.SandGeneratorException
public void writeSandWeb(int mode,
java.io.File baseDir)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String getSandHome(java.io.File baseDir)
protected void initNavTreeElements()
protected org.sandev.sandbuild.SandProject[] getSandProjects()
protected void getSandProjectsRec(java.util.ArrayList al,
org.sandev.sandbuild.SandProject proj)
protected java.lang.String getFileNameForWebElem(java.lang.String elem)
protected boolean projectChanged(org.sandev.sandbuild.SandProject proj,
int elemindex)
protected void writeIndexFile(int elemindex)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String getTitleForElem(int elemindex)
protected void writeIndexFileContents(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeNavBarContents(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeNavTree(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String getCoreSpec(int elemindex)
protected java.lang.String makelink(int rootindex,
int targindex,
java.lang.String val)
protected java.lang.String getRelSandHome(int elemindex)
protected int countSlashes(java.lang.String val)
protected java.lang.String getIndent(int depth)
protected void writeProjectLinks(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeGlobLinks(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeGeneratorDocLink(int elemindex,
java.io.PrintStream out)
protected void writeSourceDocLink(int elemindex,
java.io.PrintStream out)
protected void writeBuildFileLink(int elemindex,
java.io.PrintStream out)
protected void writeLocalLinks(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeDocLinks(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void dumpLink(java.io.PrintStream out,
java.io.File file)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected boolean isGenDocFile(java.lang.String filespec)
protected void writeMainContents(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void dumpDocwebSummary(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void dumpStructNodeSummary(int elemindex,
java.io.PrintStream out)
protected void writeStructTableEntry(org.sandev.sandbuild.SandDecl decl,
java.lang.String docbase,
java.io.PrintStream out)
protected void writeNodeTableEntry(org.sandev.sandbuild.SandDecl decl,
java.lang.String docbase,
java.io.PrintStream out)
protected void dumpDeployTools(int elemindex,
java.io.PrintStream out)
protected java.lang.String getIntroFileSpec(int elemindex)
protected void dumpIntroContents(int elemindex,
java.io.PrintStream out)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String filterHTMLLine(java.lang.String line)
$NODEDOC(TaskHeapUI).
filterHTMLLine in class org.sandev.generator.GeneratorCommonprotected java.lang.String getLinkForNodeName(java.lang.String nodename)
protected java.lang.String getLinkFromSourceDecl(java.lang.String nodename,
org.sandev.sandbuild.SandDecl currnode)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||