Book Image

Microsoft SharePoint 2010 Business Application Blueprints

Book Image

Microsoft SharePoint 2010 Business Application Blueprints

Overview of this book

SharePoint is an incredibly powerful platform that can support a wide variety of business scenarios. In many cases it needs to be configured or extended in order to deliver fully featured business solutions. While some books merely talk about the capabilities of SharePoint in general and leave you to figure out how they apply to your situation, this book takes a different approach. Each chapter provides easy-to-understand, step-by-step instructions along with screenshots to help build exciting SharePoint business solutions that extend the platform. By the end of this book the reader will be a SharePoint developer to be reckoned with. This book will dive into a diverse set of real-world scenarios to deliver sample business solutions that can serve as the foundation for your own solutions. This book draws from the author's extensive experience with SharePoint to leverage the platforms underlying services to provide solutions that can support Social Collaboration, Content and Document Management, as well as project collaboration. Each chapter represents a new business solution that builds on the overall platform to deliver more complex solutions and more advanced techniques. By the end of the book the reader will understand how to leverage the SharePoint platform to build their own business solutions.
Table of Contents (15 chapters)
Microsoft SharePoint 2010 Business Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

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: