|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.presentation.Formatter
public class Formatter
External call point for the presentation process. Any access to the presentation process must be done here. It encapsulates two basic features:
html
mathml
text
latex
pdf
| Field Summary | |
|---|---|
protected static boolean |
DEBUG
|
protected static Logger |
log
|
| Constructor Summary | |
|---|---|
Formatter(String fmt,
String lang)
Takes arguments "user" and "format", which are kept constant during the lifetime of the object. |
|
| Method Summary | |
|---|---|
byte[] |
formatItem(org.jdom.Element element)
|
byte[] |
formatItem(OJElement domTree)
Return a Byte array with the fragment content corresponding to a DOM tree. |
Fragment |
formatItem(String itemId)
Return a Fragment corresponding to an Item id, using the Fragment cache. |
void |
formatItem(String itemId,
OutputStream out)
Write a translated content fragment to an output stream. |
void |
formatText(String text,
OutputStream out)
Format a text string to the output stream. |
String |
formatTitle(String originalTitle)
Transform a title string if it seems to contain an XLM element. |
String |
getAssemblyFormat()
|
String |
getFormatPipeline()
|
String |
getLayoutFormat()
|
String |
getMimeType()
Returns the MIME type for the final transformation result. |
Map |
getXslParams()
Return the Map with the parameters used for the XSL transformation. |
protected org.jdom.transform.JDOMSource |
makeTransformationSource(Item item)
Builds a transformation source for an item. |
protected org.jdom.transform.JDOMSource |
makeTransformationSource(OJElement domTree)
Builds a transformation source for a DOM tree. |
void |
setXslFilename(String xslFilename)
Set the filename to use for the XSL transformation. |
void |
writeFragment(org.jdom.Element element,
OutputStream output)
|
void |
xslTransform(InputStream itemStream,
OutputStream output)
Transform the OMDoc item as read from itemStream,
and write the result to output. |
String |
xslTransform(String xmlText)
|
void |
xslTransform(String xmlText,
OutputStream output)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Logger log
protected static boolean DEBUG
| Constructor Detail |
|---|
public Formatter(String fmt,
String lang)
fmt - format of output document. (eg. "pdf")lang - human language to use for the page, if available.| Method Detail |
|---|
public String getMimeType()
Format.getMimeType(String)public String getFormatPipeline()
public String getAssemblyFormat()
public String getLayoutFormat()
public Map getXslParams()
public void setXslFilename(String xslFilename)
xslFilename -
public void xslTransform(InputStream itemStream,
OutputStream output)
throws TransformerException
itemStream,
and write the result to output.
Will not use the Fragment cache.
This is for transformation of items generated on the fly that
aren't to be stored, like the output of the CAS console.
itemStream - used to read the OMDoc item content.output - stream to receive the output.
TransformerException - problem with the XSLT transformer.
public void xslTransform(String xmlText,
OutputStream output)
throws TransformerException
TransformerException
public String xslTransform(String xmlText)
throws TransformerException,
IOException
TransformerException
IOExceptionprotected org.jdom.transform.JDOMSource makeTransformationSource(Item item)
protected org.jdom.transform.JDOMSource makeTransformationSource(OJElement domTree)
public Fragment formatItem(String itemId)
null on error
public void formatItem(String itemId,
OutputStream out)
throws IOException
IOExceptionpublic byte[] formatItem(OJElement domTree)
null on error.public byte[] formatItem(org.jdom.Element element)
public void writeFragment(org.jdom.Element element,
OutputStream output)
public void formatText(String text,
OutputStream out)
throws IOException
text - - text to format, encoded in UTF-8.out - - stream to output to (UTF-8 bytes)
IOExceptionpublic String formatTitle(String originalTitle)
originalTitle unchanged.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||