1 / 45

Построение Windows 8 приложений для доступа к SharePoint 2013

Построение Windows 8 приложений для доступа к SharePoint 2013. Бельский Сергей. Agenda. Getting started with Windows 8 Apps Which SharePoint APIs are suitable? Binding SharePoint data Searching SharePoint Notification. What is a Window 8 app ?. Touch First.

gazit
Download Presentation

Построение Windows 8 приложений для доступа к SharePoint 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Построение Windows 8приложений для доступа к SharePoint 2013 Бельский Сергей

  2. Agenda • Getting started with Windows 8Apps • Which SharePoint APIs are suitable? • Binding SharePoint data • Searching SharePoint • Notification

  3. What is a Window 8 app?

  4. Touch First • No chrome – full screen experience • Designed for Touch and Pen input

  5. What is a Windows 8 app? • Full screen window with multiple views • Supports touch and works great without • Runs on a variety of devices • Sandboxed • Uses tiles instead of icons • Can be distribute via Windows Store

  6. Why Windows 8 App and SharePoint? • Great way to visualize data • Business Intelligence • Charts / Graphs • Reports • Brings SharePoint to the Desktop • Executives love “touch” • Great app opportunity • Easy to develop

  7. Getting Started

  8. Getting Started - Environment • At least two machines required • Server running SharePoint 2013 • SQL, Active Directory, Workflow, WAC optionally on other servers • Client running Windows 8 • Pro or Enterprise works best • Ideally both machines are on the same domain

  9. Getting Started - Server • Windows Server running SharePoint 2013 • Visual Studio not required • More memory is ideal

  10. Getting Started - Client • Client running Windows 8 • Pro or Enterprise ideal • Connected to same domain • Visual Studio 2012 RTM • 2 GB – 4 GB of memory • Internet connection required

  11. Which Language? • HTML5 + JavaScript • XAML with C#, Visual Basic, or C++ code-behind • DirectX with native C++ and HLSL

  12. DEMO Simple App. Simulator

  13. SharePoint Integration Points • Authorization • Data binding • Contracts • Search • Live Tiles • Notification

  14. Authorization

  15. Authorization

  16. DEMO Authorization to the office 365

  17. Data binding

  18. Data binding steps • Retrieve data from SharePoint • Bind data to default view model • Customize template

  19. SharePoint 2013 APIs • RSS • Client Script Object Model • Web Services • REST

  20. What’s covered in the new CSOM/REST APIs? Search Social Taxonomy Workflow Analytics Sharing Publishing eDiscovery IRM BCS And much, much more!

  21. Why is REST the best choice? • Simple and Easy to Use • Much easier to use than SOAP-based Web service • Higher productivity when using JavaScript and jQuery • Results can be returned in JSON and ATOM format • Test in a browser

  22. ODATA URIs • URI has three significant parts • Service root URI • Resource path • Query string options (select, filter)

  23. REST URLs in SharePoint 2013 _api is new alias for _vti_bin/client.svc Server Client CSOM REST OData JSON JavaScript Library Silverlight Library .Net CLR Library Custom Client Code

  24. Mapping Objects to Resources • Example REST URLs targeting SharePoint sites _api/web/lists _api/web/lists/getByTitle('Announcements') _api/web/lists/getByTitle('Announcements')/$select=title,body,expirationdate

  25. Response XML

  26. ATOM XML or JSON? • Response data format selected with ACCEPT header • XML can be easier to deal with from managed code • To get ATOM XML response use "application/atom+xml" • JSON is easier to deal with when using JavaScript • To get JSON response use "application/json"

  27. REST Queries from Windows 8 Apps • Use HttpClientobject to GET SharePoint data • Use HttpClientHandler object for authentication • Add headers to request data in ATOM XML format • Parse data with LINQ to XML

  28. Data Templates • Bind data to SharePoint fields • Change look and feel of results • Can be defined in: • Page.Resources • StandardStyles.xaml <DataTemplate x:Key="Standard250x250ItemTemplate">     <Grid HorizontalAlignment="Left" Width="250" Height="250">         <Border Background="{StaticResourceListViewItemPlaceholderBackgroundThemeBrush}">             <Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>         </Border>         <StackPanelVerticalAlignment="Bottom" Background="{StaticResourceListViewItemOverlayBackgroundThemeBrush}"> …

  29. Package.appmanifest • Specify information about your app • i.e.: Name, logo, supported orientations, splash screen • Declares capabilities your app requires • SharePoint typically requires: • Enterprise Authentication (not for office 365) • Internet (Client) • Private Networks (Client & Server) (not for office 365)

  30. DEMO Data binding a document library using REST + JSON

  31. App Contracts

  32. What is App Contract? • An agreement between one or more apps • Built with special Visual Studio project items File Picker Play To Search Share Settings

  33. Search Contract • Great for SharePoint • Add SharePoint Search to the Charms menu • Touch friendly interface • App automatically launched if not open • Can be activated on keyboard input

  34. Creating a Search Contract • Use Search Contract Project Item • Query search via REST • Format XML into expected format • Bind results to this.DefaultViewModel[“Results”]

  35. Searching SharePoint • Search Web Service deprecated • REST API preferred query method • Search REST URL

  36. DEMO Searching SharePoint documents from Windows 8 App

  37. Tiles and Notification

  38. Tiles • Combination of text and images • Defined by XML • 34 Templates Available • Can be updated by app

  39. Tiles come in all shapes and sizes

  40. Tile XML <tile> <visual> <binding template="TileSquareBlock"> <text id="1">Text Field 1</text> <text id="2">Text Field 2</text> </binding> </visual> </tile> <tile> <visual> <binding template="TileWideImageAndText01"> <image id="1" src="image1.png" alt="alt text"/> <text id="1">Text Field 1</text> </binding> </visual> </tile>

  41. Apps can notify users with • Tiles • Badges • Toast • Lock Screen

  42. Types of notification • Periodic • Polling – occurs at regular intervals until stopped • Scheduled – occurs at a scheduled time • Push

  43. Strategy for updating Tiles with SharePoint • No client side code executed when polling Tile XML • Avoid custom code in SharePoint • Solution: Custom RSS

  44. DEMO Notification

  45. Resources Windows 8 Apps + new Office 365 (SharePoint Online) http://blogs.msdn.com/b/omarv/archive/2012/10/25/windows-8-store-apps-office-365-enterprise-preview-sharepoint-online.aspx My technical blog http://blogs.msdn.com/b/sergey_belskiy_technical_blog/ Programming using the SharePoint 2013 REST service http://msdn.microsoft.com/en-us/library/fp142385.aspx

More Related