Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft SharePoint 2010 Business Application Blueprints

You're reading from   Microsoft SharePoint 2010 Business Application Blueprints Master SharePoint application development by building exciting SharePoint business solutions with this book and ebook.

Arrow left icon
Product type Paperback
Published in Jun 2012
Publisher Packt
ISBN-13 9781849683609
Length 282 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (15) Chapters Close

Microsoft SharePoint 2010 Business Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Building an Effective Intranet 2. Building an Out of Office Delegation Solution FREE CHAPTER 3. Building an Enterprise Content Management Solution 4. Building an Engaging Community Site 5. Building a Site Request and Provisioning System 6. Building a Project Site Template 7. Building a Project Management Main Site 8. Building a Task Rollup Solution 9. Building a Site Directory with SharePoint Search

Creating a Weather Web Part


In many organizations a frequent request is to display the current time and weather for one or more locations where the organization operates.

This exercise provides a great example of how to consume web based data to populate the content. For the purpose of this chapter I am going to consume a service provided by The Weather Channel ®. You will need to register as a partner in order to use this service. You can find additional details at http://portal.theweatherchannel.com/.

Approach

The easiest way to use this service is to load the content into the standard XML Web Part. This approach will also work in cloud-based environments such as Office 365. The XML Viewer Web Part is included under the Content Rollup category as displayed in the following screenshot:

Configuring the XML Web Part

With the XML Web Part added to the page, configure the appearance properties such as title, height, and width. Set the XML link to the path of the service with the required inputs, and set the XSL link to the path of your XSL file. The best way to manage the XSL file is to upload it into a central style and script library on the site.

The contents of the XSL file should format the content into the desired format. The Weather.com web service will return a number of key attributes including the location, the current temperature, and the current time.

Weather Web Part displayed

A rendered version of the Current Weather Web Part is displayed in the following screenshot:

The standard SharePoint Web Parts can also be exported with configuration settings making it easy to reuse the content on many pages or sites. It can either be uploaded to the desired page(s) or added to the site collection's Web Part Gallery.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image