70 Identity Manager 3.6 Manual Task Service Driver Implementation Guidenovdocx (en) 17 September 2009G.2 Constructing Message Documents by UsingStylesheets and Template DocumentsIt is convenient to use the same method to construct documents that the SMTP handler uses, whichis a combination of style sheets, template documents, and replacement data. To do this, you mustobtain the style sheets and template documents, and invoke the style sheet processorprogrammatically.The sample code found in SampleCommandHandler.java illustrates this process.G.3 SampleCommandHandler.javaSource code for a sample custom command handler is included with the driver distribution. Thesource code is found in the manual_task_docs.zip file in the distribution image.The handler is implemented in thecom.novell.nds.dirxml.driver.manualtask.samples.SampleCommandHandler class.The sample handler simply generates a document using style sheets and templates and writes theresulting document to a file.G.3.1 Compiling the SampleCommandHandler ClassYou can use any Java 2 compiler to compile the SampleCommandHandler class. You must placenxsl.jar, dirxml.jar, collections.jar, and ManualTaskServiceBase.jar in the Javacompiler classpath.G.3.2 Trying the SampleCommandHandler ClassStart by importing the Room Number sample configuration for the driver.Compile the SampleCommandHandler class and place the resulting class file in a .jar file. Place the.jar file in the DirXML .jar file directory appropriate to the platform on which you are running thedriver.Add the following XML element under the element found in the DriverParameters XML section of the driver properties:Edit the Driver Parameters. In the item labeled Sample Output Path, place a path to a directory inwhich the SampleCommandHandler will write its created documents. In the item labeled AdditionalHandlers, add the stringcom.novell.nds.dirxml.driver.manualtask.samples.SampleCommandHandler.Replace the Subscriber channel command transformation policy with CommandXform.xsl which isfound in the same directory as the SampleCommandHandler.java file.Create a User object and add a manager reference to the User object. If the manager has an e-mailaddress value, then a command element is sent to the Subscriber and theSampleCommandHandler writes a file in the location you specified above.