Once the code is complete, all of the components must be prepared and made ready for delivery. The manifest file is an XML instance that identifies each of the components associated with the Smart Document expansion pack. It is the equivalent of a packing list, identifying each of the components necessary to make the Smart Document solution run and where they can be found. It is attached to a Word document or template through the Templates and Add-Ins menu or through a processing instruction incorporated into the document instance itself: <?mso-solutionextension URI="namespace" manifestPath="path"> If any components cannot be located, an error message will be returned to the end user. One of the novel uses of the manifest file is to track versions. The most common Smart Document deployment scenario involves placing the files on a server where each end user will access them. Once the update frequency value has been reached, the application will check for a more recent version on the server (as indicated by the version number in the manifest file). While a schema for the manifest file has been published and can be found in the Microsoft Office 2003 Smart Document SDK, it does not appear that it is actually used for validation, as the samples provided in the SDK do not conform to it. There are several key components to a manifest file, as follows:
For a managed solution, a unique Solution ID must be generated. A utility to generate unique identifiers, guidgen.exe, shown in action in Figure 5-17, is included with Visual Studio .NET and can be found at C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\guidgen.exe. When the expansion pack is attached, the .dll is entered into the registry with the specified key. Figure 5-17. Create GUID user interface
Here is a sample manifest.xml file: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <manifest xmlns="http://schemas.microsoft.com/office/xmlexpansionpacks/2003"> <version>1.0</version> <updateFrequency>20160</updateFrequency> <uri>http://www.office-xml.com/ns/sdarticle</uri> <solution> <solutionID>{1E15F399-9BFF-4ac9-A68A-737788C1B462}</solutionID> <type>smartDocument</type> <alias lc>Essentials Article Solution</alias> <documentSpecific>false</documentSpecific> <targetApplication>Word.Application.11</targetApplication> <file> <runFromServer/> <type>solutionActionHandler</type> <managed/> <version>1.0</version> <filePath>SDEssentials.dll</filePath> <CLSNAME>SDEssentials.ArticleSmartDocument</CLSNAME> </file> <file> <runFromServer/> <type>other</type> <version>1.0</version> <filePath>help/article.htm</filePath> </file> <file> <runFromServer/> <type>other</type> <version>1.0</version> <filePath>help/para.htm</filePath> </file> <file> <runFromServer/> <type>other</type> <version>1.0</version> <filePath>help/code.htm</filePath> </file> <file> <runFromServer/> <type>other</type> <version>1.0</version> <filePath>images/cover.jpg</filePath> </file> </solution> <solution> <solutionID>schema</solutionID> <type>schema</type> <alias lc>SDArticle</alias> <file> <type>schema</type> <version>1.0</version> <filePath>SDArticle.xsd</filePath> </file> </solution> </manifest> |