org.mycore.common.xml
Class MCRLayoutService

java.lang.Object
  extended by org.mycore.common.xml.MCRLayoutService
All Implemented Interfaces:
EventListener, org.apache.xalan.trace.TraceListener

public class MCRLayoutService
extends Object
implements org.apache.xalan.trace.TraceListener

Does the layout for other MyCoRe servlets by transforming XML input to various output formats, using XSL stylesheets.

Version:
$Revision: 15201 $ $Date: 2008-05-21 15:53:52 +0200 (Mi, 21. Mai 2008) $
Author:
Frank L�tzenkirchen, Thomas Scheffler (yagee)

Method Summary
static Properties buildXSLParameters(HttpServletRequest request)
           
 Document doLayout(Document doc, String stylesheetName, Hashtable<String,String> params)
           
 void doLayout(HttpServletRequest req, HttpServletResponse res, Document jdom)
           
 void doLayout(HttpServletRequest req, HttpServletResponse res, Document dom)
           
 void doLayout(HttpServletRequest req, HttpServletResponse res, File file)
           
 void doLayout(HttpServletRequest req, HttpServletResponse res, InputStream is)
           
 void doLayout(HttpServletRequest req, HttpServletResponse res, Writer out, Document jdom)
          writes the transformation result directly into the Writer uses the HttpServletResponse only for error messages
 void generated(org.apache.xalan.trace.GenerateEvent ev)
          When a stylesheet generates characters, they will be logged in debug mode.
static MCRLayoutService instance()
           
 void selected(org.apache.xalan.trace.SelectionEvent ev)
          When a stylesheet does a selection, like in <xsl:value-of /> or similar elements, the selection element and xpath is logged in debug mode.
 void sendXML(HttpServletRequest req, HttpServletResponse res, Document jdom)
           
 void sendXML(HttpServletRequest req, HttpServletResponse res, Document dom)
           
 void sendXML(HttpServletRequest req, HttpServletResponse res, File file)
           
 void sendXML(HttpServletRequest req, HttpServletResponse res, InputStream in)
           
 void trace(org.apache.xalan.trace.TracerEvent ev)
          Traces the execution of xsl stylesheet elements in debug mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static MCRLayoutService instance()

sendXML

public void sendXML(HttpServletRequest req,
                    HttpServletResponse res,
                    Document jdom)
             throws IOException
Throws:
IOException

sendXML

public void sendXML(HttpServletRequest req,
                    HttpServletResponse res,
                    Document dom)
             throws IOException
Throws:
IOException

sendXML

public void sendXML(HttpServletRequest req,
                    HttpServletResponse res,
                    InputStream in)
             throws IOException
Throws:
IOException

sendXML

public void sendXML(HttpServletRequest req,
                    HttpServletResponse res,
                    File file)
             throws IOException
Throws:
IOException

doLayout

public void doLayout(HttpServletRequest req,
                     HttpServletResponse res,
                     Document jdom)
              throws IOException
Throws:
IOException

doLayout

public void doLayout(HttpServletRequest req,
                     HttpServletResponse res,
                     Writer out,
                     Document jdom)
              throws IOException
writes the transformation result directly into the Writer uses the HttpServletResponse only for error messages

Throws:
IOException

doLayout

public void doLayout(HttpServletRequest req,
                     HttpServletResponse res,
                     Document dom)
              throws IOException
Throws:
IOException

doLayout

public void doLayout(HttpServletRequest req,
                     HttpServletResponse res,
                     InputStream is)
              throws IOException
Throws:
IOException

doLayout

public void doLayout(HttpServletRequest req,
                     HttpServletResponse res,
                     File file)
              throws IOException
Throws:
IOException

doLayout

public Document doLayout(Document doc,
                         String stylesheetName,
                         Hashtable<String,String> params)
                  throws Exception
Throws:
Exception

buildXSLParameters

public static Properties buildXSLParameters(HttpServletRequest request)

trace

public void trace(org.apache.xalan.trace.TracerEvent ev)
Traces the execution of xsl stylesheet elements in debug mode. The trace is written to the log, and in parallel as comment elements to the output html.

Specified by:
trace in interface org.apache.xalan.trace.TraceListener

generated

public void generated(org.apache.xalan.trace.GenerateEvent ev)
When a stylesheet generates characters, they will be logged in debug mode.

Specified by:
generated in interface org.apache.xalan.trace.TraceListener

selected

public void selected(org.apache.xalan.trace.SelectionEvent ev)
When a stylesheet does a selection, like in <xsl:value-of /> or similar elements, the selection element and xpath is logged in debug mode.

Specified by:
selected in interface org.apache.xalan.trace.TraceListener