Spool Handler Enhancement in DocBridge Pilot
The spool handlers in DocBridge Pilot do not always support all the DocBridge Mill functions. The barcode handler, for example, is not able to specify the encoding, width and length of a data matrix.
Using the barcode handler as an example, note how the enhancement is made through an entry in the custompu.xsd file and the use of the new parameters in BarcodeHandler.js.
In the custompu.xsd file, the enhancement is added between the lines
<xs:redefine schemaLocation="ProcessUnit.xsd">
and
</xs:redefine>
Here three parameters are added to the ComplexType barcode: BarcodeEncoding, Columns and Width. The code for the enhancement follows:
<xs:complexType name="Barcode">
<xs:complexContent>
<xs:extension base="Barcode">
<xs:sequence>
<xs:element name="BarcodeEncoding"
type="BarcodeEncodingSimpleType" default="BASE256" minOccurs="0"/>
<xs:element name="Columns" type="xs:int" minOccurs="0" />
<xs:element name="Rows" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
A selection list, 'BarcodeEncodingSimpleType', was specified for the encoding. This list must also be defined after:
</xs:redefine>
The definition of the selection list corresponds to the following code:
<xs:simpleType name="BarcodeEncodingSimpleType">
<xs:restriction base="xs:string">
<xs:enumeration value="BASE256" />
<xs:enumeration value="ASCII" />
<xs:enumeration value="C40" />
</xs:restriction>
</xs:simpleType>
For this parameter to be used in the handler, the original handler needs to be loaded. Copy the 'BarcodeHandler.js' handler provided from the '{DocBridgePilot-Installationpath}/dbpilot/bin/java/apache-tomcat-5.5.29/webapps/docpilot2/WEB-INF/classes/processunit/2.11/scripts/outputprofile' directory into the '{DocBridgePilot-Projekt}/customscripts/outputprofile' directory
1. Copy the values:
this.bc_rotation=(conf.Rotation) ? parseInt(conf.Rotation) : 0;
this.bc_encoding=(conf.BarcodeEncoding) ? conf.BarcodeEncoding : "";
this.bc_columns=(conf.Columns) ? parseInt(conf.Columns) : 0;
this.bc_rows=(conf.Rows) ? parseInt(conf.Rows) : 0;
this.generateBarcodeContentHandler=(conf.generateBarcodeContentHandler) ?
conf.generateBarcodeContentHandler : false;
2. Process the values:
var bar = new Barcode();
:
if …
} else {
:
:
}
// get the encoding
if (typeof this.bc_encoding != 'undefined' && this.bc_encoding != '') {
switch (this.bc_encoding)
{
case "BASE256" : bcEncoding=Constants.Barcode.DataMatrixEncoding.Base256;
break;
case "ASCII" : bcEncoding=Constants.Barcode.DataMatrixEncoding.ASCII;
break;
case "C40" : bcEncoding=Constants.Barcode.DataMatrixEncoding.C40;
break;
}
}
if (doLog) logMsg( "DBP4353I 'BarcodeHandler.processPage' barcode content: "+tmpstring);
if (typeof tmpstring != 'undefined' && tmpstring != '') {
:
if (doLog) logMsg( "DBP4353I 'BarcodeHandler.processPage' barcode MatixDimensions: "+this.bc_rows+"rows, "+this.bc_columns+"columns");
bar.setDataMatrixDimensions(this.bc_rows,this.bc_columns);
if (typeof bcEncoding != 'undefined') bar.setDataMatrixEncoding(bcEncoding);
:
bar.setDataString(tmpstring);
:
This allows the addition of parameters to the spool handlers in DocBridge Workbench Pilot, which can be used for simple configuration via the interface.


