2. About me Alexander Meijers Solution Architect / SharePoint Consultant Over 16 years of IT experience Small to large SharePoint projects SharePoint Geek and Speaker Blog: http://www.bloggix.com Twitter: @ameijers Email: alexander@bloggix.com 6/27/2010 Visio Services 2
3. Agenda What is Visio Services Visio and your business Visio Graphics Service Visio Web Access Web Part Use a Data Provider Visio Diagram and Scripting Custom Data Provider Lots of demo’s !!! 6/27/2010 Visio Services 3
4. What is Visio Services Visio Services enables your SharePoint 2010 environment to display and inter-act with Microsoft Visio documents Connection between Microsoft Visio and SharePoint 2010 A service in SharePoint 2010 Viewing Visio Diagrams without the need for Microsoft Visio installed 6/27/2010 Visio Services 4
5. Visio and your business By combining visual representation and data together as one creates great insights for business owners within any part of the organization Enrich your business information Impact on how data is monitored in your organization Known products to business owners Microsoft Visio 2010 SharePoint 2010 Working collaborative in a visual matter 6/27/2010 Visio Services 5
6. Visio Graphics ServiceInsight SharePoint 2010 Enterprise edition is needed to use Visio Services Features SharePoint Server Enterprise for site collection and site Attached to a Web Application using a Service Application and Service Application Proxy Tenant data Tenant data is not stored The service can be shared in a multi-tenant environment without partitioned 6/27/2010 Visio Services 6
7. Visio Graphics ServiceSettings Global settings Settings for performance and security Maximum Web drawing size Caching Recalculation duration Handling external data (Unattended Service Account) Trusted data providers SQLOLEDB SQL Server Oracle, IBM Excel Services WSS Custom Data Providers 6/27/2010 Visio Services 7
8. Visio Web Access Web Part Web Part available under “Business Data” Based on Silverlight Connect to a Visio Drawing Settings Caching Rendering Overriding e.g. current page, pan, zoom Automatic refresh interval Expose Shape date items to other Web Parts using Web Part connections 6/27/2010 Visio Services 8
9. Visio Web Access Web PartData caching Configuration Service Application configuration under “Global Settings” Visio Web Access Web Part Automatic refresh interval of the Web Part will not override the cache settings in the Service Application 6/27/2010 Visio Services 9
10. DemoData Provider Case “SharePoint data in a Visio Diagram” Create a Visio Diagram Create a SharePoint list with data Use the “Microsoft SharePoint Foundation List” adapter Connect items to Visio Shapes Save the Visio Diagram as a Visio Drawing in a document library Build a page containing Visio Web Access Web Part and view on SharePoint list 6/27/2010 Visio Services 10
12. Visio Diagram & Scripting ECMAScript Object Model Classes Page ShapeCollection Shape Attach to load event of Sys.Application class Get the Id of the Visio Drawing Web Part Look for the phrase class=“VisioWebAccess” and “WebPartWPQ#” Asynchronous operation Do NOT use the opendiagram handler Example code: 6/27/2010 Visio Services 12 varvwaControl = new Vwa.VwaControl(“WebPartWPQ#); vwaControl.addHandler(“diagramcomplete”, onDiagramComplete);
13. Visio Diagram & ScriptingVisio Shape events The following Visio Shape events diagramcomplete diagramerror shapemouseleave shapemouseenter shapeselectionchanged Example code 6/27/2010 Visio Services 13 vwaControl.addHandler(“shapemouseenter”, onShapeMouseEnter); function OnShapeMouseEnter(source, args) { try { vwaShapes.getItemById(args).addHighligh(2, “#FF0000”); } catch(err) { }}
14. DemoInter-action (no-coding) Case “Inter-act with Visio Diagram” Create a Visio Diagram Generate a ECMAScript (*.js) file <script type=“text/javascript”> … </script> Handlers diagramcomplete, shapemouseleave and shapemouseenter Upload the Visio Diagram and script file into a document library Build a page containing Visio Web Access Web Part and Content Editor Part Reference both files from the Web Parts 6/27/2010 Visio Services 14
16. Custom Data Provider Presenting data in a Visio Diagram from a specific data source Visio Diagrams can only read data from the data source. Not possible to write back to data source. Development skills needed VBA coding in Microsoft Visio C#/VB.NET coding in VS2010 for SharePoint 2010 6/27/2010 Visio Services 16
17. Custom Data ProviderVisio Service API Microsoft.Visio.Server.dll Found only in GAC through [drive]:indowsssemblyAC_MSILicrosoft.Office.Visio.Server14.0.0.0__71e9bce111e9429c Two classes Microsoft.Office.Visio.Server.AddonDataHandler (abstract) Microsoft.Office.Visio.Server.AddonDataHandlerException Data provider is asynchronous Use the IAsyncResultinterface The actual DataSetis generated inside a separate thread Important methods BeginGetData EndGetData 6/27/2010 Visio Services 17
18. Custom Data ProviderInstall the Data Provider Use PowerShell script Install Add-SPSolution <disk>ustomDataProvider.wsp Install-SPSolution <disk>ustomDataProvider.wsp –GACDeployment Uninstall Get-SPSolutionCustomDataProvder.wsp | Uninstall-SPSolution Remove-SPSolutionCustomDataProvider.wsp Make it trusted by adding it to the Trusted Data Providers inside the Service Application configuration Use <Namespace.ClassName, AssemblyName, Version=version, Culture=culture, PublicKeyToken=token> as provider Id 6/27/2010 Visio Services 18
19. Custom Data ProviderConsume from the Data Provider Use VBA code in Microsoft Visio Add a DataRecordset to the DataRecordsets collection of the Visio Diagram Important DataRecordsets members Add (OLEDB or ODBC) AddFromConnectionFile (Office Data Connections) AddFromXML (XML string) 6/27/2010 Visio Services 19
21. Wrap up! Visio Services allows you to create rich data driven dashboards Better insights for business owners Combine with SharePoint lists, Excel Services, SQL databases and other data sources Out-of-the-box inter-active solutions possible Extending the boundaries with Custom Data Providers. 6/27/2010 Visio Services 21