Using rest to create a no code web part
This presentation is the property of its rightful owner.
Sponsored Links
1 / 67

Using REST to Create a No Code Web Part! PowerPoint PPT Presentation


  • 90 Views
  • Uploaded on
  • Presentation posted in: General

November 11, 2011. Using REST to Create a No Code Web Part!. An introduction to REST connections Patrick Curran, MCT. Patrick Curran. MCT, MCITP , MCTS , MCP SharePoint Architect for Planet Technologies. Working with SharePoint since 2003. Administrator / Developer

Download Presentation

Using REST to Create a No Code Web Part!

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Using rest to create a no code web part

November 11, 2011

Using REST to Create a No Code Web Part!

An introduction to REST connections

Patrick Curran, MCT


Patrick curran

Patrick Curran

  • MCT, MCITP, MCTS, MCP

  • SharePoint Architect for Planet Technologies.

  • Working with SharePoint since 2003.

    • Administrator / Developer

    • Architect / Implementer

    • Troubleshooter / Brander

      PCfromDC.blogspot.com

      @PCfromDC


Today s game plan

Today’s Game Plan

  • SharePoint familiarity discussion.

  • Introduction to REST Connections.

  • Create an Address List from a predefined content type.

  • Tweak and modify the list to meet out needs (Demo).

  • Use SharePoint Designer 2010 to add a Data View Web Part to display our Address on a new Web Part page (Demo).

  • Use SharePoint Designer 2010 to create a REST connection to display the current weather in Beverly Hills, CA (Demo).

  • Create a data connection to display the weather of the zip code from our Address List (Demo).


What is rest

What is REST?

  • Really Expensive SharePoint Technology?

  • Stands for Representational State Transfer.

  • REST is not a protocol.

  • At its most basic element, REST is a way for a client to retrieve data from a server over http.

  • SharePoint has a RESTful web service which will allow us to grab data from lists and libraries.


Objective

Objective

  • To display the weather at a location that is stored in a SharePoint list.


Let s get started

Let’s Get Started…

  • The first thing that we will need to accomplish is to create a list to store our address.

Click on Lists


Creating the list

Creating “The List”

Click on Create


Creating the list1

Creating “The List”

1- Select Lists.

2- Click on the list type.

3- Add a name (No spaces, We’ll fix this in a bit).

Click on Lists

4- Click on Create when ready!


Tweaking the list

Tweaking “The List”

  • Now that our list has been created, let’s tweak it for our requirements.

Click List Settings


Tweaking the list1

Tweaking “The List”

1- Adjust the Title(add the spaces back).

2- Set the content type.

Not part of this demo…


Tweaking the title

Tweaking “The Title”

1- Adjust the Title(add the spaces back).


Tweaking the title1

Tweaking “The Title”

1- Adjust the Title(add the spaces back).


Tweaking the title2

Tweaking “The Title”

No “%20” in the URL

User friendly name.


Add content type

Add Content Type…

Default content type.

We want to add an existing content type.


Add content type1

Add Content Type…

1- Select List Type from Drop Down.

2- Add Contact


Add content type2

Add Content Type…

1- Select List Type from Drop Down.

2- Add Contact


Add content type3

Add Content Type…

OTB Content Type Columns.


Tweak the content type

Tweak The Content Type…

Our Available Content Types.

Change the Default Content Type.


Tweak the content type1

Tweak The Content Type…

Settings Before


Tweak the content type2

Tweak The Content Type…

Settings After


Tweak the content type3

Tweak The Content Type…

Change Last Name to Location


Tweak the content type4

Tweak The Content Type…

Change Last Name to Location


Tweak the content type5

Tweak The Content Type…

Click OK to finish


Tweak the content type6

Tweak The Content Type…

What Columns do we really need?


Tweak the content type7

Tweak The Content Type…

What Columns do we really need?

Let’s hide the one’s we do not!


Tweak the view

Tweak The View…

Let’s edit the View


Tweak the view1

Tweak The View…

Let’s edit the View


Add an address

Add An Address…

Finally, let’s go ahead and Add a new item!

Click Add new Item


Add an address1

Add An Address…


Add an address2

Add An Address…


Add an address3

Add An Address…


Let s create our list

Let’s Create Our List!

Demo Time!


It s time to design

It’s Time To Design!

Let’s open up Designer and create a page to hold our information.

1- Open your site.

2- Select Master Pages.

3- Select the v4.master

4- Right click and select New from Master Page.


Create a page

Create A Page…

1- Save Page.

2- Ignore warning and click Yes


Create a page1

Create A Page…

1- Within the PlaceHolderMain, select the Common Content Tasks.

2- Click Create Custom Content


Create a page2

Create A Page…

1- Click inside of the PlaceHolderMain.

2- Insert a 4x4 Table.


Insert data view web part

Insert Data View Web Part…

1- Click inside the Upper Left table cell.

2- Insert an Empty Data View.


Insert data view web part1

Insert Data View Web Part…


Insert data view web part2

Insert Data View Web Part…

1- Ctrl + Click in order.

2- Insert as a Single Item View from the pull-down menu.


Insert data view web part3

Insert Data View Web Part…

  • Our list data is finally inserted!


Tweak the web part

Tweak The Web Part…

Remove Paging

Paging


Tweak the web part1

Tweak The Web Part…

Remove the first column


Tweak the web part2

Tweak The Web Part…

Format Address


Let s see some data

Let’s See Some Data!

Demo Time!


Add the weather

Add The Weather…

Click in the 3rd table row.


Add the weather1

Add The Weather…

Add New REST Connection

1- Select Data Sources.

2- Click REST Service Connection.


Add the weather2

Add The Weather…

1- Name your connection.

2- Add URL.

3- Modify Parameters.


Add the weather3

Add The Weather…

1- Modify Parameter.

Our updated Properties.


Add the weather4

Add The Weather…

Insert REST Feed Data View into 3rd table row.


Tweak the weather

Tweak The Weather…

With the Weather Web Part selected, click Add/Remove Columns.


Tweak the weather1

Tweak The Weather…

Lets remove the Displayed Columns.


Tweak the weather2

Tweak The Weather…

Delete the description row (right click in cell).


Tweak the weather3

Tweak The Weather…

Change the description Format type to Rich Text.


Tweak the weather4

Tweak The Weather…

Ignore the Warning!

Our updated page!


Let s see the weather

Let’s See The Weather!

Demo Time!


Make the connection

Make The Connection…

1- Select the address web part.

2- Add Connection


Make the connection1

Make The Connection…

1

2

3


Make the connection2

Make The Connection…

4

5


Make the connection3

Make The Connection…

6

7


Tweak the content

Tweak The Content…

Add a hyperlink to the company web site

1- Select the company name (Planet Technologies)

2- Format Item as Hyperlink

3- Ignore Confirmation!


Tweak the content1

Tweak The Content…

Edit Hyperlink Address

1- Click the function button

2- Select Web Page


Tweak the content2

Tweak The Content…

Update Address


Tweak the content3

Tweak The Content…

Open hyperlink in new page

1- Press the Target Frame button.

2- Select New Window as Target Frame.


Let s see if it works

Let’s See If It Works!

Demo Time!


Troubleshooting

Troubleshooting…


Additional rest information

Additional REST Information

  • Important SharePoint REST Starting Point

  • http://[yoursharepointURL]/_vti_bin/listdata.svc/[LISTNAME]

  • Reference Information

  • Accessing SharePoint 2010 Lists using RESTful Service.- http://mstecharchitect.blogspot.com/2010/01/accessing-sharepoint-2010-lists-using.html

  • Referencing lists from external site collections – Cross-site collection lookup with REST and the DVWP!- http://hamishking.wordpress.com/tag/cross-site-collection-lookup/

  • SP2010: REST Data Sources within SharePoint Designer- http://jsiegmund.wordpress.com/2010/04/25/sp2010-rest-data-sources-within-sharepoint-designer/v

  • Working with Data Sources and Web Services connections in SharePoint Designer 2010 (Has a list of all web services)- http://spointblog.com/2010/02/07/working-with-data-sources-and-web-services-connections-in-sharepoint-designer-2010/

  • Overview of using REST in SharePoint 2010- http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=35

  • Lab (This is very cool)

  • Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010.- http://msdn.microsoft.com/en-us/library/gg293117.aspx

  • Background Information

  • Representational state transfer- http://en.wikipedia.org/wiki/Representational_State_Transfer

  • QuickStudy: Representational State Transfer (REST)- http://www.computerworld.com/s/article/297424/Representational_State_Transfer_REST_?taxonomyId=16&pageNumber=1

  • REST Web Service- http://www.knowledgetree.org/REST_Web_Service


Thank you

Thank You!!!

  • Email: [email protected]

  • Blog: PCfromDC.blogspot.com

  • Twitter: @PCfromDC


  • Login