Configuring and Compiling the BookPrint Delegate
You can write custom server code such as CustomBookPrintDelegate that is invoked using a delegate mechanism. In general, the process involves the following:
Create a custom Java class and implement the BookPrintDelegate interface. It is recommended that this custom Java class be put in a custom Java package that can easily be identified to prevent class name collisions.
Compiling the BookPrint Delegate
To compile the BookPrint Delegate, perform these steps:
1. Create a new custom folder under <WT_HOME>/codebase.war/ directory.
2. Create a Java file CustomBookPrintDelegate.java in package com.ptc.sc.services.For reference, review the DefaultBookPrintDelegate that has the default implementation and make modifications as needed based on the explanation above.
3. Change current directory to <WT_HOME>/bin from a command prompt.
4. Run windchill shell. This will open a windchill shell required for compiling CustomBookPrintDelegate.java.
5. From windchill shell change directory to <WT_HOME>.
6. Execute javac codebase.war/custom/com/ptc/sc/services/plugins/CustomBookPrintDelegate.java
This will compile CustomBookPrintDelegate.java and place the CustomBookPrintDelegate.class file inside <WT_HOME>/ codebase.war/custom/com/ptc/sc/services/plugins/CustomBookPrintDelegate.class
Configuring the BookPrint Delegate
To configure the BookPrint Delegate, perform these steps:
1. Create a similar package structure (com/ptc/sc/services/plugins/) inside folder <WT_HOME>/codebase.war/WEB-INF/classes/
2. Place the CustomBookPrintDelegate.class file inside <WT_HOME>/codebase.war/WEB-INF/classes/com/ptc/sc/services/plugins/
3. Add the following entry to the <WT_HOME>//site.xconf specifying the custom BookPrint delegate:
<Service context="default"
name="com.ptc.sc.services.plugins.BookPrintDelegate">
<Option cardinality="duplicate"
serviceClass="com.ptc.sc.services.plugins.CustomBookPrintDelegate"
requestor="null"/>
</Service>
4. Restart the PTC Arbortext Content Delivery server.