Wiley Publishing, Inc.
Professional
SharePoint
®
2007 Web Content
Management Development
Building Publishing Sites with Office SharePoint
Server 2007
Andrew Connell
ffirs.indd iiiffirs.indd iii 5/8/08 5:14:10 PM5/8/08 5:14:10 PM
ffirs.indd iiffirs.indd ii 5/8/08 5:14:09 PM5/8/08 5:14:09 PM
Professional
SharePoint
®
2007 Web Content
Management Development
Foreword ................................................................................................... xxiii
Introduction ............................................................................................... xxv
Chapter 1: Embarking on Web Content Management Projects ......................... 1
Chapter 2: Windows SharePoint Server 3.0 Development Primer ................... 19
Chapter 3: Overview of Web Content Management in Microsoft Office
SharePoint Server 2007 .............................................................. 39
Chapter 4: SharePoint Features and the Solution Framework ......................... 51
Chapter 5: Minimal Publishing Site Definition ............................................... 69
Chapter 6: Site Columns, Content Types, and Lists ....................................... 89
Chapter 7: Master Pages and Page Layouts ................................................ 109
Chapter 8: Navigation ................................................................................ 137
Chapter 9: Accessibility ............................................................................. 145
Chapter 10: Field Types and Field Controls ................................................. 157
Chapter 11: Web Parts .............................................................................. 179
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-22475-5
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data:
Connell, Andrew, 1976-
Professional SharePoint 2007 Web content management development : building publishing sites with
Office SharePoint server 2007 / Andrew Connell.
p. cm.
Includes index.
ISBN 978-0-470-22475-5 (paper/website)
1. Web site development—Computer programs. 2. Web sites—Management.
3. Database management. 4. Microsoft Office SharePoint server. I. Title.
TK5105.8885.M54C66 2008 006.7'8—dc22
2008016811
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal
Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or
online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is
sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should be sought. Neither
the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is
Microsoft SharePoint Conference.
Technology is not only Andrew’s job, but also a personal passion: He thrives on expanding his technical
knowledge. When not in front of his computer, he enjoys football, golf, the beach, and spending time
with his family. He lives in Jacksonville, Florida, with his wife, Meredith, his son, Steven, and their two
dogs. You can always find Andrew online at his SharePoint development and WCM-focused blog at
www.andrewconnell.com/blog
.
About the Technical Editors
The technical editing of this book was performed by quite a few industry experts, all of whom served
a pivotal role in ensuring that the content and code samples in this book are factually correct:
J. Dan Attis (
www.devcow.com/blogs/jdattis
), Microsoft MVP for Windows SharePoint
Services, has been heavily involved in the local developer community in the Atlanta, Georgia
area for nine years. He has been known to spend many nights and weekends working to
promote SharePoint in the community as a development platform. He is a stickler for details
and an ideal choice for editing the book.
Jason Conway (
http://weblogs.asp.net/jasonconway
) is a senior application developer
and team lead for Ascentium, with over a decade of experience delivering custom solutions in
a large range of markets and industries. He now applies that experience to designing and
developing solutions for corporate intranets and extranets using SharePoint 2007.
Stefan Gordon (
www.stefangordon.com
) is a software architect with Ascentium, an avid
blogger, and a dedicated SharePoint evangelist.
Cale Hoopes (
http://calehoopes.blogspot.com
) is a mountaineer, application developer
SharePoint; his advancements extend and enhance SharePoint as a custom application
development platform.
Patrick Tisseghem (
www.u2u.info/Blogs/Patrick
) is a managing partner at U2U,
a SharePoint training company in Belgium. Patrick is also a Microsoft MVP for Windows
SharePoint Services and author of Inside Microsoft Office SharePoint Server 2007 (Microsoft
Press, 2007).
Roxana Tzau has many years of experience as a Web developer and helped build one of the
largest corporate intranet portals within Microsoft using SharePoint Server 2007 with
Ascentium. She continues to develop solutions for enterprise corporate intranets by extending
the SharePoint platform.
Thomas Wyrick is a Senior Software Engineer at the Ascentium Corporation and has had part in
delivering enterprise class solutions on the Microsoft platform.
❑
❑
❑
❑
❑
❑
❑
About the Technical Editors
viii
ffirs.indd viiiffirs.indd viii 5/8/08 5:14:11 PM5/8/08 5:14:11 PM
Acquisitions Editor
Katie Mohr
Development Editor
Kenyon Brown
Technical Editors
J. Dan Attis
ffirs.indd ixffirs.indd ix 5/8/08 5:14:11 PM5/8/08 5:14:11 PM
ffirs.indd xffirs.indd x 5/8/08 5:14:11 PM5/8/08 5:14:11 PM
Acknowledgments
No project of this size can come be completed in a vacuum. I asked some of my trusted associates to
contribute to the book by writing a few of the chapters. First and foremost, I want to thank Spencer
Harbar (
www.harbar.net
), MVP for Office SharePoint Server, a good friend who I met in the days of
Microsoft Content Management Server 2002. Spencer was instrumental in developing the structure and
approach of this book, acting as a sounding board for various decision points in the process. He also
contributed Chapter 3, “Overview of Office SharePoint Server 2007 and Web Content Management,”
and Chapter 17, “Content Deployment.” Bob German (
http://blogs.msdn.com/bobgerman
)
contributed Chapter 1, “Embarking on Web Content Management Projects,” and Chapter 16,
“Implementing Sites with Multiple Languages and Devices.” Matt McDermott (
http://blogs
.catapultsystems.com/matthew
), MVP for Office SharePoint Server, contributed Chapter 13,
“Search,” and John Holliday (
www.johnholliday.net
), MVP for Office SharePoint Server, contributed
Chapter 5, “Minimal Publishing Site Definition.”
I also want to thank those at Microsoft who provided support, as well as those who assisted in
answering some of the technical questions: Arpan Shah, Ryan Duguid, Lawrence Liu, Jim Masson,
George Perantatos, and Tyler Butler.
No technical book is complete without a solid review to ensure that the code compiles and the text in the
chapters is factually correct. Many members of Ascentium were instrumental in reviewing the book.
Ascentium is an interactive marketing and technology consultancy that delivers solutions ranging from
interactive marketing, customer relationship management, business intelligence, portals, and
Authors and Editors 2
Designers and Developers 4
Designing and Planning a Successful WCM Solution 7
Use Case Scenarios 7
Site Structure and Navigation 7
Page Layouts and Content Types 10
Supporting Content: Images, Attachments and Reusable Content 11
Site Definitions 12
Roles and Permissions 13
User Profiles and Targeting 14
Search Strategy 15
Summary 16
Chapter 2: Windows SharePoint Server 3.0 Development Primer 19
SharePoint Architecture 19
SharePoint on the File System and in Internet Information Services 21
SharePoint Site Topology 22
SharePoint Administration 24
Central Administration 24
Site Settings 24
List Settings 25
STSADM.EXE 26
WSS 3.0 and ASP.NET 2.0 Development 27
Like ASP.NET 2.0 27
Unlike ASP.NET 2.0 29
Types of Pages 31
Site Pages 31
Application Pages 32
ftoc.indd xiiiftoc.indd xiii 5/9/08 5:13:05 PM5/9/08 5:13:05 PM
Contents
xiv
Anatomy of a WSS Solution Package 60
Solution Deployment 63
Creating WSS Solution Packages 63
Summary 67
ftoc.indd xivftoc.indd xiv 5/9/08 5:13:06 PM5/9/08 5:13:06 PM
Contents
xv
Chapter 5: Minimal Publishing Site Definition 69
Elements of a Publishing Site 70
The Pages Library 70
Styles and Images 70
Master Pages and Page Layouts 70
Content Types 71
Examining the Publishing Portal Site Definition 71
Publishing Feature PublishingWeb 72
Publishing Feature Publishing 72
Publishing Feature PublishingSite 73
Publishing Feature PublishingPrerequisites 73
Publishing Feature PublishingResources 73
Publishing Feature PublishingLayouts 73
Publishing Feature Navigation 74
Publishing Feature PublishingStapling 74
The Challenge with the Publishing Portal Site Definition 74
Creating a Publishing Site Definition 74
The Significance of Site Definitions 75
Custom Site Provisioning 76
The WEBTEMP File 79
The ONET.XML File 80
The Feature Manifest 87
The Feature Elements 88
Creating Delegate Controls 134
Summary 136
Chapter 8: Navigation 137
ASP.NET 2.0 Navigation Provider Model 137
Customizing Site Navigation 138
Browser-Based Customizations 138
Customizing the Navigation Control 139
Customizing the Navigation Site Map Data Source 140
Customizing the Navigation Provider 140
Customizing Navigation with the API 141
Creating Custom Navigation Components 142
Performance and Usability Considerations 142
PortalSiteMapProvider 142
Table of Contents Web Part 144
Summary 144
Chapter 9: Accessibility 145
What Is an Accessible Web Site? 145
Measuring Accessibility 146
WCAG 1.0 147
WCAG 2.0 149
United States Rehabilitation Act of 1973 Section 508 150
W3C Markup Validation Service 151
Advantages to Creating Accessible Web Sites 151
Creating Accessible SharePoint Sites 152
Challenges to Creating Accessible SharePoint Sites 153
ftoc.indd xviftoc.indd xvi 5/9/08 5:13:07 PM5/9/08 5:13:07 PM
Contents
xvii
Accessibility Kit for SharePoint 154
Position and Goals of the AKS 155
Summary 208
Chapter 12: Leveraging Workflow 211
Understanding Windows Workflow Foundation 211
Windows Workflow Foundation Terminology and Architecture 212
ftoc.indd xviiftoc.indd xvii 5/9/08 5:13:08 PM5/9/08 5:13:08 PM
Contents
xviii
Activities 214
Types of Workflows 214
Creating Custom Workflows 215
Developing Custom Workflows with Visual Studio 215
Overview of SharePoint’s Workflow Proposition 215
Architecture 216
Terminology 216
History and Task Lists 218
Interacting with Users with Forms 219
Workflow in SharePoint Publishing Sites 220
Overview of the Parallel Approvers Workflow 220
Creating Custom Workflows for SharePoint Publishing Sites 221
Creating Workflows with SharePoint Designer 221
Creating Workflows with Visual Studio 221
Summary 240
Chapter 13: Search 241
Planning for Search 242
Issues 242
Questions to Ask 242
Search Is a Business Problem 244
Search Center Design and Configuration 244
Search Center vs. Search Site 244
Results Page Anatomy 247
Customizing the Page Editing Toolbar 280
Creating Page Editing Toolbar Actions 281
Adding Items to the PET Page Editing Menu 283
Adding Buttons to the PET Quick Access Buttons 284
Deploying Page Editing Toolbar Customizations 285
Summary 289
Chapter 15: Authentication and Authorization 291
SharePoint Security Components 291
Permission Rights 291
Permission Levels 292
SharePoint Groups 293
Securable Objects 293
Additional Publishing Security Components 293
SharePoint Security via the API 295
Alternate Access Mappings 296
Authentication Provider Model 296
Configuring Forms-Based Authentication 297
Anonymous Access 302
Summary 304
Chapter 16: Implementing Sites with Multiple Languages and Devices 305
Developing Multilingual Web Sites 305
Installing the Language Packs 307
Using Variations 308
Building Language-Agile Features 311
Targeting Devices with Variations 318
Creating Variations for Mobile Devices 318
Redirecting Mobile Users 318
Master Pages, Page Layouts, and Style Sheets 319
Summary 319
ftoc.indd xixftoc.indd xix 5/9/08 5:13:08 PM5/9/08 5:13:08 PM
XML to Web Page 353
Creating Custom Document Converters 353
Creating the Document Converter 354
Creating the Document Converter Application 354
Deploying Custom Document Converters 359
Adding Settings to Document Converters 360
Working with Document Converters via the Object Model 366
Summary 367
ftoc.indd xxftoc.indd xx 5/9/08 5:13:08 PM5/9/08 5:13:08 PM
Contents
xxi
Chapter 19: Performance Tips, Tricks, and Traps 369
SharePoint Caching Options 370
Page Output Caching 370
Object Caching 371
Disk-Based Caching (BLOB Cache) 372
Limiting the Page Payload 372
SharePoint’s CORE.JS 374
Browser Cache and Content Expiration 378
Performance Programming Techniques 378
.NET Framework Disposable Objects 379
Working with SharePoint Disposable Objects 380
Working with Collections 381
Querying/Aggregating Data via the API 382
Summary 383
Chapter 20: Incorporating ASP.NET 2.0 Applications 385
Each Component Adds More Value 386
What ASP.NET 2.0 Brings to the Table 386
What WSS 3.0 Brings to the Table 387
What MOSS 2007 Brings to the Table 388