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

Content rollups


An important part of developing a content strategy is to plan where content will be stored and where it needs to be displayed. In many cases content will be displayed in multiple locations or aggregated with other content. These aggregated content sources are often called content rollups and they provide a great way to reuse content throughout your SharePoint environment.

Approach

There are three common ways to aggregate content to create a content rollup:

  • Content Query Web Part (CQWP)

  • Search Web Parts

  • Custom Web Parts

Let's review each of these options in more detail.

Content Query Web Part (CQWP)

The first is to use one of SharePoint's standard Web Parts like the Content Query Web Part (CQWP) that comes with SharePoint Server. Using the CQWP, it is possible to configure a query rule that will look for content in all sites within the site collection, within site below a selected site, or within a specified list or library. The query configuration also allows you to specify which list type and content type to query for. This allows you to cast a pretty wide net and pull back the related content. It also underscores the importance of properly classifying your content so that it can be easily identified. There are also a number of presentation properties that can be configured to present the content in different ways.

There are two serious limitations to the CQWP, the first is that it may not perform very well in very large sites or in aggregating large lists of content. It is important to understand that when a page is loaded with the CQWP, it will issue the requests to go grab the content. This can be a very expensive call requiring significant processing power from the server. There is some caching available, but it may not be effective enough with large sets of data. The second limitation is with the presentation options available. It is very easy to configure the presentation, but if one of the available options does not meet your needs it is not possible to have full control over the presentation.

For the purpose of this exercise the content is pretty simple so we will configure the rollup using the CQWP.

Search Web Parts

Utilizing the search system has distinct advantage that the information in the search index is optimized to return results significantly faster than querying the content sources. In addition, you have the ability to pull content from additional site collections or content sources within the search index. Using the Search Core Results Web Part you can specify a moderately complex query, the properties you need, and then the output can be fully customized by supplying custom XSL to format the returned XML.

The downside to using the search features is that the content has to be indexed for it to be available for display. Depending on the crawl frequency there is content that could be excluded, and typically the most recent content is the most relevant.

For a demonstration of using the Search Web Parts to aggregate content, see Chapter 4, Building an Engaging Community Site which will use the Search Web Parts to dynamically display people and content.

Custom Web Part

When developing a custom Web Part you have full control over how the content is pulled as well as how it is presented which gives you the best of all options. You have the option of either querying the source data or the search index, and you also have the ability to take advantage of advanced caching techniques which is valuable for highly trafficked pages.

The only downside to this approach is that it takes a lot more time and effort to build and test the customization than to configure the previously mentioned Web Parts. Also, in environments where farm solutions cannot be deployed to the server, this may not be an option.

For a demonstration of using more advanced techniques within a custom Web Part, see Chapter 3, Building an Enterprise Content Management Solution, which will leverage a series of custom Web Parts to aggregate form submissions.

Creating the content source

For the purpose of this exercise a simple subsite was created called News. Articles will be published to the Site Pages library on that site. To make the content easy to identify, a new content type was created called News, which inherits from the Article Page content type. The Article Page, and therefore the News content type has a number of properties that allow you to identify a number of pieces of metadata including By Line, Scheduling Start Date, Scheduling End Date, Article Date, and Rollup Image which will be used in the presentation of the rollup information. In addition, an additional Summary field can be added to provide some additional content.

Configuring the Content Query Web Part

To start with, Edit the Page and add the Content Query Web Part to the Page. It is available under the Content Rollup category as displayed in the following screenshot:

The next step is to configure the source of the content. To query for content within the entire site collection you can keep the default setting as Show items from all sites in this site collection. If the site is large, or you only want to look in specific locations, you can select one of the other options that narrow the scope. A list of the Source options are shown in the following screenshot:

Next you define what types of items to display by setting the List Type value, along with the Content Type, as displayed in the following screenshot:

You also have the option of further filtering based on the property metadata that is available. This can be helpful to pinpoint the most valuable content within the system. In this case we are going to filter on the Scheduling End Date field and look for items with a date that is less than or equal to today, as seen in the following screenshot:

For the presentation configuration you have the ability to determine Group By, Sorting, and Item Limit information similar to a list view.

The Styles section has the most impact on how the content is presented, because it is used to select the associated XSL used to format the content for the page. For the headline with summary option we have chosen the Large title Item style as displayed in the following screenshot:

Next we need to map the list properties to the standard CQWP fields. In the case of the News article example we will stick pretty close to the default values, and only modify the Description field to include the Summary field we added to the News content type as displayed in the following screenshot:

News content rollup displayed

Once configured this will pull and display any items added to the site collection with the News content type and display them until after the scheduled end date has passed. Newest articles will be displayed at the top of the list. The News content rollup is displayed in the following screenshot:

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