Content Pipeline Guide > Content Pipelines > Composer Configuration Files > Creating a Complex CCF File
  
Creating a Complex CCF File
The following CCF file defines a pipeline that appends a copyright statement to the input document and writes the output to a file or back to a Arbortext Editor document.
<?xml version="1.0" encoding="utf-8"?>
<!--ArborText, Inc., 1988-2002, v.4002-->
<!DOCTYPE Composer PUBLIC "-//Arbortext//DTD Composer 1.0//EN"
"composer.dtd" [
<!ENTITY % stock PUBLIC "-//Arbortext//DTD Fragment -
ATI Stock filter list//EN" "">
%stock;
]>
<Composer>
<Label>Copyright.ccf</Label>
<Documentation>This CCF file defines the pipeline that
appends a copyright statement to an HTML file that is
generated by the XSL transformation.
</Documentation>
<Interface>
<Label>API Parameters</Label>
<Documentation>The composer exposes the following parameters
to the API.
</Documentation>
<Parameter idref="epicGenerator.docId" name="document"
required="yes"></Parameter>
<Parameter idref="switch.outputPipe" name="destination"
required="yes"></Parameter>
<Parameter idref="fileSerializer.outputFile" name="filename"
required="no"></Parameter>
<Parameter idref="epicSerializer.docId" name="output_docid"
required="no"></Parameter>
<Parameter idref="xslTransformer.stylesheet"
name="stylesheet" required="yes"></Parameter>
<Parameter idref="fileSerializer.html.entSubFname"
name="html.entSubFname"></Parameter>
</Interface>
<Resource>
<Label>Filter resources.</Label>
<Documentation>The composer uses the following filter resources
</Documentation>
&epicGenerator;
&fileSerializer;
&epicSerializer;
&switch;
&xslTransformer;
&namespaceFixer;
<FilterDef id="htmlTailAppender"
adapterClass=
"com.arbortext.epic.saxfilter.DefaultFilterAdapter"
filterClass=
"com.arbortext.epic.compose.examples.HTMLTailAppender"
type="transformer">
<Label>HTML Tail Appender</Label>
<Documentation>Definition for filter that appends a given
HTML stream to the first one.
</Documentation>
</FilterDef>
</Resource>
<Pipeline startFilters="epic_generator copyright_statement">
<Label>Pipeline geometry.</Label>
<Documentation>The following filters implement this composer.
</Documentation>
<Filter id="epic_generator"
filterDefRef="epicGenerator">
<FilterParameter name="docId">
<ComposerParameter name="document"/>
</FilterParameter>
</Filter>
<Boilerplate id="copyright_statement">
<Content>
<html:h6 xmlns:html="http://www.w3.org/TR/REC-html40">
Copyright2002.Arbortext Inc.
</html:h6>
</Content>
</Boilerplate>
<Filter id="xsl_transformer"
filterDefRef="xslTransformer">
<FilterParameter name="stylesheet">
<ComposerParameter name="stylesheet"/>
</FilterParameter>
<Input filterRef="epic_generator"/>
</Filter>
<Filter id="copyright_ns_fixer"
filterDefRef="namespaceFixer">
<FilterParameter name="originNamespace">
<Value>http://www.w3.org/TR/REC-html40</Value>
</FilterParameter>
<FilterParameter name="prefix">
<Value> </Value>
</FilterParameter>
<Input filterRef="copyright_statement"/>
</Filter>
<Filter id="copyright_appender"
filterDefRef="copyrightAppender">
<Input filterRef="xsl_transformer"/>
<Input filterRef="copyright_ns_fixer"/>
</Filter>
<Filter id="output_selector" filterDefRef="switch">
<FilterParameter name="outputPipe">
<ComposerParameter name="destination"/>
</FilterParameter>
<FilterParameter name="pipeName1">
<Value>File</Value>
</FilterParameter>
<FilterParameter name="pipeName2">
<Value>Epic</Value>
</FilterParameter>
<Input filterRef="copyright_appender"/>
</Filter>
<Filter id="file_output" filterDefRef="fileSerializer">
<FilterParameter name="outputFile">
<ComposerParameter name="filename"/>
</FilterParameter>
<FilterParameter name="html.entSubFname">
<ComposerParameter name="html.entSubFname"/>
</FilterParameter>
<Input filterRef="xsl_transformer"
pipeName="outputProps"/>
<Input filterRef="output_selector" pipeName="pipe1"/>
</Filter>
<Filter id="epic_output" filterDefRef="epicSerializer">
<FilterParameter name="docId">
<ComposerParameter name="output_docid"/>
</FilterParameter>
<Input filterRef="output_selector" pipeName="pipe2"/>
</Filter>
</Pipeline>
</Composer>
The pipeline has two start filters, the epicgenerator, which reads the document from Arbortext Editor or the Arbortext Publishing Engine, and the Boilerplate, which sends the copyright statement as SAX events.
<Pipeline startFilters="epic_generator copyright_statement">
A Boilerplate is a source filter that can contain CDATA or namespace elements. The Content element specifies the SAX events to be generated by the Boilerplate.
If you include namespace elements in the Boilerplate filter, you must specify a namespace to conform to the composer DTD. In the following example, an HTML h6 tag is used as markup, so the element must specify the HTML namespace.
* 
The namespace is subsequently stripped using the namespace_fixer filter.
<Boilerplate id="copyright_statement">
<Content>
<html:h6 xmlns:html="http://www.w3.org/TR/REC-html40">
Copyright2002.Arbortext Inc.
</html:h6>
</Content>
</Boilerplate>
* 
You could also store this Boilerplate in a file and include it as a file entity. This would localize the copyright message, allowing for translations.
Two SAX event streams are merged in the copyright_appender filter using two Input elements. The filter intercepts the end element events for body and html, and appends the copyright statement.
<Filter id="copyright_appender" filterDefRef="copyrightAppender">
<Input filterRef="xsl_transformer"/>
<Input filterRef="copyright_ns_fixer"/>
</Filter>
A switch filter controls the output destination. The filter directs its input to the pipe specified by the outputPipe parameter. There are two pipes in this example, a file and Arbortext Editor.
<Filter id="output_selector" filterDefRef="switch">
<FilterParameter name="outputPipe">
<ComposerParameter name="destination"/>
</FilterParameter>
<FilterParameter name="pipeName1">
<Value>File</Value>
</FilterParameter>
<FilterParameter name="pipeName2">
<Value>Epic</Value>
</FilterParameter>
<Input filterRef="copyright_appender"/>
</Filter>