|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfiletools.filegenerators.HelpFileIndexDBCompendiumGenerator
filetools.filegenerators.HelpFileWikiIndexGenerator
public class HelpFileWikiIndexGenerator
This class provides functionality for generating texts in mediawiki syntax and in different styles. These texts contain links to html-helpfiles for all Matlab-functions in the matlab reference directory. Two styles are available: a simple table-format where each cell contains a link to a function or a singleline-mode, where each function is presented in a single row. In singleline-mode a short description of the func is also given. This class may be instanced or used as a stand-alone application.
Field Summary | |
---|---|
private static int |
CELLWIDTH
|
static java.lang.String |
DBPROPERTYFILE
Name of the property file which contains data for the db-connection |
private static java.lang.String |
HTMLBASE
Base directory of the Matlab html-reference |
private static int |
NUM_COLS
Some definitions for the format of the tables |
private java.util.Hashtable<java.lang.String,java.lang.String[]> |
searchExceptions
Contains all exceptions (beginnings of the filenames which shouldn't be written into the target-file) |
private boolean |
singleline
|
static java.lang.String |
SINGLELINE_ARG
Definition of the commandline-arg which switches singleline-mode on |
private static int |
SINGLELINE_WIDTH
|
static java.lang.String |
STARTFILE
Name of the file which should be included as the first category |
private static java.lang.String |
TECHDOCREFDIR
Part of the path which marks the reference-directory |
Fields inherited from class filetools.filegenerators.HelpFileIndexDBCompendiumGenerator |
---|
DB_TABLENAME, HTML_EXTENSION, outputFileWriter, properties |
Constructor Summary | |
---|---|
HelpFileWikiIndexGenerator()
Only constructor of this class. |
Method Summary | |
---|---|
protected void |
endProcessQuery(java.sql.ResultSet resultSet)
This function is called for every query after the processing of its results. |
private void |
generateCategory(java.lang.String category)
Writes a category into the target-file. |
private java.lang.String |
getQuery(java.lang.String begin)
Generates a string which contains a MySQL-query for getting the relevant data |
static void |
main(java.lang.String[] args)
|
protected void |
processRow(java.sql.ResultSet row)
In this function concrete classes need to define what to do with a single row of the result of the last executed query. |
protected void |
processTask()
This function contains the code which manages the whole task. |
void |
setSingleline(boolean singleline)
Switches the singleline-mode on or off. |
private void |
writeCell(java.lang.String function,
java.lang.String path,
java.lang.String description)
Writes a single cell or, if singleline-mode is active, two cells (which build the content of one row) into the table |
Methods inherited from class filetools.filegenerators.HelpFileIndexDBCompendiumGenerator |
---|
connectToDB, generateFile, includeFile, readPropertiesFromFile, sendAndProcessQuery, setProperties, startProcessQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String TECHDOCREFDIR
private static final java.lang.String HTMLBASE
public static final java.lang.String DBPROPERTYFILE
public static final java.lang.String STARTFILE
public static final java.lang.String SINGLELINE_ARG
private static final int NUM_COLS
private static final int CELLWIDTH
private static final int SINGLELINE_WIDTH
private boolean singleline
private java.util.Hashtable<java.lang.String,java.lang.String[]> searchExceptions
Constructor Detail |
---|
public HelpFileWikiIndexGenerator()
Method Detail |
---|
protected void processTask()
HelpFileIndexDBCompendiumGenerator
processTask
in class HelpFileIndexDBCompendiumGenerator
HelpFileIndexDBCompendiumGenerator.processTask()
private void generateCategory(java.lang.String category) throws java.io.IOException, java.sql.SQLException
category
- Specifies the beginning of all filenames to retrieve from the DB.
This is also the title of this category
java.io.IOException
java.sql.SQLException
private java.lang.String getQuery(java.lang.String begin)
begin
- Specifies the beginning of the filenames which should be returned
protected void processRow(java.sql.ResultSet row) throws java.sql.SQLException, java.io.IOException
HelpFileIndexDBCompendiumGenerator
processRow
in class HelpFileIndexDBCompendiumGenerator
row
- ResultSet in which the row to process is the actual one.
So one can get the results by using the get... functions of row
java.sql.SQLException
java.io.IOException
#processRow(java.sql.ResultSet)
protected void endProcessQuery(java.sql.ResultSet resultSet) throws java.sql.SQLException, java.io.IOException
HelpFileIndexDBCompendiumGenerator
endProcessQuery
in class HelpFileIndexDBCompendiumGenerator
resultSet
- ResultSet after all rows of the result were processed.
java.sql.SQLException
java.io.IOException
#endProcessQuery(java.sql.ResultSet)
private void writeCell(java.lang.String function, java.lang.String path, java.lang.String description) throws java.io.IOException
function
- Filename of the helpfilepath
- Absolute path of the filedescription
- A closer description, needed only in singleline-mode
java.io.IOException
public void setSingleline(boolean singleline)
singleline
- Set this param true to turn singleline-mode onpublic static void main(java.lang.String[] args)
args
- Specifies the name of the file to generate and additional params
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |