390 likes | 523 Views
Microsoft Office System UK Developers Conference. Radisson Edwardian, Heathrow 29 th & 30 th June 2005. Web Part Connections. Nigel Bridport Principal Consultant Microsoft Corporation. Agenda. Introduction to Web Part Connections Problems and Solutions Connection Framework Scenarios
E N D
Microsoft Office SystemUK Developers Conference Radisson Edwardian, Heathrow 29th & 30th June 2005
Web Part Connections Nigel Bridport Principal Consultant Microsoft Corporation
Agenda • Introduction to Web Part Connections • Problems and Solutions • Connection Framework • Scenarios • Creating and Developing Web Part Connections • Supported Interfaces • Interface Details • Compatibility and Transformers • Cross Page Connections • Compatibility Rules • Out-of-the-Box Microsoft Web Part Connectability
Problems And Solutions • Hardwired solutions • Parts need intimate knowledge of each other • Parameterized Hyperlinks • Lack of flexibility • Developer driven • SharePoint ships powerful parts
Connections Framework • Allows Web Parts to send and received basic types of data • Cell, Row, List, etc • Uses standardized set of interfaces • Allows completely independent parts to connect • Enables end users to form connections • Browser • FrontPage 2003
Scenarios • Master/Detail • Parent/Child • Data Entry and Filter • Calculations • Alternate Views • Data Enhancement • Connecting to Out of the Box Web Parts
Supported Interfaces • ICellProvider, ICellConsumer • IRowProvider, IRowConsumer • IListProvider, IListConsumer • IFilterProvider, IFilterConsumer • IParametersOutProvider, IParametersOutConsumer • IParametersInProvider, IParametersInConsumer
Code Flow • EnsureInterfaces() • RegisterInterface() • CreateInterfaceGroup() • AddInterface() • CanRunAt() • PartCommunicationConnect() • PartCommunicationInit() • Fire Init Events; e.g., CellProviderInit() • PartCommunicationMain() • Fire Remaining Events; e.g., CellReady() • GetInitEventArgs()* *Only needed for interfaces that require transformers.
The Cell Conversation • P: Hello Consumer • C: Hello Provider • P: Here is what I want to talk about. • C: Oh? Well; Here is what I want to talk about • P: Ok, now here is the data you were looking for • C: Thanks!
Methods you implement Method calls you make Cell Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit CellProviderInit() CellProviderInit PartCommunicationInit CellConsumerInit() CellConsumerInit PartCommunicationMain CellReady() CellReady GetInitEventArgs GetInitEventArgs
The Row Conversation • P: Hello Consumer • C: Hello Provider • P: Here is a list of fields I can give you • C: (ok) • P: Here is the data you were looking for • C: (thanks!)
Methods you implement Method calls you make Row Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit RowProviderInit() RowProviderInit PartCommunicationMain RowReady() RowReady GetInitEventArgs GetInitEventArgs
The List Conversation • P: Hello Consumer • C: Hello Provider • P: Here is a list of fields I can give you • C: (ok) • P: Now here is the data I told you about • C: (thanks!)
Methods you implement Method calls you make List Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit ListProviderInit() ListProviderInit PartCommunicationMain ListReady() ListReady PartialListReady() PartialListReady GetInitEventArgs GetInitEventArgs
The Filter Conversation • P: Hello Consumer • C: Hello Provider • C: Here is a list of things you can filter for me • P: (Will do) • P: Ok, apply this filter • C: (Thanks!)
Methods you implement Method calls you make Filter Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit FilterConsumerInit() FilterConsumerInit PartCommunicationMain SetFilter() SetFilter ClearFilter() ClearFilter NoFilter() NoFilter GetInitEventArgs GetInitEventArgs
The ParametersOut Conversation • P: Hi Consumer • C: Hi Provider • P: Here is the set of parameters I’m giving you • C: (ok…) • P: Ok, here are the parameters • C: (thanks!)
ParametersOut Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit ParametersOutProviderInit ParametersOutProviderInit() PartCommunicationMain NoParametersOut NoParametersOut ParametersOutReady ParametersOutReady() GetInitEventArgs GetInitEventArgs
The ParametersIn Conversation • P: Hello Consumer • C: Hello Provider • C: Here is the set of parameters I want from you; Some of them are optional • P: (Ok, I’ll get on it!) • P: Here are the parameters • C: (Thanks!)
ParametersIn Connection Flow Provider Consumer EnsureInterfaces EnsureInterfaces CanRunAt CanRunAt PartCommunicationConnect PartCommunicationConnect PartCommunicationInit ParametersInConsumerInit() ParametersInConsumerInit PartCommunicationMain ParametersInReady() ParametersInReady NoParametersIn NoParametersIn GetInitEventArgs GetInitEventArgs
Compatibility Transformers *Not supported for cross page connections.
Compatibility Interface Groups Web Parts
CompatibilityRules Overview • Reciprocal pairs or transformer exist • All required interfaces in a group have match • GroupMaxConnections not exceeded • GroupRunAt matches • Connect over only one interface group • No circular connections • (More rules in the SDK)
Cross-Page ConnectionsFeatures • Allow connecting parts on different pages • Can only be created in FrontPage • Certain interfaces supported Page 1 (Source) Page 2 (Target)
Cross-Page ConnectionsSupported Interfaces These are the supported cross-page connections. In some cases, a transformer is used
Out-Of-The-Box Parts ListViewWebPart IListProvider IFilterConsumer IRowProvider DataViewWebPart ICellConsumer IFilterConsumer IRowProvider IParametersInConsumer
Out-Of-The-Box Parts ImageWebPart ICellConsumer ListFormWebPart IRowProvider
Office Parts Office DataSheet Office PivotChart Office PivotTable Office PivotView IListConsumer IListProvider IRowProvider IFilterConsumer IParametersOutProvider IParametersOutConsumer
Office Parts Office Spreadsheet IFilterConsumer IRowConsumer IRowProvider IParametersOutProvider IParametersOutConsumer
Summary • Web Part Connections • Connection Interfaces • Transformers • Cross Page Connections • Out of Box Parts
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.