ofc302 building smart document solutions in word & excel martin sawicki lead program manager
TRANSCRIPT
OFC302
Building Smart Document Solutions in Word & Excel
Martin SawickiLead Program Manager
Agenda
Demo: Smart Document in Action
What are Smart Documents?
Demo: XML Document Preparation
Demo: Deployment Manifest
Demo: Business Logic Code
Smart Document Security
Useful hints and troubleshooting
Goal: Learn how to make XML-powered Goal: Learn how to make XML-powered Smart Document solutions in Office 2003Smart Document solutions in Office 2003
Smart Document Smart Document in Actionin Action
Martin Sawicki
Lead Program Manager
Authoring & Collaboration Svcs.
demodemo
What are Smart Documents?
The doc knows how to download the appropriate solution on-demandThe doc interacts with the user in a helpful mannerThe doc is aware of the user’s context and provides relevant assistanceThe doc understands the business process it is part of (where to go next)The doc can tell when its contents are not valid
This document is a Smart Document
Smart Document as a Deployment Mechanism
On-demand installation of solutionsNo need for code in the document or templateNo need to install manually on each user’s machine (also: auto update)Associates solution components with individual documents or classes of documents based on XML namespacesCan install schemas, XSLTs, Smart Document Task Pane code, SmartTags, COM-Addins, templates, etc
Smart Document as aSolutions Platform
Hide XML from the user, show user-friendly UI instead
Programmable, interactive, XML context-driven task pane in Word and Excel
COM (VB or C++) or .NET (VB.NET, C#)
Building Key Smart Document Components
DocumentDocumentor or
WorkbookWorkbook
XML SchemaXML Schema
XML Document XML Document PreparationPreparation
Martin Sawicki
Lead Program Manager
Authoring & Collaboration Svcs.
demodemo
“XML-ized” Document
To get started, you need:Customer defined XML Schema (XSD)
Word: Document marked up with XML from schema
Learn more: OFC291, OFC303, OFC308
Excel: Workbook with schema mappingsLearn more: OFC304, OFC305
Building Key Smart Document Components
DocumentDocumentor or
WorkbookWorkbookXML XML
Expansion Expansion Pack Pack
(Manifest)(Manifest)
XML SchemaXML Schema
Deployment ManifestDeployment Manifest
demodemo
Martin SawickiMartin SawickiLead Program ManagerLead Program ManagerAuthoring & Collaboration Svcs.Authoring & Collaboration Svcs.
What is an XML Expansion Pack?(a.k.a. Manifest)
XML file describing components of solution and their locationAllows on-demand solution download and activationNo MSI or other setup packaging neededCentralized solution maintenance
Schema LibraryThe XML Namespace is very important
Schema Library = central registry on user’s computer keeping track of links between XML namespaces and…
XML schemas
XSLT transforms
Smart Doc solutions
XML NamespaceXML Namespace
Schema LibrarySchema Library
Schema files (XSD)Schema files (XSD)
XSLT TransformationsXSLT Transformations
Smart Doc SolutionsSmart Doc Solutions
Smart Documents and the Schema Library
XML Expansion Packs (manifests) are a way to set up the user’s schema library
(…Also, they are a way to write into other places in the registry, e.g. smart tags installation)
Building Key Smart Document Components
DocumentDocumentor or
WorkbookWorkbookXML XML
Expansion Expansion PackPack
(Manifest)(Manifest)
XML SchemaXML Schema
Other FilesOther Files
Compiled Compiled Task Pane Task Pane
LogicLogic
Smart Doc Flow Diagram
User opens documentUser opens document
Manifest-driven components Manifest-driven components download/installation/updatedownload/installation/update
Business logic initialization/Business logic initialization/Task pane descriptionTask pane description
User Interaction Loop/User Interaction Loop/Task pane refreshTask pane refresh
Business Logic CodeBusiness Logic Code
demodemo
Martin SawickiMartin SawickiLead Program ManagerLead Program ManagerAuthoring & Collaboration Svcs.Authoring & Collaboration Svcs.
Business Logic DetailsTask Pane Initialization
1. How many XML types supported by solution?
2. For each XML type:a. Describe it (caption, element name)
b. How many controls?
c. For each control:a. What is it? (Button? Checkbox? Radio group? Doc
fragment thumbnail? Help text? etc)
b. Specify initial contents
Business Logic DetailsTask Pane Refresh
1. Solution code called whenever:User’s XML selection context changes
User clicks control in task pane
2. For each XML type in current context:a. For each control:
a. Modify caption, value, state…
b. Modify contents
Smart Document SecurityXML Expansion Packs (Manifest files)
Policy-controllable settings
Manifest must be signed XML signing tool in Office SDKs
Manifest signature must be trusted
Manifest must be from trusted site
User warned before downloadand use of solution
Smart Document SecurityExecutable code
Downloadable code subject to Office security settings
DLL signing
.Net Assembly security
XSLTs must be signed to run script
Documentation
Smart Document SDKDetailed documentation
Samples
Tutorials
Schemas
Available soon after release of Office 2003
(beta versions available for the betas)
Useful Hints…Syntax of XML type name:
<namespace>#<tagname>
E.g: financial-report#Date
Special XML type names:To display task pane content when outside root element: #actionPertainsToEntireSchema
E.g: financial-schema#actionPertainsToEntireSchema
To display task pane content regardless of XML schema namespace:
http://schemas.microsoft.com/office/smartdocuments/2003#default
… and specify actionHandler as file type in the manifest (not solutionActionHandler)
More Useful Hints…
When installed on user’s machine, smart document associations with XML namespaces are in the registry
[HKCU|HKLM]\Software\Microsoft\SchemaLibrary
The document’s reference to its XML expansion pack is stored in Custom Properties:
Solution ID – id of the solutionSolution URL – location of the manifest
Troubleshooting ManifestsMake sure the file paths in the manifest are correctMake sure the manifest is valid (manifest schema to be available in the SDK)Make sure the manifest is signed and the signature is trustedCheck you smart doc hasn’t been automatically disabled as a result of previous crashing (Word’s self-defense) under:
HKEY_CURRENT_USER\Software\Microsoft\Office\Common\SmartTag\Actions\<Smart Document class name> under Word (OpusApp) and XL (XLMain)
Values: Crash = 2, Enabled = 1, Disabled = 0
If managed, then make sure your managed key is 1 not 0 at
HKEY_CURRENT_USER\Software\Microsoft\Office\Common\SmartTag\Actions\<Smart Document Assembly class name>
Community Resources
Community Resourceshttp://www.microsoft.com/communities/default.mspx
Most Valuable Professional (MVP)http://www.mvp.support.microsoft.com/
NewsgroupsConverse online with Microsoft Newsgroups, including Worldwidehttp://www.microsoft.com/communities/newsgroups/default.mspx
User GroupsMeet and learn with your peershttp://www.microsoft.com/communities/usergroups/default.mspx
evaluationsevaluations
© 2003 Microsoft Corporation. All rights reserved.© 2003 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.