24

OFC335 Microsoft Office Word 2007 XML Programmability: True Data/View Separation and Rich Eventing for Custom XML Tristan Davis Program Manager Microsoft

Embed Size (px)

Citation preview

OFC335OFC335Microsoft Office Word Microsoft Office Word 2007 XML 2007 XML Programmability: Programmability: True Data/View True Data/View Separation and Rich Separation and Rich Eventing for Custom Eventing for Custom XMLXML

OFC335OFC335Microsoft Office Word Microsoft Office Word 2007 XML 2007 XML Programmability: Programmability: True Data/View True Data/View Separation and Rich Separation and Rich Eventing for Custom Eventing for Custom XMLXMLTristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft CorporationMicrosoft Corporation

AgendaAgenda

The world today (Microsoft Office Word The world today (Microsoft Office Word 2003)2003)

Structural IntegrityStructural IntegrityContent ControlsContent Controls

Data/View SeparationData/View SeparationMicrosoft Office XML data storeMicrosoft Office XML data store

XML mappingXML mapping

ConclusionConclusion

QuestionsQuestions

The World TodayThe World Today

Word 2003 was a major step forward:Word 2003 was a major step forward:XML-based file format (WordprocessingML)XML-based file format (WordprocessingML)

Customer-defined schema supportCustomer-defined schema support

However, a big toolbox doesn’t mean it’s However, a big toolbox doesn’t mean it’s easy to build a houseeasy to build a house

You need XML schema, XSLT, client-side You need XML schema, XSLT, client-side code, etc.code, etc.

The World of Word 2007The World of Word 2007

Make it easier to push/pull customer data Make it easier to push/pull customer data within Word documentswithin Word documents

How?How?Structural integrity (Content Controls)Structural integrity (Content Controls)

Provide content restriction, lockdown capabilityProvide content restriction, lockdown capability

Data/view separation (Office XML data store)Data/view separation (Office XML data store)Place to store custom XML data in the new file formatPlace to store custom XML data in the new file format

Each item is stored as a separate part within the Each item is stored as a separate part within the packagepackage

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

Structuring a DocumentStructuring a DocumentStructuring a DocumentStructuring a Document

Content ControlsContent Controls

Evolution of customer-defined XMLEvolution of customer-defined XMLNo XML schema requiredNo XML schema required

Provide friendly end user exposure of Provide friendly end user exposure of structured contentstructured content

Each provides unique content restrictions / Each provides unique content restrictions / user interface that doesn’t affect layoutuser interface that doesn’t affect layout

Controls can be grouped to lock them Controls can be grouped to lock them down down as a unitas a unit

Controls can be mapped to XML dataControls can be mapped to XML data

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

XML Data Store / XML XML Data Store / XML MappingMappingXML Data Store / XML XML Data Store / XML MappingMapping

Office XML Data StoreOffice XML Data Store

Customer-defined XML (incl. WSS/Office Customer-defined XML (incl. WSS/Office doc props) stored separately from doc props) stored separately from WordprocessingML as a part in Open XML WordprocessingML as a part in Open XML formatformat

Any XML can be stored Any XML can be stored (with or without XML schema)(with or without XML schema)

XML data is available as an editable tree XML data is available as an editable tree (using familiar DOM) within Word(using familiar DOM) within Word

Can be populated on a server using WinFX Can be populated on a server using WinFX or a client using Word OMor a client using Word OM

XML MappingXML Mapping

Link document controls to nodes in the Link document controls to nodes in the XML data storeXML data store

Provides for true data/view separation Provides for true data/view separation model in Wordmodel in Word

Mappings are created using standard Mappings are created using standard XPath expressionsXPath expressions

Mappings can be set up to ‘auto-attach’ Mappings can be set up to ‘auto-attach’ to incoming datato incoming data

Out-of-the-box support for mapping to Out-of-the-box support for mapping to Office propertiesOffice properties

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

Mapping WSS Data Into Mapping WSS Data Into WordWordMapping WSS Data Into Mapping WSS Data Into WordWord

Mapping WSS Data into WordMapping WSS Data into Word

Word 2007 has native integration Word 2007 has native integration between the WSS property set and the between the WSS property set and the XML mapping architecture:XML mapping architecture:

WSS properties are stored as items in the Office WSS properties are stored as items in the Office

XML data storeXML data store

Properties can be mapped to content controls in Properties can be mapped to content controls in

the documentthe document

WSS docs automatically get UI on the ribbon to WSS docs automatically get UI on the ribbon to do this mappingdo this mapping

InfoPath property panel is synchronized with InfoPath property panel is synchronized with the the data storedata store

Client Side ProgrammingClient Side Programming

Recommended approach: program directly Recommended approach: program directly against the dataagainst the data

InfoPath or Office OM – your choiceInfoPath or Office OM – your choice

Word will automatically take care of the effects Word will automatically take care of the effects on the presentation via the XML mappingson the presentation via the XML mappings

Use shared error board to communicate Use shared error board to communicate validation errors to the uservalidation errors to the user

Use controls OM if you need behavior for Use controls OM if you need behavior for specific controls (e.g. to block user from specific controls (e.g. to block user from exiting)exiting)

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

Using InfoPath for Client-Using InfoPath for Client-Side Business LogicSide Business LogicUsing InfoPath for Client-Using InfoPath for Client-Side Business LogicSide Business Logic

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

Using Office OM for Client-Using Office OM for Client-Side Business LogicSide Business LogicUsing Office OM for Client-Using Office OM for Client-Side Business LogicSide Business Logic

Server Side ProgrammingServer Side Programming

Recommended approach: Recommended approach: Using WinFX to navigate the file formatUsing WinFX to navigate the file format

Adding a part is as simple as adding a Adding a part is as simple as adding a single relationshipsingle relationship

Finding an existing part is done by namespace Finding an existing part is done by namespace or GUID matchingor GUID matching

Tristan DavisTristan DavisProgram ManagerProgram ManagerMicrosoft WordMicrosoft Word

Using Custom XML Data on Using Custom XML Data on the Serverthe ServerUsing Custom XML Data on Using Custom XML Data on the Serverthe Server

Related Areas In VSTO V3Related Areas In VSTO V3

Document control support in the Microsoft Document control support in the Microsoft Visual Studio designerVisual Studio designer

Integration with .NET data bindingIntegration with .NET data binding

.NET programming model for the XML data .NET programming model for the XML data store for document manipulation on store for document manipulation on client/serverclient/server

Leveraging the XML data store / new file Leveraging the XML data store / new file format for VSTO solution storageformat for VSTO solution storage

ConclusionConclusion

Two main themes to Word 2007 for Two main themes to Word 2007 for solution creationsolution creation

Make structured document more robust by Make structured document more robust by providing controls and content groupsproviding controls and content groups

Provide true data/view separation by providing Provide true data/view separation by providing custom XML data storecustom XML data store

Result: you have to write less code and Result: you have to write less code and your solutions are more reliable with Word your solutions are more reliable with Word as the editing environmentas the editing environment

Key TakeawaysKey Takeaways

Word 2007 allows for more granular Word 2007 allows for more granular control control over structured data via content controlsover structured data via content controls

Specialized UI, Content restrictions, locking, Specialized UI, Content restrictions, locking, etc.etc.

Word 2007 allows for separation of data Word 2007 allows for separation of data and presentation via the Office XML data and presentation via the Office XML data storestore

Word 2007 allows for automatic two-way Word 2007 allows for automatic two-way synchronization between data and view via synchronization between data and view via

XML mappingXML mapping

ResourcesResourcesTechnical Chats and Webcastshttp://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asp

Microsoft Learning and Certificationhttp://www.microsoft.com/learning/default.mspx

MSDN & TechNet http://microsoft.com/msdnhttp://microsoft.com/technet

Virtual Labshttp://www.microsoft.com/technet/traincert/virtuallab/rms.mspx

Newsgroupshttp://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx

Technical Community Siteshttp://www.microsoft.com/communities/default.mspx

User Groupshttp://www.microsoft.com/communities/usergroups/default.mspx

The 2007 Microsoft Office The 2007 Microsoft Office System System Clients. Servers. Clients. Servers. Solutions.Solutions.

Install Beta 2 today! Install Beta 2 today! It’s in your attendee bagIt’s in your attendee bag

Learn more at the Office System TLCLearn more at the Office System TLCDemo Stations / Hands-on-Labs / Chalk-talksDemo Stations / Hands-on-Labs / Chalk-talks

Get more informationGet more informationhttp://www.microsoft.com/office/preview/default.mspxhttp://msdn.microsoft.com/office/

TalkTalk

LabLab

DemoDemo

Fill out a session Fill out a session evaluation on evaluation on

CommNet andCommNet and Win an XBOX Win an XBOX

360!360!

© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.