org.activemath.webapp.view.tools
Class PresentationTool

java.lang.Object
  extended by org.activemath.webapp.view.tools.PresentationTool

public class PresentationTool
extends Object

View tool for accessing the presentation system. TODO: write a good documentation, it's important here... For now, see org.activemath.webapp.controller.ViewBook controller for how to use it.

Version:
$$Revision: 1.11 $$

Field Summary
protected static Logger log
           
 
Constructor Summary
PresentationTool(String fmt, String lang, AppModel model, HttpServletResponse servletResponse)
           
 
Method Summary
 boolean doesRendering()
          Say if assembly/layout rendering is needed for the current format.
 String getAssemblyFormat()
           
 Formatter getAssemblyFormatter()
          Returns the assembly formatter for this tool.
 String getAssemblyTemplate()
           
 String getContentType()
          Return the content type for the current Formatter.
 String getLang()
           
 String getLayoutFormat()
           
 Map getModel()
           
 ServletResponse getServletResponse()
           
 TransformTool getTransformer()
           
 Map getXslParams()
          Delegate for Formatter.getXslParams() Return the Map with the parameters used for the XSL transformation.
 void render()
          Render a layout format to the Servlet's OutputStream A layout format is data (eg.
 void render(OutputStream outstream)
           
 void setAssemblyTemplate(String path)
          Set the path for the Velocity template to use for assembly.
 void setXslFilename(String xslFilename)
          Delegate for Formatter.setXslFilename()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
Constructor Detail

PresentationTool

public PresentationTool(String fmt,
                        String lang,
                        AppModel model,
                        HttpServletResponse servletResponse)
Method Detail

doesRendering

public boolean doesRendering()
Say if assembly/layout rendering is needed for the current format.


render

public void render()
            throws Exception
Render a layout format to the Servlet's OutputStream A layout format is data (eg. PDF) that is produced from a textual assembly format (eg. Latex). We use Velocity to generate the document in the required assembly format, then output that text to the formatter for the layout format.

Throws:
Exception

render

public void render(OutputStream outstream)
            throws Exception
Throws:
Exception

getXslParams

public Map getXslParams()
Delegate for Formatter.getXslParams() Return the Map with the parameters used for the XSL transformation. The Map can be modified at will before calling XSL transformation occurs.

Returns:
the Map with the parameters used for the XSL transformation.

setXslFilename

public void setXslFilename(String xslFilename)
Delegate for Formatter.setXslFilename()

Parameters:
xslFilename - to use by the formatter for XSL transformation

getContentType

public String getContentType()
Return the content type for the current Formatter.

Returns:
content type for the current Formatter.

getModel

public Map getModel()
Returns:
Returns the model.

getAssemblyFormatter

public Formatter getAssemblyFormatter()
Returns the assembly formatter for this tool.

This is either usual default formatter, or the specific assembly formatter if layout format is different.


getLayoutFormat

public String getLayoutFormat()
Returns:
Returns the layoutFormat.

getAssemblyFormat

public String getAssemblyFormat()
Returns:
Returns the assemblyFormat.

getTransformer

public TransformTool getTransformer()
Returns:
the appropriate transformer tool for this format

getServletResponse

public ServletResponse getServletResponse()
Returns:
Returns the servletResponse.

getAssemblyTemplate

public String getAssemblyTemplate()
Returns:
Returns the velocityPath.

setAssemblyTemplate

public void setAssemblyTemplate(String path)
Set the path for the Velocity template to use for assembly.


getLang

public String getLang()
Returns:
Returns the lang.