Oh CRUD -- Enhance the Sitecore Item Web API to Fit Your Needs

  • Published on
    14-Feb-2016

  • View
    48

  • Download
    4

Embed Size (px)

DESCRIPTION

Mike Reynolds Product Technical Lead MedTouch. Oh CRUD -- Enhance the Sitecore Item Web API to Fit Your Needs. - PowerPoint PPT Presentation

Transcript

<p>PowerPoint Presentation</p> <p>Oh CRUD -- Enhance the Sitecore Item Web API to Fit Your Needs</p> <p>SharingInspiringConnecting</p> <p>Mike ReynoldsProduct Technical LeadMedTouch</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Sitecore Item Web API</p> <p>- Create, Read, Update and Delete (CRUD) - Defined by HTTP request methods- Create =&gt; POST- Read =&gt; GET- Update =&gt; PUT- Delete =&gt; DELETE (really? :P)SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Sitecore Item Web API</p> <p>- Touch multiple items in scope- Parent =&gt; p- Self =&gt; s- Children =&gt; c- can request all three -- sweet!- Uses JSON in responses by default- Customizable through pipelinesSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- Main pipeline to handle requests -- I knew that! ;)- Determines if user has permission to make request- Gets items- Ascertains scope- Executes action- Serializes and returns response (JSON by default)</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- ResolveAction processor- Executes action- Creates media library items- Cannot set media library item fields SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- But I want to set media library item fields!- Create a custom ResolveAction processorSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Lets see oneSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- But I don't want to use JSON! - Then change the Serializer already!</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Lets see such a thingSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- Has one lonely processor :(- Does some URL rewriting magic- Creates the default Serializer instanceSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- Didnt we already talk about the Serializer?- an alternative way to change it- custom PreprocessRequestProcessor</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Lets see an exampleSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- Consists of one processor</p> <p>- Provides information about an item- e.g. ID, Language, Template, Hair Color, Blood Type, etc.SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- But I want to know more about an item! :D- Add a custom GetPropertiesProcessor!</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Lets see an example</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- Composed of one processor- Ignores RecycleBinActive setting in Web.config- Permanently deletes all items in scope! O_OSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>- How can we recycle items instead?- Recycle items using a DeleteProcessorSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Show me the code!SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>What About Publishing?</p> <p>- Does not exist out of the box - Fill the gap using a custom pipeline- custom pipeline- Publish =&gt; PATCH - Lets see it!SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p> <p>Go Check It Out!</p> <p>Download it (SDN): http://bit.ly/19E9AzADeveloper's Guide: http://bit.ly/GQIaugSitecoreJunkie.com: http://bit.ly/19DoIY0Kern's Console Application: http://bit.ly/16UqOZx</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual SummitGet In Touch!</p> <p>Email: mreynolds@medtouch.comTwitter: @mike_i_reynoldsBlog: http://sitecorejunkie.comSharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual SummitQuestions?</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual SummitThank You! Fin</p> <p>SharingInspiringConnecting</p> <p>Sitecore Users 2013Virtual Summit</p>