search desktop web channel mobile channel same content same page urls same site collection different...

Post on 05-Jan-2016

226 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Building Adaptive Companion Apps for Devices using SharePoint 2013Manfred Berry Rune Zakariassen Senior Dev Lead Program Manager

SPC225

When You Leave you should be able to ……understand SharePoint search REST APIs

…develop adaptive companion apps

…reuse content and navigation across channels and devices

…utilize promotions and recommendations in device apps

Demo1 – Contoso ElectronicsWeb Storefront and the companion app

Search

INTERNAL ITEM CATALOGSITE COLLECTION

Electronics

DESKTOP WEB CHANNEL MOBILE CHANNEL

Same ContentSame Page URLs

Same Site CollectionDifferent layouts and templates

WEB BROWSER

REST API

NATIVE APP

Adaptive experiences allow for surfacing and adapting content for presentation through multiple channels and devices

CAMPAIGNPROMOTION

Content ReuseManaged Navigation ReuseNo additional infrastructure

We will focus here

SharePoint 2013

SharePoint 2013 Remoting API

CSOM

http://<spsite>/_api

JavaScriptLibrary

SilverlightLibrary

.NET CLRLibraryREST

ODataJSON

Custom Client Code

Server

Client

Search REST API is protected by defaultOpt-in to allow anonymous accessThe queryparametertemplate.xml file:• Anonymous access whitelist• Search parameters• Default values

• Place in Document Library ‘QueryPropertiesTemplate’

• Configure to match current site:• FarmId, SiteId, WebId

http://server/site/_api/search/query?querytext='{queryterms}'&

querytemplatepropertiesurl='spfile://webroot/queryparametertemplate.xml'

Demo2 – The REST API

Sample the REST API

The Windows 8/RT App

WinRTSearchClient

SharePoint

API

SearchService

CatalogDataSource

Xaml/Code behind

CatalogDataStructure

Local Cache

Contoso Electronics Native App

Soon available as code sample

Todays session samples

What are we gonna do

Integrate with SharePoint Navigation

Product Category Search

Analytics Search

Usage Events

Editorial Control

Navigation _api/navigation/menustate?mapprovidername=‘GlobalNavigationSwitchableProvider’

Man

aged

Nav

igat

ion

Managed Navigation

Demo3 - Device App NavigationFirst thing to fetch is Taxonomy (from TermStore via Navigation REST API). Top level navigation tree.

<?xml version="1.0" encoding="utf-8" ?><d:MenuState xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="SP.MenuState"> <d:FriendlyUrlPrefix>/sites/RetailPublishingPortal/</d:FriendlyUrlPrefix> <d:Nodes> <d:element m:type="SP.MenuNode"> <d:CustomProperties> <d:element m:type="SP.KeyValue">

<d:Key>Nav_Image</d:Key> <d:Value>http://………/Products/Audio.png?width=100</d:Value> <d:ValueType>Edm.String</d:ValueType> </d:element> <d:element m:type="SP.KeyValue">

<d:Key>_Sys_Facet_FullRefinementString</d:Key> <d:Value>RetPrice(…),RetBrand(…)</d:Value> <d:ValueType>Edm.String</d:ValueType> </d:element> </d:CustomProperties> <d:FriendlyUrlSegment>audio</d:FriendlyUrlSegment> <d:IsHidden m:type="Edm.Boolean">false</d:IsHidden> <d:Key>7359fa14-0054-409a-816c-22957cc49719</d:Key>

Image Rendition:Tue 10:30pm - SPC019 - Best Practices for Designing Websites with SharePoint 2013Speakers: Ethan Gur-esh and Alyssa Levitz

Navigation Properties (Images & Contextual Refiners)

_api/navigation/menustate?mapprovidername=‘GlobalNavigationSwitchableProvider’

&CustomProperties=‘Nav_Image,_Sys_Facet_FullRefinementString’Include Contextual Refinement String

Demo4 – Custom Properties

Managed Navigation Image Urls

What are we gonna do

Integrate with SharePoint Navigation

Product Category Search

Analytics Search

Usage Events

Editorial Control

User navigates – Connect navigation and search

Indexed ItemProductCatalogItemCategory:TermGuid

Node State Response<d:Nodes> <d:element m:type="SP.MenuNode"> <d:FriendlyUrlSegment>laptops</d:FriendlyUrlSegment> … <d:Key>TermGuid</d:Key></d:Nodes>

Executing RESTful searches

Basic queryhttp://server/site/_api/search/query?querytext='{KQL Query}'

Get all products in a categoryhttp://server/site/_api/search/query?querytext='ProductCatalogItemCategory:#GUID'&

Selecting managed propertieshttp://server/site/_api/search/query?...&selectproperties='Title,Rank, …'

Retrieving refinershttp://server/site/_api/search/query?...&refiners='RetPrice,RetColor, …'

Managed property Category GUID

Demo5 - Search Queries

Fetching Content and Contextual Refiners

What are we gonna do

Integrate with SharePoint Navigation

Product Category Search

Analytics Search

Usage Events

Editorial Control

Recommendations

Built-in recommendationsEvent stream analysisItem-to-item recommendationsStored in “recommendedfor:” managed propertyUp to 12 configurable, weighted, events

Tue 3:15pm - SPC076 - Deliver Adaptive and Personalized Experiences with SharePoint 2013 - Speakers: Krister Mikalsen, Dag Eidesen

Recommendation Queries

Item-to-item recommendationshttp://server/site/_api/search/query?querytext='Recommendedfor:ItemId'&selectproperties='Title,Rank,etc.'...

Most popular (based on events)http://server/site/_api/search/query?querytext='contenttype:CatalogContentType'&

sortlist='ViewsRecent:descending'&………

Demo6 - RecommendationsItem RecommendationsRecommendedfor: attribute in query text

What are we gonna do

Integrate with SharePoint Navigation

Product Category Search

Analytics Search

Usage Events

Editorial Control

Posting Usage Events

Log eventPOST http://server/site/_api/events/logevent

{

"usageEntry": {

"__metadata": {"type": "Microsoft.SharePoint.Administration.UsageEntry"},

"EventTypeId": 1,

"ItemId": "an itemId",

"Site": "61141c0e-4196-8123-e54eee5f4787",

"User": "johndoe"

}

}

Demo7 – Event Logging

How the search service learns and adapts

What are we gonna do

Integrate with SharePoint Navigation

Product Category Search

Analytics Search

Usage Events

Editorial Control

Search

INTERNAL ITEM CATALOGSITE COLLECTION

Electronics

DESKTOP WEB CHANNEL MOBILE CHANNEL

Same ContentSame Page URLs

Same Site CollectionDifferent layouts and templates

WEB BROWSER

REST API

NATIVE APP

Adaptive experiences allow for surfacing and adapting content for presentation through multiple channels and devices

CAMPAIGNPROMOTION

Content ReuseManaged Navigation ReuseNo additional infrastructure

Demo8 – Editorial ControlDisplaying Promotions

Tips and Tricks

Optimize REST payloadsUse JSON payload, it is 10% smaller than XML• Accept: application/json;odata=verbose

Request only the managed properties you need in your app• use bypassresulttypes=true• and selectproperties=‘title, author, ...’

Use compression (gzip or deflate)• Accept-Encoding: gzip,deflate

Optimize for fluid UXCache navigation and query results locally• Protects you of network glitches and latencies

Use asynchronous patterns in your App client• More responsive and snappy UI behaviour• Allows background REST requests to services

Demo9 – SearchPad sampleExploring the Search REST API with SearchPad

Recap……SharePoint search REST APIs

…companion apps

…reuse content and navigation

…editorial control, promotions and recommendations

Search HOLs and events @ SPCHOL040 – Building a Product Centric Site in SharePoint 2013HOL031 – Introduction to Search in SharePoint 2013HOL034 – Exploring Search Query Rules in SharePoint 2013HOL014 – Building Windows 8 Apps with SharePoint 2013

Meet a Search and Website SME

Ask questions, meet the community and share knowledge!

Mon-Thu @ Exhibit Hall

Hands on Labs

Daily 10:30am-6:30pm @ HOL Lab Lounge

Ask the Experts

Discuss Search!Discuss Websites!

Wed 6:15PM @ Ask the Experts Lounge

Related Search Sessions @ SPCTue 1:45pm - SPC180Overview of Search Driven Web Sites and Cross Site Publishing in DepthSpeaker: Daniel Kogan

Tue 3:15pm - SPC076Deliver Adaptive and Personalized Experiences with SharePoint 2013Speakers: Krister Mikalsen, Dag Eidesen

Tue 1:45pm - SPC242 - Understanding OAuth, REST and OData Speaker: Ted Pattison

Wed 9:00am - SPC110Grow your Business Online with SharePoint's Adaptive ExperiencesSpeakers: Fredrik Holm, Stefan Debald

Tue 3:15pm - SPC230Step by Step: Building Search Driven Applications with SharePoint 2013Speaker: Scot Hillier

Evaluate this session now on MySPC using your laptop or mobile device: http://myspc.sharepointconference.com

MySPC

Questions?

© 2012 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.

top related