Visio services in sharepoint 2013

69 %
31 %
Information about Visio services in sharepoint 2013
Technology

Published on February 28, 2014

Author: biwug

Source: slideshare.net

Visio Services in Sharepoint 2013 Thomas Browet

What is Visio Services • Visio Services in SharePoint 2013 enables you to load, display, and interact programmatically with Visio files on SharePoint Server 2013 and Microsoft SharePoint Online.

Why Visio Services • Visio diagrams can be rendered by Visio Services and viewed in a Web browser. This lets users view Visio documents without having Visio or the Visio Viewer installed on the local computer. This also allows diagrams to be viewed on mobile devices. • Basic exploration and navigation of these rendered diagrams are supported within the Visio Web Access Web Part. Page designers can configure the user interface and functionality of the Web Part. • Visio Services can also refresh the data and recalculate the visuals of a Visio diagram hosted on a SharePoint site. This enables published diagrams to refresh connections to various data sources (SQL, Excel, ….) and to update affected data graphics and text fields.

Agenda • VISIO JSOM • Creating Visio Shapes with Data Binding • SharePoint, Visio and SVG

Visio JSOM

Visio JSOM • What is it? • A JavaScript based object model for communicating with the Visio Web Access web part • What can you do with it? • • • • • • Read shape data, hyperlinks, comments Select shapes Add highlights and overlays (HTML + HTML5) Respond to mouse events Change the pan and zoom settings Navigate pages and diagrams ( drill down )

VWA Javascript Object Model VWA Control getActivePage() setActivePage() diagramComplete Page getShapes() shapeMouseEnter Shapes shapeMouseLeave selectionChanged getItemById() getItemAtIndex() diagramError Shape Shape getSelectedShape() setSelectedShape() getShapeData() getHyperlinks()

Getting started Web Part Page Document Library

Hooking to add_load() • When the page is loaded you want to call your function that retrieves the instance of the VWA web part • This reference is needed to hook events and access VWA objects within the hosted diagram • Alternate load methods that do not work with VWA • window.attachEvent("onload", vwaOnPageLoad); • window.addEventListener("DOMContentLoaded", vwaOnPageLoad, false); • $(document).ready(vwaOnPageLoad); // jQuery

Get the VWA web part instance • Getting the VWA Instance

Or Find the VWA web part instance via code

Handle the diagramcomplete event • Connecting handlers to events

Handling the selection changed event • Additional Handlers once the diagram has been rendered • removeHandler before adding it again At this point the JSOM is initialized and the specified diagram is rendered in the VWA web part

Handling the selection changed event function onShapeSelectionChanged(source, shapeId) { var vwaPage = vwaControl.getActivePage(); var vwaShapes = vwaPage.getShapes(); var vwaShape = vwaShapes.getItemById(shapeId); var data = vwaShape.getShapeData(); for (var j = 0; j < data.length; j++) { if (data[j].label == "Step") { alert(data[j].value); } } }

Access Shape Data • VWAShape.getShapeData() • returns an array of objects corresponding to shape data items associated with a shape • data[4].label; • data[4].value; // .formattedValue

Managing Highlights • Highlights allow you to outline a shape ( draws a rectangle around the shape bounds) • Shape Methods • addHighlight • http://msdn.microsoft.com/en-us/library/ff394531.aspx • removeHighlight • http://msdn.microsoft.com/en-us/library/ff394510.aspx Pixel width • Note - Only a single highlight rectangle is allowed per shape nextShape.addHighlight(4, "red"); Color, Hex or Name

Managing Overlays • Overlays allow you to define custom highlights/graphics • Shape Methods • addOverlay • http://msdn.microsoft.com/en-us/library/ff394546.aspx • removeOverlay • http://msdn.microsoft.com/en-us/library/ff394409.aspx • Multiple overlays are allowed • Defined using HTML • even HTML5 elements like Canvas!

Handling additional events • Additional VWA events • http://msdn.microsoft.com/en-us/library/ff394574.aspx • Follows model for Excel Web Access ( EWA ) Event VwaControl Methods Description Diagram Complete addHandler() / removeHandler() Triggered when the diagram is loaded, refreshed, or changed Diagram Error addHandler() / removeHandler() Occurs when a request to render the diagram fails Shape Mouse Enter addHandler() / removeHandler() Triggered when the mouse pointer is moved into the bounding box of the shape Shape Mouse Leave addHandler() / removeHandler() Triggered when the mouse pointer is moved out of the bounding box of the shape Shape Selection Changed addHandler() / removeHandler() Occurs when the shape that is currently selected on the page changes

Deployment • Manual • Upload Visio files • Upload JS/HTML files for Content Editor web parts • Or paste source directly into HTML Form web parts • Site Template • Paths may need to be updated for the specified VDW files for the VWA web parts Drawing URL property • WSP • Included as part of a SharePoint solution package • Empty SharePoint Project or a Visual Web Part

Debugging • Debug your scripts using browser developer tools • In browser, press F12 to display the developer tools • Click on the Script tab to access script debugging features • Browse your code, set breakpoints, then reload the page to start debugging on the client

Script logging in IE developer tools • function tryConsole() { if (typeof console != "undefined") { console.log("hello world"); } } • http://blogs.msdn.com/b/cdnwebdevs/archive/2011/05/26/consolelog-say-goodbye-to-javascript-alerts-for-debugging.aspx

In summary… • JavaScript API • Allow developers to build rich dashboard applications using javascript, html, etc. • Incorporate additional functionality using HTML and Silverlight overlays • Events from these overlays can call additional functions • Incorporate VWA API scenarios into other SharePoint development projects • Site Pages • Robust Dashboards • Visual Web Parts • Want to see how the dev team did it • C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15TEMPLATELAYOUTSVisioWebAccessworkflowstatus.js

Demo

Creating Visio Shapes with Data Binding

Enable developer mode in visio

Create a shape from the shape library

Editing with Shapesheet

Binding data value

Changing data value

DataBinding the color of the shape

Playing with the value

Saving the shape • Once finished you can drag and drop your shape to a stencil • So user can use your shape and it’s shape data easily. • You can now easily bind these data value to SQL Server or an Excel File.

SharePoint, Visio and SVG

Why did we use this ? • We had to build : • An interactive map of an hospital campus. With a menu that allows to hide and show buildings or highlight roads. • Problem : VISIO JSOM, can’t dynamically hide Shapes or change it’s data value.

SVG • So we had an idea, why not use SVG. • Visio can export SVG. • Wikipedia says : Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics that has support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999. SVG images and their behaviors are defined in XML text files. This means that they can be searched, indexed, scripted, and, if need be, compressed. As XML files, SVG images can be created and edited with any text editor, but it is often more convenient to create them with drawing programs such as Inkscape. All major modern web browsers—including Mozilla Firefox, Internet Explorer 9and 10, Google Chrome, Opera, and Safari—have at least some degree ofsupport for SVG and can render the markup directly.

Inserting a SVG in SharePoint • Different ways to add a SVG • Object tag in sharepoint are not allowed. • Embed tag, don’t allow us to browse the SVG DOM. • Solution : • Load the SVG through an ajax call.

Demo

Thank You

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Overview of Visio Services in SharePoint Server 2013

Visio Services in SharePoint Server 2013 can render diagrams created in Visio 2010 or Visio 2013. Visio diagrams created in Visio 2010 must be ...
Read more

Planen von Visio Services in SharePoint Server 2013

Inhalt Beschreibung Übersicht über Visio Services in SharePoint Server 2013. Bei Visio Services in SharePoint Server 2013 handelt es sich um ...
Read more

Visio Services in SharePoint 2013 - grobmanschwarz.de

Mit Hilfe von Visio Services können Benutzer Visio Diagramme auf einer SharePoint 2013 Weboberfläche freigeben und anzeigen lassen. Außerdem können ...
Read more

Visio Services in SharePoint 2013 - msdn.microsoft.com

Visio Services in Microsoft SharePoint Server 2013 and in Microsoft SharePoint Online includes several new features, including support for the ...
Read more

Links in Visio Services SharePoint 2013 open in a new tab

SharePoint 2013 - General ... com/Forums/de-DE/9240f286-9e1e-4dea-833a-2e559fa0b468/links-in-visio-services-sharepoint-2013-open-in-a-new-tab?forum ...
Read more

Visio Services and Anonymous access in SharePoint 2013

SharePoint 2013 - Setup, Upgrade ... and Operations http://social.technet.microsoft.com/forums/sharepoint/en-US/d927a561-440c-48f7-b0be-f302b9858d74/visio ...
Read more

Visio Services in SharePoint Server - msdn.microsoft.com

Mit Visio Services in Microsoft SharePoint Server 2010 können Sie Microsoft Visio 2010-Dokumente in SharePoint ... Dezember 2013. Gilt für: SharePoint ...
Read more

Add Visio drawing to SharePoint 2013 - a kalmstrom.com ...

Add a Visio Web Drawing to a SharePoint 2013 Page ... The Visio drawing will show live data in SharePoint. Visio Services can refresh the ...
Read more

Visio 2013 & Visio Services – A Quick Guide – Microsoft ...

... well with the 2013 versions of Visio, SharePoint and... | ... Visio 2013 & Visio Services ... Using Visio Services.
Read more

Download Dienste in SharePoint Server 2013 from Official ...

Diese Illustration enthält Informationen zu den Diensten, die in SharePoint Server 2013 bereitstehen.
Read more