|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aurigalogic.aurigadoc.core.BaseConverter
This class is the base converter for the AurigaDoc package. Its main purpose is to provide common menthods for all other converter classes. All other converters are derived from this class.
Field Summary | |
protected java.lang.String |
AURIGADOC_HOME
AURIGADOC HOME |
protected java.lang.String |
inputFile
The input file path |
protected Logger |
logger
The logger |
static java.lang.String |
OUTPUT_HTML
Output Method for html |
static java.lang.String |
OUTPUT_TEXT
Output Method for text |
static java.lang.String |
OUTPUT_XML
Output Method for xml |
protected java.lang.String |
outputFile
The output file/dir path |
protected java.util.Properties |
parameters
Options collection |
protected byte[] |
profiledData
profiled xml stream |
static java.lang.String |
PROFILING
Stylesheet for profiling |
protected java.util.Properties |
props
Properties collection |
protected static java.lang.String |
XML2AWT
Stylesheet for AWT output |
protected static java.lang.String |
XML2CHMHHC
Stylesheet for CHM HHC output |
protected static java.lang.String |
XML2CHMHHK
Stylesheet for CHM HHK output |
protected static java.lang.String |
XML2CHMHHP
Stylesheet for CHM HHP output |
protected static java.lang.String |
XML2DHTMLFRAMESET
Stylesheet for DHTML main frame output |
protected static java.lang.String |
XML2DHTMLNAV
Stylesheet for DHTML navigation frame output |
protected static java.lang.String |
XML2FO
Stylesheet for FO output |
protected static java.lang.String |
XML2HTML
Stylesheet for HTML output |
protected static java.lang.String |
XML2JHELPHS
Stylesheet for JHELP HS output |
protected static java.lang.String |
XML2JHELPINDEX
Stylesheet for JHELP Index output |
protected static java.lang.String |
XML2JHELPMAP
Stylesheet for JHELP Map output |
protected static java.lang.String |
XML2JHELPTOC
Stylesheet for JHELP TOC output |
protected static java.lang.String |
XML2MAN
Stylesheet for unix man source output |
protected static java.lang.String |
XML2MHTML
Stylesheet for MULTI-HTML output |
protected static java.lang.String |
XML2OHJHS
Stylesheet for OHJ HELP HS output |
protected static java.lang.String |
XML2OHJINDEX
Stylesheet for OHJ Index output |
protected static java.lang.String |
XML2OHJMAP
Stylesheet for OHJ Map output |
protected static java.lang.String |
XML2OHJTOC
Stylesheet for OHJ TOC output |
protected static java.lang.String |
XML2PDF
Stylesheet for PDF output |
protected static java.lang.String |
XML2PS
Stylesheet for PS output |
protected static java.lang.String |
XML2RTF
Stylesheet for RTF output |
static java.lang.String |
XSL
Identifier for specifying the main xsl which generates html, fo, man, etc |
protected static java.lang.String |
XSL_PROFILING
|
Constructor Summary | |
BaseConverter()
Default constructor. |
Method Summary | |
void |
convert()
Main method wich does the conversion. |
void |
convert(java.lang.String inputFile,
java.lang.String outFile)
Converts the file given by the inputFile store the output in the file named by outputFile. |
protected void |
copyFiles(java.lang.String srcDir,
java.lang.String destDir)
Copies all files form the srcDir to destDir. |
protected void |
doTransform(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
java.lang.String xslFile,
java.lang.String outputMethod)
Takes the xml source and write the output to the given stream by doing an xsl transformation. |
protected java.lang.String |
getDefaultXSLUrl(java.lang.String xslName)
Get the xsl path as a url string for the default xsl. |
protected java.lang.String |
getParameter(java.lang.String key)
Get the value of the parameter speecified by key. |
java.lang.String |
getProperty(java.lang.String key)
Return the value of the property identified by key key. |
protected java.lang.String |
getXSLForKey(java.lang.String key,
java.lang.String defaultXSL)
Gets the url of the xsl with the specified key. |
protected void |
logDebug(java.lang.String msg)
Log the msg as debug using the logger set with setLogger. |
protected void |
logError(java.lang.String msg,
java.lang.Exception e)
Log the msg as error using the logger set with setLogger. |
protected void |
logInfo(java.lang.String msg)
Log the msg as info using the logger set with setLogger. |
protected void |
logWarning(java.lang.String msg)
Log the msg as warning using the logger set with setLogger. |
protected void |
preProcess()
Does pre-processing of the input. |
void |
setHome(java.lang.String home)
Set the home path. |
void |
setInputFile(java.lang.String inFile)
Set the input file. |
void |
setLogger(Logger logger)
Set the logger. |
void |
setOutputFile(java.lang.String outFile)
Set the output file. |
void |
setParameters(java.util.Properties parameters)
Set additional parameters required for each converter. |
void |
setTransformerParameter(java.lang.String paramName,
java.lang.String paramValue)
Sets the tarnsformer parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Properties parameters
protected java.util.Properties props
protected java.lang.String AURIGADOC_HOME
protected static final java.lang.String XML2HTML
protected static final java.lang.String XML2MHTML
protected static final java.lang.String XML2DHTMLFRAMESET
protected static final java.lang.String XML2DHTMLNAV
protected static final java.lang.String XML2PDF
protected static final java.lang.String XML2PS
protected static final java.lang.String XML2RTF
protected static final java.lang.String XML2AWT
protected static final java.lang.String XML2FO
protected static final java.lang.String XML2JHELPHS
protected static final java.lang.String XML2JHELPTOC
protected static final java.lang.String XML2JHELPMAP
protected static final java.lang.String XML2JHELPINDEX
protected static final java.lang.String XML2CHMHHC
protected static final java.lang.String XML2CHMHHP
protected static final java.lang.String XML2CHMHHK
protected static final java.lang.String XML2MAN
protected static final java.lang.String XML2OHJHS
protected static final java.lang.String XML2OHJTOC
protected static final java.lang.String XML2OHJMAP
protected static final java.lang.String XML2OHJINDEX
public static final java.lang.String OUTPUT_HTML
public static final java.lang.String OUTPUT_XML
public static final java.lang.String OUTPUT_TEXT
protected java.lang.String inputFile
protected java.lang.String outputFile
protected Logger logger
protected byte[] profiledData
public static final java.lang.String XSL
protected static final java.lang.String XSL_PROFILING
public static final java.lang.String PROFILING
Constructor Detail |
public BaseConverter()
Method Detail |
public void setOutputFile(java.lang.String outFile)
setOutputFile
in interface ADConverter
outFile
- the output file/dir path.public void setInputFile(java.lang.String inFile)
setInputFile
in interface ADConverter
inFile
- the input file path.public void setLogger(Logger logger)
setLogger
in interface ADConverter
logger
- the logger to be used for logging.public void setHome(java.lang.String home)
home
- the path of aurigadoc installation.public void convert(java.lang.String inputFile, java.lang.String outFile) throws java.lang.Exception
convert
in interface ADConverter
inputFile
- the path of the inputFile file.outFile
- the path of the output file.
java.lang.Exception
- in case of an error.public void convert() throws java.lang.Exception
convert
in interface ADConverter
java.lang.Exception
- if called.protected void preProcess() throws java.lang.Exception
java.lang.Exception
protected void doTransform(java.io.InputStream inputStream, java.io.OutputStream outputStream, java.lang.String xslFile, java.lang.String outputMethod) throws java.lang.Exception
inputStream
- the input streamoutputStream
- the output streamxslFile
- the xsl file pathoutputMethod
- the output method(text,html,xml)
java.lang.Exception
- in case of an error.protected void copyFiles(java.lang.String srcDir, java.lang.String destDir) throws java.lang.Exception
srcDir
- the source directory pathdestDir
- the destination directory path
java.lang.Exception
- in case of an error.public java.lang.String getProperty(java.lang.String key)
key
- the key for the property
protected java.lang.String getDefaultXSLUrl(java.lang.String xslName) throws java.lang.Exception
xslName
- the xsl file name
java.lang.Exception
- in case of an error.protected void logInfo(java.lang.String msg)
msg
- the message to log.protected void logDebug(java.lang.String msg)
msg
- the message to log.protected void logError(java.lang.String msg, java.lang.Exception e)
msg
- the message to log.e
- the exception to log.protected void logWarning(java.lang.String msg)
msg
- the message to log.public void setParameters(java.util.Properties parameters)
setParameters
in interface ADConverter
parameters
- the parameters collectionprotected java.lang.String getParameter(java.lang.String key)
key
- the key of the option
public void setTransformerParameter(java.lang.String paramName, java.lang.String paramValue)
paramName
- the parameter nameparamValue
- the parameter valueprotected java.lang.String getXSLForKey(java.lang.String key, java.lang.String defaultXSL) throws java.lang.Exception
key
- the xsl with the given keydefaultXSL
- the default xsl to use if the custom xsl is
not specified.
java.lang.Exception
- in case of an error.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |