1 / 25

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

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

afi
Download Presentation

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

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. Mike Reynolds Product Technical Lead MedTouch Oh CRUD -- Enhance the Sitecore Item Web API to Fit Your Needs Sharing Inspiring Connecting

  2. Sitecore Item Web API- Create, Read, Update and Delete (CRUD) - Defined by HTTP request methods- Create => POST - Read => GET - Update => PUT- Delete => DELETE (really? :P) Sharing Inspiring Connecting

  3. Sitecore Item Web API- Touch multiple items in “scope” - Parent => p - Self => s - Children => c - can request all three -- sweet!- Uses JSON in responses by default- Customizable through pipelines Sharing Inspiring Connecting

  4. <itemWebApiRequest>- 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) Sharing Inspiring Connecting

  5. <itemWebApiRequest>- ResolveAction processor - Executes action - Creates media library items - Cannot set media library item fields  Sharing Inspiring Connecting

  6. <itemWebApiRequest>- But I want to set media library item fields! - Create a custom ResolveAction processor Sharing Inspiring Connecting

  7. <itemWebApiRequest> Let’s see one Sharing Inspiring Connecting

  8. <itemWebApiRequest>- But I don't want to use JSON!  - Then change the Serializer already! Sharing Inspiring Connecting

  9. <itemWebApiRequest> Let’s see such a thing Sharing Inspiring Connecting

  10. <preprocessRequest>- Has one lonely processor :(- Does some URL rewriting magic- Creates the default Serializer instance Sharing Inspiring Connecting

  11. <preprocessRequest> Sharing Inspiring Connecting

  12. <preprocessRequest>- Didn’t we already talk about the Serializer? - an alternative way to change it - custom PreprocessRequestProcessor Sharing Inspiring Connecting

  13. <preprocessRequest> Let’s see an example Sharing Inspiring Connecting

  14. <itemWebApiGetProperties>- Consists of one processor- Provides information about an item - e.g. ID, Language, Template, Hair Color, Blood Type, etc. Sharing Inspiring Connecting

  15. <itemWebApiGetProperties> Sharing Inspiring Connecting

  16. <itemWebApiGetProperties>- But I want to know more about an item! :D - Add a custom GetPropertiesProcessor! Sharing Inspiring Connecting

  17. <itemWebApiGetProperties> Let’s see an example Sharing Inspiring Connecting

  18. <itemWebApiDelete>- Composed of one processor- Ignores RecycleBinActive setting in Web.config - Permanently deletes all items in scope! O_O Sharing Inspiring Connecting

  19. <itemWebApiDelete>- How can we recycle items instead? - Recycle items using a DeleteProcessor Sharing Inspiring Connecting

  20. <itemWebApiDelete>Show me the code! Sharing Inspiring Connecting

  21. What About Publishing?- Does not exist “out of the box” - Fill the gap using a custom pipeline - custom <itemWebApiPatch> pipeline - Publish => PATCH - Let’s see it! Sharing Inspiring Connecting

  22. Go Check It Out!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 Sharing Inspiring Connecting

  23. Get In Touch!Email: mreynolds@medtouch.comTwitter: @mike_i_reynoldsBlog: http://sitecorejunkie.com Sharing Inspiring Connecting

  24. Questions? Sharing Inspiring Connecting

  25. Thank You!Fin Sharing Inspiring Connecting

More Related