Last Tuesday and Wednesday the SharePoint Connections Amsterdam 2013 were held in Amsterdam, Netherlands. I did a session on Developing SharePoint 2013 Apps with Visual Studio 2012 and enjoyed it very much.
Besides my session I was on the Ask The Experts team for the DIWUG. Handed out the new edition of the DIWUG SharePoint eMagazine (download for free) and helped people with their questions. At the start of the conference is was quite, but along the way more and more people came up the Ask The Experts panel. Some interesting question, a big thanks for that!
In this article:
- Demo 1: Silly Facts SharePoint-hosted app
- Demo 2: Provider-hosted App retrieving data via CSOM and REST
- Downloads: slide deck and source code
The Silly Facts demo is about creating a list with silly facts, like the ones below. The list is provisioned in the App web using a Content Type and List Instance artifact.
Once the list is in place I added a App Part (Client Web Part) to the Host web which shows a random fact every time the page gets loaded.
The next demo is extending demo 1 and changing it to a Provider-Hosted app and adding logic for retrieving data with SharePoint via CSOM (Taxonomy) and REST (Search). Changing the SharePoint-Hosted app to a Provider-Hosted app is done in the AppManifest.xml. Here you can change the type and instantly it will ask to generate a Web Project for you.
Next step is adding the chrome which allows you to add a custom menu shown in the top right corner. You can add you own options which integrate with the chrome.
With everything in place we will retrieve Taxonomy data via the CSOM and perform search queries via the REST API. This is done via code-behind of the Default.aspx on the button click.
You can check the slide deck and source if you want. When you have question, please use the comments section below.
Source code is found on Codeplex: https://sillyfacts.codeplex.com/