-
Interface Summary
Interface |
Description |
IFormatter |
The formatter generates the output format for the pipeline, e.g. the XML DOM
is serialized as HTML.
|
Package com.sapportals.wcm.service.pipeline.formatter Description
Provides an interface for generating the output format for the
publishing pipeline.
Package Specification
Purpose
Interfaces and Classes
Implementation Notes
Related Documentation
The
formatter is part of the publishing pipeline. When the publishing
pipeline has finished transforming the format of a resource, the
formatter is called to generate the output. The formatter processes an
XML DOM or stream with a format program to produce the desired output
format. Different formatter types are used, depending on whether output
for an XML DOM or stream is required. The type of formatter that must
be used is specified in different ways. If the IXsltPipelineService
is used to process an XML, the formatter is specified as a parameter of
the method that is called to execute pipeline processing. If the IPipelineService
is used, the formatter is specified in the processing instructions that
are generated with the help of a default processor.
Interfaces and Classes
The formatter package only provides a single
IFormatter
interface
with
a single
format
method. During pipeline processing, the
format
method is only called internally. It takes the content that has been
transformed by the processor and returns it in a format that is suitable
for an output device and can be displayed for an end user.
The KM platform provides different implementations of the
IFormatter
interface for XML and stream data. For XML data, it provides the
serializer and
pdf
formatter. For stream data, it provides the
stream
formatter.
Serializer Formatter (
JaxpPipelineFormatter)
This can transform an XML DOM that has been converted to
a different format by the processor. It takes the XML DOM and processes
it with a formatter program to create an output that is appropriate for
a specific device or application. An important prerequisite is
that the formatter program corresponds to the format type of the XML
DOM. This means, for example, if the processor applies the stylesheet page-svg.xsl to create a vector graphic format, it must be combined with
the formatter image/svg-xml to produce a legible result.
Example
The processor of the publishing pipeline applies an rss-html.xsl stylesheet to convert an XML DOM to a news format. The
formatter then takes the converted DOM and transforms it with a text/html formatter to generate an HTML output.
PDF Formatter
(
PdfPipelineFormatter)
This receives an XML DOM that has been prepared for pdf output.
It generates the pdf output by applying a application/pdf formatter program.
Stream Formatter (
StreamPipelineFormatter)
A stream formatter is used whenever the pipeline processes a stream of
bytes. At present, KM only supports the processing of an HTML input
stream, which is handled by an HTML processor. When the HTML processor
has applied a CSS stylesheet to an HTML, the stream formatter provides
the HTML output by simply passing the data from the processor to
an output instance. The stream formatter does not actually perform any
processing steps.
The table shows the implementations of formatter programs
available within the KM framework for transformations. To execute a
transformation, it is necessary to provide a specially written
stylesheet that generates an output that is compatible with the
formatter program. All the formatter programs shown in the table are
ready for use, except the PDF formatter. This works together with a
public domain library that must first be downloaded.
The
Identifier column of the
table shows the name of the formatter that is used within the KM
framework. The name must be used, for example, when specifying
processing instructions for the publishing pipeline.
Implemented
Class
|
Instances
|
Identifier
|
Output |
JaxpPipelineFormatter |
html
|
text/html
|
html
|
|
plain
|
text/plain
|
text format
|
|
svg-xml
|
image/svg-xml
|
scalable vector graphic
|
|
vrml
|
model/vrml |
interactive 3D mulitmedia format
for the web
|
|
wml
|
text/wml |
wireless markup language format
|
|
xhtml
|
text/xhtml
|
xhtml
|
|
xml
|
text/xml
|
|
PdfPipelineFormatter |
fop
|
application/pdf
|
pdf
|
StreamPipelineFormatter |
stream
|
application/octet
stream
|
|
Related Documentation
For information on the different components that play role in the
publishing pipeline see: