Microsoft SharePoint: Building Office 2007 Solutions in C# 2005 978-1-59059-809-2, 1-59059-809-1

Microsoft SharePoint: Building Office 2007 Solutions in C# 2005 is the third edition of Scot Hillier's market-leadi

273 90 6MB

English Pages 540 Year 2007

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Microsoft SharePoint: Building Office 2007 Solutions in C# 2005
 978-1-59059-809-2, 1-59059-809-1

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

THE EXPERT’S VOICE ® IN SHAREPOINT

Microsoft

SharePoint Building Office 2007 Solutions in C# 2005 Everything you need to create solutions with the Microsoft Office SharePoint Server

Scot Hillier

Microsoft SharePoint Building Office 2007 Solutions in C# 2005

Scot Hillier

Microsoft SharePoint: Building Office 2007 Solutions in C# 2005 Copyright © 2007 by Scot Hillier All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-59059-809-2 ISBN-10 (pbk): 1-59059-809-1 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Jonathan Hassell Technical Reviewer: Sahil Malik Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Matt Wade Project Manager: Elizabeth Seymour Copy Edit Manager: Nicole Flores Copy Editor: Jennifer Whipple Assistant Production Director: Kari Brooks-Copony Production Editor: Kelly Winquist Compositor: Linda Weidemann, Wolf Creek Press Proofreader: April Eddy Indexer: Broccoli Information Management Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com in the Source Code/ Download section.

To Nan, for 20 years

Contents at a Glance About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER ■CHAPTER

1 2 3 4 5 6 7 8 9 10 11 12

SharePoint Business Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 SharePoint Overview, Planning, and Installation . . . . . . . . . . . . . . . . 21 SharePoint Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 SharePoint Shared Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 SharePoint Content Development and Management. . . . . . . . . . . . 147 SharePoint Document, Form, and Records Management . . . . . . . 193 SharePoint Custom Features and Workflows . . . . . . . . . . . . . . . . . . . 237 SharePoint Business Intelligence Solutions . . . . . . . . . . . . . . . . . . . . 295 SharePoint and Microsoft Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 SharePoint Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 Programming SharePoint Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 SharePoint Operations and Administration . . . . . . . . . . . . . . . . . . . . . 451

■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487

v

Contents About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

■CHAPTER 1

SharePoint Business Solutions

.............................1

The SharePoint Marketplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Segmenting Information Workers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Transactors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Professionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Executives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Grouping Information Workers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Individuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Departmental Teams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Divisional Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Enterprise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Extended Enterprise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Information Worker Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The System Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Information Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Process Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Collaboration Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Access Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 The Management Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The Regulatory Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Understanding Business Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Increasing Individual Productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Increasing Team Productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Increasing Divisional and Enterprise Productivity . . . . . . . . . . . . . . . 11 Supporting Remote Workers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Integrating with Partners and Customers . . . . . . . . . . . . . . . . . . . . . . 13 Complying with Regulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 vii

viii

■CONTENTS

Analysis and Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Documenting the Business Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Documenting Policies, Practices, and Regulations . . . . . . . . . . . . . . 16 Project and Design Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Managing Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

■CHAPTER 2

SharePoint Overview, Planning, and Installation . . . . . . . . . 21 Windows SharePoint Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Document Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Web Parts and Custom Development . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Site Creation and Branding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Microsoft Office 2007 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Document Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Working Offline, While Mobile, or With Peers . . . . . . . . . . . . . . . . . . . 26 Microsoft Office 2007 Suites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Microsoft Office SharePoint Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Portal Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Enterprise Content Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Business Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Shared Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 MOSS Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Installation Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 User Capacity Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Storage Capacity Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Access and Authentication Planning . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Deployment Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Exercise 2.1. Creating a Development Environment . . . . . . . . . . . . . . . . . . 35 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Section 1: Installing Virtual Server 2005 . . . . . . . . . . . . . . . . . . . . . . . 37 Section 2: Creating the VPC Images . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Section 3: Creating the Domain Controller . . . . . . . . . . . . . . . . . . . . . 41 Section 4: Creating the Database Server . . . . . . . . . . . . . . . . . . . . . . . 46 Section 5: Installing Windows SharePoint Services . . . . . . . . . . . . . . 48 Section 6: Installing Microsoft Office SharePoint Server. . . . . . . . . . 55 Section 7: Creating a Test Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

■CONTENTS

■CHAPTER 3

SharePoint Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Understanding Permission Levels and SharePoint Groups . . . . . . . . 67 Configuring Anonymous Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Understanding Security Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Managing Site Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Working with Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Working with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Configuring E-Mail–Enabled Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Working with Pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Understanding Alerts and RSS Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Understanding Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Understanding Authentication Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Extending Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Using Forms Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Using Web Single Sign-On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Using Active Directory Account Creation Mode . . . . . . . . . . . . . . . . . 90 Extending Web Applications Outside the Firewall . . . . . . . . . . . . . . . . . . . . 90 Working with Alternate Access Mappings . . . . . . . . . . . . . . . . . . . . . . 90 Enabling Secure Sockets Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Exercise 3.1. Creating a Secure Internet Site . . . . . . . . . . . . . . . . . . . . . . . . 91 Extending the Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Creating an Alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Installing Certificate Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Requesting a New Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Creating a New Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Installing the New Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Configuring Forms Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Adding a New Incoming URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Testing Secure Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

■CHAPTER 4

SharePoint Shared Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Creating and Managing Shared Services Providers . . . . . . . . . . . . . . . . . 103 Configuring Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Crawling Content Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Including File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Understanding Search Scopes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Using Keywords and Best Bets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Reporting on Search Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

ix

x

■CONTENTS

Using Audiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Understanding User Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Personalization with My Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Using My Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Customizing My Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Publishing Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Using Excel Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Configuring Excel Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Using Parameters in Excel Services . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Using Data Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Using Excel Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Creating User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Integrating the Business Data Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Understanding Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Uploading the Application Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Using BDC Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Exercise 4.1. Custom Solutions with Excel Services . . . . . . . . . . . . . . . . . 141 Trusting a Document Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Creating the Mileage Calculator Spreadsheet. . . . . . . . . . . . . . . . . . 142 Creating the New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Coding the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

■CHAPTER 5

SharePoint Content Development and Management

. . . . 147

Understanding Site Collection Templates . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Adding and Editing Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Using Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Connecting Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Modifying the Site Look and Feel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Customizing Site Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Using Themes and Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Customizing with the SharePoint Designer . . . . . . . . . . . . . . . . . . . . . . . . . 155 Understanding Contributor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Adding a New Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Working with Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Working with Data Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Understanding the Impact of Customization . . . . . . . . . . . . . . . . . . . . . . . . 162 Saving Customized Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Creating Site Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Creating List Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

■CONTENTS

Using the Publishing Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Creating a Public Internet Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Creating and Approving Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Using an Alternate Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Understanding Master Pages and Page Layouts . . . . . . . . . . . . . . . . . . . . 171 Editing the Default Master Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Creating New Page Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Creating New Master Pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Enabling Site Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Using Content Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Exercise 5.1. Web Content Management . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Creating a New Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Activating and Configuring the Publishing Feature . . . . . . . . . . . . . 183 Creating a New Welcome Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Defining Site Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Defining the Content Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Creating the Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Editing the Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Publishing the Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Using the Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

■CHAPTER 6

SharePoint Document, Form, and Records Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Working with Content Types, Lists, and Libraries . . . . . . . . . . . . . . . . . . . 193 Understanding Site and List Columns . . . . . . . . . . . . . . . . . . . . . . . . 195 Working with Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Using New Content Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Configuring Document Library Enhancements . . . . . . . . . . . . . . . . . 200 Working with InfoPath and Form Libraries . . . . . . . . . . . . . . . . . . . . . . . . . 203 Creating Template Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Importing Word and Excel Documents . . . . . . . . . . . . . . . . . . . . . . . . 207 Using Data Connection Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Developing with Visual Studio Tools for Applications . . . . . . . . . . . 210 Understanding InfoPath Forms Services . . . . . . . . . . . . . . . . . . . . . . 216 Using the Document Conversions Service . . . . . . . . . . . . . . . . . . . . . . . . . 220 Understanding Records Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

xi

xii

■CONTENTS

Exercise 6.1. InfoPath and SharePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Creating a Customer Issues Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Creating the Customer Issues Form . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Publishing the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Configuring the Form Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Using the New Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Exercise 6.2. Document and Records Management . . . . . . . . . . . . . . . . . 229 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Defining Site Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Defining Site Content Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Creating the Document Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Creating the Records Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Configuring the Records Repository . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Archiving a Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Creating a Hold Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

■CHAPTER 7

SharePoint Custom Features and Workflows . . . . . . . . . . . . 237 Building Custom Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Understanding the Feature Architecture . . . . . . . . . . . . . . . . . . . . . . 237 Adding Actions to Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . 240 Using Custom Action Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Using Tokens to Retrieve Information . . . . . . . . . . . . . . . . . . . . . . . . 247 Adding New Files to a Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Understanding Feature Receivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Receiving Site, List, and Item Events . . . . . . . . . . . . . . . . . . . . . . . . . 253 Building and Using Workflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Using Built-In Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 Creating Custom Workflows in Visual Studio . . . . . . . . . . . . . . . . . . 259 Creating Workflows in SharePoint Designer . . . . . . . . . . . . . . . . . . . 265 Creating Custom Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Considering Workflow Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

■CONTENTS

Exercise 7.1. Building an Employee Performance Review Workflow . . . 273 Creating the InfoPath Workflow Forms . . . . . . . . . . . . . . . . . . . . . . . 273 Creating the Workflow Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Publishing the Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Developing the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Coding the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Building the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 Deploying the Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 Using the Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

■CHAPTER 8

SharePoint Business Intelligence Solutions. . . . . . . . . . . . . . 295 Understanding Report Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Using Scorecards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 Using Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 Understanding Data Source Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Using SharePoint Lists as Data Sources . . . . . . . . . . . . . . . . . . . . . . 300 Using Spreadsheets as Data Sources . . . . . . . . . . . . . . . . . . . . . . . . 302 Using Cubes as Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Integrating SQL Reporting Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 Reporting Services Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 SQL Server 2005 Service Pack 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Exercise 8.1. Creating a Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Installing the AdventureWorks Data Warehouse . . . . . . . . . . . . . . . 312 Building and Deploying a Cube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Browsing the Cube in Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 Adding the Data Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 Creating a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 Building the Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

■CHAPTER 9

SharePoint and Microsoft Office . . . . . . . . . . . . . . . . . . . . . . . . . . 321 Managing Document Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 Utilizing the Document Management Information Panel . . . . . . . . . 321 Using the Research Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Working with Quick Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Creating Custom Document Information Panels. . . . . . . . . . . . . . . . 326 Going Offline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 Going Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

xiii

xiv

■CONTENTS

Using the Office Open XML File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Understanding Document Packages. . . . . . . . . . . . . . . . . . . . . . . . . . 333 Using System.IO.Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 Developing with Visual Studio Tools for Office . . . . . . . . . . . . . . . . . . . . . . 341 Creating a Development Environment . . . . . . . . . . . . . . . . . . . . . . . . 341 Creating Office 2007 Add-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 Creating Office 2007 Task Panes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Deploying VSTO 2005 SE Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 350 Exercise 9.1. Using the Office Open File Formats . . . . . . . . . . . . . . . . . . . 353 Starting the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 Coding WordCleaner.Worker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 Creating the Worker.aspx Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 Coding the Worker.aspx Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 Creating the Feature.xml file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Creating the Elements.xml file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 Creating the Install.bat file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 Activating and Using the Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

■CHAPTER 10 SharePoint Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 Web Part Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 Web Part Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 Rendering Web Parts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 The Web Part Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Deploying Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 Understanding Deployment Options . . . . . . . . . . . . . . . . . . . . . . . . . . 373 Building the Web Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 Code Access Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 Creating Solution Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 Using Custom Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Using Client-Side Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Building Connectable Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Building Custom Connection Interfaces . . . . . . . . . . . . . . . . . . . . . . . 387 Using Standard Connection Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 389 Custom Editor Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 Creating an Editor Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 Using an Editor Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398

■CONTENTS

Exercise 10.1. A Complete Web Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 Installing the AdventureWorks Database . . . . . . . . . . . . . . . . . . . . . . 400 Creating the New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 Coding the Web Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 Deploying the Web Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 Using the Web Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 Exercise 10.2. Connectable Web Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Adding the Filter Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Adding the Callback Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Modifying the SQL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Building and Deploying the Web Part . . . . . . . . . . . . . . . . . . . . . . . . . 410 Creating the Contact List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410

■CHAPTER 11 Programming SharePoint Services . . . . . . . . . . . . . . . . . . . . . . . 411 Understanding Site Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 Creating a New Site Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 Customizing the Site Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 Understanding the SharePoint Object Model . . . . . . . . . . . . . . . . . . . . . . . 421 Getting Started with the Object Model . . . . . . . . . . . . . . . . . . . . . . . . 421 Accessing Site Collections and Sites . . . . . . . . . . . . . . . . . . . . . . . . . 423 Elevating Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 Accessing Lists and List Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 Accessing User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426 Using SharePoint Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 Working with Site Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 Working with List Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 Using the Single Sign-On Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 Setting Up SSO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 Using SSO in Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 Exercise 11.1. Creating a Site Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 Copying the Site Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 Modifying the Configurations Section. . . . . . . . . . . . . . . . . . . . . . . . . 444 Modifying the Modules Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Using the Site Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Exercise 11.2. Building a Site Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Adding the Web Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Returning All Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Adding Child Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 Running the Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

xv

xvi

■CONTENTS

■CHAPTER 12 SharePoint Operations and Administration . . . . . . . . . . . . . . 451 Using Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Creating a Target Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Performing a Backup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 Performing a Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 Using Logs and Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 Working with the Unified Logging Service . . . . . . . . . . . . . . . . . . . . . 455 Working with Portal Usage Reporting . . . . . . . . . . . . . . . . . . . . . . . . . 456 Working with Information Management Policy Usage Reports . . . 458 Configuring Caching Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 Understanding Cache Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 Configuring Output Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 Configuring Object and Disk Caching . . . . . . . . . . . . . . . . . . . . . . . . . 462 Using Windows Rights Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 Preparing for RMS Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Installing the RMS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 Configuring RMS in the SharePoint Farm . . . . . . . . . . . . . . . . . . . . . 467 Using RMS with Documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 Configuring Antivirus Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 Quiescing the Farm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 Cleaning Up Unused Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 Implementing Quotas and Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 Using the Command-Line Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 Exercise 12.1. Creating a Log Viewer Feature . . . . . . . . . . . . . . . . . . . . . . 474 Creating the ULSLogViewer Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 Creating the Feature File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 Creating the Manifest File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 Deploying the Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484

■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487

About the Author ■SCOT HILLIER is an independent consultant and Microsoft Most Valuable Professional (MVP) focused on creating solutions for information workers with SharePoint, Office, and related .NET technologies. He is the author of ten books on Microsoft technologies. When not writing about technology, Scot can often be found presenting to audiences ranging from developers to C-level executives. Scot is a former naval submarine officer and graduate of the Virginia Military Institute. Scot can be reached at [email protected]. Support for his books can be found at http://www.sharepointstuff.com.

xvii

About the Technical Reviewer ■SAHIL MALIK (http://www.winsmarts.com) is a Microsoft MVP (C#), an INETA speaker, and the author of a best-selling ADO.NET 2.0 book. He is a consultant, a trainer, and a mentor in various Microsoft technologies. His talks are high-energy, highly charged, and highly rated. Sahil blogs about various technical topics at http://blah.winsmarts.com.

xix

Acknowledgments M

y relationship with Apress now spans three years and four books. Over the course of my career, I have written books for several houses, but none of them were as easy to work with. The Apress organization continues to have a great team that consistently produces quality books. I’d first like to acknowledge Gary Cornell and his leadership at Apress, which he is responsible for creating and building. I’d also like to thank Jim Sumser for managing my relationship with Apress prior to this work. Jonathan Hassell took over from Jim as lead editor for this book and assembled a first-class team. Leading off the team was the technical editor, Sahil Malik. Without exception I can say that Sahil is the single best technical editor I have ever worked with. His suggestions were detailed, pointed, and accurate. This book is better because of his efforts. Elizabeth Seymour was the project manager for the book and kept everything rolling along so we could meet our deadlines. Thanks also to Jennifer Whipple for her efforts in copy editing. A final thanks as well to Kelly Winquist for managing the production process. Along with the Apress team, I’d also like to thank all of the Microsoft Most Valuable Professionals for SharePoint. This diverse group of people continues to be tremendously valuable in bringing key information, tips, and techniques to the development community. Throughout the writing process I shared thoughts with other MVPs, many of whom were writing their own books. We freely exchanged ideas and solutions that will ultimately make all of the SharePoint books better regardless of the author. Thanks everyone. Every time I write a book, I am reminded of the importance of family. Writing late into the night, early in the morning, and on weekends definitely has an impact on everyone around you. I am fortunate to have such a wonderful family that supports me completely. Nan, we have known each other now for 26 years and have been married for 20. Everything I have ever accomplished I owe to your support. Thanks for being my best friend. Ashley, we are so proud of you; you are a blessing. We can’t wait to see where life will take you, but we miss you, so come home sometimes! Matt, you are the son every parent wants; we continue to be amazed at your wisdom, grace, and talent. Thanks to everyone.

xxi

Introduction W

ith SharePoint now in its third release, many developers and users are well familiar with its core functionality. However, this version of SharePoint is truly astonishing in its scope. Not only does this version have the familiar sites, documents, and lists, but it also supports vast new capabilities in content management, document management, records management, and business intelligence. Along with these capabilities, this version of SharePoint has many new ways to integrate data and create customized solutions. For me, the combination of businessoriented capabilities and advanced solution-development techniques has always been the basis of my enthusiasm for SharePoint. In fact, this is the perspective that I have tried to bring to this book; I want to combine business needs and technical skills to create solutions that truly impact business. You can be the judge of how well that vision has been reached.

Who This Book Is For Many years ago, I asked a colleague what professional developers wanted in a book. He responded simply “Code they can steal.” I have never forgotten this advice and it has been the foundation of every book I have written since. This book is therefore targeted squarely at the intermediate to advanced developer in a corporate environment with a pending SharePoint project. Readers do not have to have any prior experience with SharePoint to be successful with this book. However, readers should be well-versed in .NET development with C# to get the most out of the book. Furthermore, readers should be ready to make a commitment to this book. I have constructed the book with the intent that it be read cover to cover. I have also defined a development environment in Chapter 2 that I use throughout the book. The bottom line is that this book should be thought of as a technical training course as opposed to a reference manual. If you approach it that way, you will get the maximum benefit.

How This Book Is Organized I began my technical career training professional developers in Visual Basic 3.0. As a result, my writing style and chapter organization reflect a training class. Each chapter in the book begins with an explanation of the appropriate foundational concepts followed by practical exercises to reinforce the explanation. A brief description of each chapter follows.

Chapter 1: SharePoint Business Solutions This chapter is an overview of SharePoint solutions from a business perspective. Although this is a technical book, this chapter will help you understand and consider the environment into which your solutions will be deployed. This is some light reading before you get started. xxiii

xxiv

■INTRODUCTION

Chapter 2: SharePoint Overview, Planning, and Installation This chapter is the foundation for the entire book. In this chapter you will learn the planning and installation considerations for SharePoint. Additionally, you will set up a development environment that can be used throughout the book. You should not skip this chapter because its information is assumed throughout the rest of the book. Plan on spending a few days with this material to properly set up your SharePoint environment.

Chapter 3: SharePoint Fundamentals This chapter provides an overview of the fundamental capabilities of SharePoint You’ll use this information to get a fully functional SharePoint farm and create your first sites. You’ll also learn about new capabilities in this version that specifically target weaknesses from previous versions of SharePoint.

Chapter 4: SharePoint Shared Services This chapter completes the configuration of critical services within your SharePoint farm. You’ll configure and use search, profiles, audiences, Excel Services, and the Business Data Catalog. This chapter is mandatory for anyone working with the Microsoft Office SharePoint Server (MOSS).

Chapter 5: SharePoint Content Development and Management This chapter covers the new content management capabilities of SharePoint. You’ll learn how to add new pages to sites and manage the deployment process. This chapter also shows you how to create and apply themes, master pages, and style sheets. If you want to customize the look of SharePoint, this chapter will show you how.

Chapter 6: SharePoint Document, Form, and Records Management This chapter covers all of the integration points between SharePoint and documents, forms, and records. You’ll learn the basics of metadata and how to interact with it. You’ll also learn how to deploy forms in libraries and through the new InfoPath Forms Services technology. Finally, you’ll set up a records library and apply retention policies to archived documents.

Chapter 7: SharePoint Custom Features and Workflows Customization of SharePoint begins in earnest with this chapter. Here, you’ll learn how to create your own custom features for adding items to menus, adding new administrative pages, making changes to the infrastructure, and receiving event notifications. This chapter also covers how to create workflow solutions with both the SharePoint Designer and Visual Studio.

■INTRODUCTION

Chapter 8: SharePoint Business Intelligence Solutions This chapter focuses on creating dashboards within the new Report Center. You’ll learn how to create scorecards with stoplights to represent key performance indicators (KPI) and how to integrate Excel spreadsheets to show data. This chapter also shows how to integrate SQL Analysis Services and SQL Reporting Services with SharePoint.

Chapter 9: SharePoint and Microsoft Office This chapter covers all of the different ways to create solutions with Office 2007 products. You’ll learn how to create add-ins for Office and make them part of a SharePoint solution. You’ll also learn about the new open XML file formats and how they can be integrated with SharePoint.

Chapter 10: SharePoint Web Parts This chapter provides complete coverage of creating and deploying web parts in SharePoint. You’ll learn about the web part life cycle and how to code the new ASP.NET 2.0 web parts that are used by SharePoint. You’ll also learn how to create web parts that can be connected together to act as filters. Finally, you’ll learn to create solution files for deploying web parts to the SharePoint farm.

Chapter 11: Programming SharePoint Services This chapter provides the fundamentals you’ll need to get started programming against the SharePoint object model and web services. You’ll learn the basics of accessing SharePoint programmatically and manipulating site information, user information, lists, and libraries. This chapter also covers the Microsoft Single Sign-On service.

Chapter 12: SharePoint Operations and Administration This chapter provides all of the foundational information you will need to properly administer a SharePoint farm. You’ll learn how to back up and restore a farm, get reports, and monitor the infrastructure. You’ll also learn how to improve SharePoint performance with caching mechanisms.

xxv

CHAPTER

1

SharePoint Business Solutions A

lthough this book is packed full of solution examples and plenty of code, I’ve always thought it is important to frame the context of these solutions inside of the business environment they target. A successful SharePoint solution must take into account the overall direction Microsoft is going, the vertical marketplace in which your organization operates, and the willingness of end users to adopt new technologies. Therefore, I’ll indulge in a little digression from my charter in this chapter. If you’re just dying for some code, flip to the middle of the book and breathe deeply. Then come back and take a few minutes to read this chapter and think about the environment in which you are deploying SharePoint. Before I begin a discussion of the details, I want to point out that the term SharePoint does not actually refer to any particular product or technology. Instead, it is an umbrella term that hangs over several products and technologies that have specific names. In general, however, most people use the term to mean any solution based on either Windows SharePoint Services (WSS) or the Microsoft Office SharePoint Server (MOSS). This is how I will use the term throughout the book, even though many Microsoft people frown on this usage.

The SharePoint Marketplace The 2007 release of SharePoint and the Microsoft Office 2007 suite marks a significant milestone in the effort to create a single unified platform for information-based work. This is the third version of SharePoint products and technologies to be released by Microsoft, and it is substantially more powerful than any of its predecessors. Over the next three to five years the effect of this release will be felt by all organizations that have an infrastructure based on Microsoft technology. As of this writing, the market for enterprise collaboration software is somewhere in the neighborhood of $1.5 billion and is projected to approach $2.5 billion by 2010. By all accounts, SharePoint products and technologies have the largest number of licensees in this market, with volume exceeding 30 million. However, these numbers don’t tell the whole story because this release of SharePoint and Office clearly extend beyond the market for enterprise collaboration into areas such as content management and business intelligence. WSS is at the core of SharePoint and can rightfully be considered enterprise collaboration software. However, MOSS goes well beyond this narrow definition. MOSS is a superset of WSS functionality and includes sophisticated publishing, business intelligence, and workflow capabilities. Using MOSS, organizations can not only create collaborative spaces, but can also deploy departmental intranets, public-facing Internet sites, business intelligence dashboards, 1

2

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

formal workflow processes, and enterprise-wide search capabilities. My point is that SharePoint products and technologies—particularly MOSS—actually embody what were previously three or four separate products crossing three or four different market segments. This is why I believe that SharePoint products and technologies will have such a massive impact on organizations that choose to adopt them. Therefore, it is important to consider the people, systems, and processes into which SharePoint will be deployed. In the following sections, I present a loose framework for understanding the roles of people within a typical organization and the challenges they face, and how various SharePoint solutions may be applied.

Segmenting Information Workers These days everyone talks about the “knowledge economy” and “information workers.” These terms were used originally to acknowledge that many economies were moving away from traditional manufacturing toward the management of information. As globalization continues to take hold, however, we are realizing that everyone needs better management of information in order to compete effectively. In fact, we now see that most workers use information within the framework of a business process, regardless of their jobs. Everyone from the controller analyzing financial data to a repair crew with a work order on a wireless device is an information worker. When building solutions for these information workers, however, it is useful to segment them into three different groups so we can better understand their needs: transactors, professionals, and executives.

Transactors Some information workers use a single line-of-business system all day long. This group is known as transactors. Transactors are front-line workers who often create or enter data into systems. For example, a designer using a computer-aided design (CAD) system to create a model is a transactor. The designer primarily uses the CAD system all day and creates new data used by the organization. Customer service representatives in a call center are also transactors. They primarily use a single system all day and enter new data about customers. Because other information workers rely on the new data produced by transactors, this data must be effectively integrated into any SharePoint solution so that it becomes available to support business processes.

Professionals Professional information workers must access multiple line-of-business systems and may use any number of them throughout the day. They have access to customer data systems, product data systems, and financial systems. Their primary work environment, however, is usually the Microsoft Office suite. Professional information workers are generally sending e-mail, writing documents, or building spreadsheets. They often log in to a line-of-business system, but they do it primarily to retrieve information so they can continue to work in an Office product. The classic example of a professional information worker is the controller who logs into a financial system simply to copy data into an Excel spreadsheet for analysis. The goal is to create a financial model in Excel, but the data is in several different systems. In fact, many professional

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

information workers have essentially become “human middleware” that glues together seemingly disparate information from multiple sources into a single document. Eliminating human middleware is one of the primary goals of any SharePoint solution.

Executives Executives must monitor and adjust business processes based on key performance indicators (KPI). These KPIs tell the executive information worker whether the organization is healthy and functioning correctly. When KPIs indicate that a business process is not healthy, executives must be able to analyze information in order to adjust the business process. Delivering KPIs to executives in a way that supports managing organizational performance is a key part of any SharePoint solution.

Grouping Information Workers Another useful way to think about information workers is in groups of various sizes. This means giving consideration to the needs of the individual all the way through the larger organization that includes partners and customers. This is because all information workers accomplish their tasks in concert with others. Therefore, any solution you create with SharePoint should properly address these groups.

Individuals Understanding the needs and behaviors of individuals is perhaps the most important requirement for success in any project. Projects that fail do so most often because individual users fail to adopt the new system. Even if everyone believes the end users would be happier and more productive using the new systems, they often fail to change their habits. Because of this, it’s appropriate to ask “What do individual users want?” I think the short answer is a simple and repeatable way to get their jobs done. Most end users are not enamored with technology and see change as an impediment to their productivity, even if that change would eventually result in a better experience. Practically speaking, this means simplifying the virtual environment. Successful solutions will provide clean and obvious interfaces that end users can utilize to access the most important documents, information, and applications. Although MOSS provides a specific type of site, called My Site, that is intended for individual productivity, adoption of this capability has been limited in my experience. Users overwhelmingly prefer Microsoft Outlook as their primary interface to the enterprise because e-mail is such an integral part of their day. To this end, Microsoft Outlook 2007 has many enhancements that make it a much stronger tool for individuals working with SharePoint products and technologies. I discuss these enhancements throughout the book.

Departmental Teams As you move from the individual to a team, the dynamics of system adoption change. Because teamwork is done in a more public setting and under the guidance of a leader, it is easier to get a team to adopt new ways of working. Therefore, you have a better opportunity to make improvements.

3

4

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Departmental teams typically consist of a small number of people (less than ten) working together to accomplish a goal. The goal is usually limited in scope and easily understood by the team. These types of teams typically struggle, however, with communications and collaboration. Task management and information sharing are the primary areas of need. This, of course, is a historical sweet spot for SharePoint.

Divisional Groups At the divisional level, information workers tend to need broad categories of information that help them understand their roles in the larger organization. The type of functionality found here includes access to vital line-of-business systems, work processes such as purchasing, and information pertaining to related divisions. Additionally, management at this level becomes more complex and requires some form of electronic reporting. SharePoint solutions at this level often consist of document management, dashboard, and searching capabilities that aggregate information from many sources.

Enterprise At the enterprise level, information workers are typically dealing with policies, practices, and regulations that govern their work. At this level, management communication and guidelines are critical to bind the various groups together. Furthermore, individual information workers do not spend much of their day working at this level. They might receive an e-mail from the corporate president or read a newsletter online. SharePoint solutions at this level often take the form of intranets.

Extended Enterprise Reaching beyond the boundaries of the organization to involve partners, suppliers, and customers is becoming increasingly critical. This level includes marketing, sales, support, and shared processes with partners. While these things were possible with previous versions of SharePoint, the capability was not strong. With the latest release, MOSS can be used to create a complete public Internet site as well as a secure extranet site for customer or partner interaction.

Information Worker Challenges Global competition, or globalization, is now the major economic force shaping business decisions. The traditional long-term relationship between companies and their employees is extinct. Companies are constantly looking for ways to make employees more productive in an increasingly competitive marketplace, cut costs, and improve productivity. For their part, employees are typically less loyal to their companies. Today’s employees are just as likely to start their own businesses as they are to bring new ideas to their employer. At the same time, technology is creating an increasingly complex work environment. All of these factors combine to create special challenges for businesses and information workers around system complexity, information, processes, collaboration, access, and management.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

The System Challenge When the desktop metaphor was introduced, it offered a simplified mechanism for interacting with a new, complex, and often scary appliance—the personal computer. The success of the desktop metaphor was that it simplified interaction with a computer. Nontechnical people were not required to learn complex function key combinations in order to use the computer. This metaphor—and, above all, its simplifying effect—was responsible for the success of graphic operating systems. Early on, of course, there were several operating systems from several vendors that used the desktop metaphor. Each of these—Apple, IBM, and Microsoft—were competing to dominate the personal computer market. As a result, vendors began to include more functionality in the operating systems. Instead of just a file explorer, computers were loaded with all kinds of applets for managing every aspect of the computer. Vendors even shipped the computer with simple games that became a standard part of the operating system. Later, after Microsoft had established clear dominance with Windows, it used the operating system to compete against other companies that introduced new technologies. The most famous example of this is the fight over the Netscape browser. Ultimately, Microsoft was found guilty of using its operating system to unfairly compete against Netscape. However, the constant fear of a small rival suddenly taking over the marketplace has consistently driven Microsoft to add more and more features to its operating system. As a result, the typical desktop is now awash in functionality. You not only have every line-of-business application you need to do your daily job, but you also have CD players, DVD players, and games. You have three or four different document editors available to you. You have two or three ways to get e-mail. Applications have followed suit as well by adding more and more features, reports, and integration points. The desktop and the applications it hosts are complex all over again. Along with mounting complexity, information workers are also faced with a lack of standards for application behavior and integration. The most obvious example of this problem can be seen in the use of passwords. Users are now forced to maintain upward of ten different sets of credentials to access all the client-server, browser-based, and Internet applications they need on a daily basis. Typically, each of these applications has different rules for password length and design. The result is that users are unable to remember all of their credentials without recording them somewhere, which threatens the entire network security system. Not only must information workers manage several sets of their credentials, they also must have intimate knowledge of the data sources utilized by applications. A typical example of this intimate knowledge is when an application login screen prompts an information worker to select the database or domain he or she wants to access. This seemingly simple request actually forces an end user to understand the network topology of the organization. This is an unnecessary burden to place on an information worker. This same intimate knowledge is also required to access file servers, mapped network drives, and printers. Considering the three categories of information workers reveals that most organizations are structured in a manner that only supports transactors. Because transactors work primarily with a single line-of-business system, they can easily log in to one system and be productive throughout the day. However, professionals and executives face a chaotic environment that actually works against them because they require information from multiple sources synthesized into documents and reports.

5

6

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

The Information Challenge Because the information that professionals and executives need to support the organization is locked up in separate isolated systems, they tend to work around the systems by getting much of their information from other human beings. I find that most people will spend some time looking through systems for information, but they rapidly become frustrated and simply send an e-mail to the person they think is most likely to have a copy of the information. Typically an e-mail is sent with a query such as “Can you send me the link to that file again?” or “Do you have the latest document template?” The response to these queries is usually an e-mail with a hyperlink embedded or a document attached. The e-mail is then stored in the recipient’s personal Outlook folder so he or she can use it again in the future. This situation results in information workers becoming what I call “human search engines.” I once worked with a company that hired a consulting organization to help it create formalized procedures for its information workers. The consultant that was leading the project did a great job identifying the processes, documenting the procedures, and creating the documents. Additionally, he created a special filing system on a network drive to store all of the procedures. The only problem was that no one understood the filing system except him. At the end of the project, the company was forced to hire the consultant as a full-time employee simply to help other people locate the various process documents. In fact, I can testify that this person has no other job than to receive requests for documents and respond by sending copies attached to e-mail. This is a true human search engine. How many of these do you have in your organization?

The Process Challenge While many organizations have defined some level of business process, most organizations have no way to support it beyond attaching documents to e-mail. Professionals who are creating documents and spreadsheets typically need some form of review and approval, so they simply attach the document to an e-mail for routing. Recipients who are involved in the review and approval process have no formal mechanism for tracking comments or minding versions of the document, so they often respond by sending e-mail with suggested changes, comments, or observations. The document creator must subsequently synthesize all the mail into a set of changes and route the document again. Nearly all organizations can force the processes to work, but the processes never improve. The people involved in the process will continue sending e-mail, attending meetings, and working late until the document is completed and approved. However, two problems result from this approach. The first problem is that the organization typically loses all of the historical knowledge generated in the process. This means that when a similar document is created, the organization cannot benefit from any previous work. The inefficient process is simply started all over again. The second problem is that the inefficient process delays the time to market. Organizations may miss critical deadlines, work overtime, or hire additional people as they wrestle with an unsupported, chaotic process.

The Collaboration Challenge Increasingly, information workers are being asked to work on teams where the members are located in other geographies and time zones. However, most organizations have no means

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

beyond e-mail to facilitate the work of these virtual teams. Consequently, e-mail is functioning not only as a process engine, but also as a collaboration tool. You can see this in the dozens of conversational e-mails you receive every day. A large part of all corporate e-mail traffic is being used to facilitate collaboration, reach consensus, and make decisions. More recently, many organizations have adopted some form of instant messaging system to try and cut out the conversational e-mails clogging the system. Unfortunately, for most information workers, however, this has become yet another task master demanding attention. Because it is so easy to send an instant message, I often see desktops full of multiple conversations. Furthermore, many of these conversations are not urgent, but they constantly interrupt the information worker with sounds and pop-up windows. The result is that low-level conversations actually get more attention because of the intrusive nature of instant messaging. Just as organizations lose information when they use e-mail as a process engine, the same thing happens when e-mail is used as a collaboration engine. Information is duplicated in e-mail messages sent to multiple recipients, and no one really knows which copy is the true working version. When comments come back from recipients, they must be placed back in the original document by hand. Along with facilitating collaboration, e-mail also serves most people as their global task list. When I describe e-mail as a global task list, I am referring to the practice of keeping an e-mail as a reminder to take an action. You might, for example, keep an e-mail from a customer as a reminder to follow up on a sales opportunity. It doesn’t even matter if the e-mail you keep has anything to do with the action you want to take. Keeping the e-mail makes you think about the customer and reminds you to follow up. People use their e-mail as a global task list because they have no other tool that shows them all the tasks they have to perform for an organization. But this results in the average professional information worker having dozens or even hundreds of e-mails in their inbox with no organization or prioritization. Add your instant messages to that burden and you’ll do nothing except answer mail all day. Along with e-mail, shared file systems are often routinely misused to facilitate collaboration. Nearly all organizations have some form of shared file system that is made available to information workers for storing documents. In most cases, the information workers have complete read/write access to these servers. They can create directories and save documents at will. Unfortunately, once a file server is open to information workers, it quickly becomes a chaotic mess. Most file servers are exposed to information workers as mapped network drives. Information workers can access these drives directly from their own computers and are encouraged to store critical files on the drive so that they can be properly backed up. However, the directory structure of these file servers is a nightmare. No one can remember where they are supposed to create new directories and often don’t remember where they have previously stored a file. This results in different versions of the same file being stored in several directories with no one able to determine which one is the most recent.

The Access Challenge Increasingly, information workers are working from locations other than the central company headquarters. Workers today are highly mobile; they work from home, they work from the road, and they work from other countries. They need constant access to systems even when they are completely disconnected from a network. Information workers carry BlackBerry

7

8

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

devices, smart phones, and wireless computers. Partners and customers increasingly expect to be able to access appropriate information contained in your systems. All this means that solutions built for information workers must have a well-conceived access strategy that exposes information to the appropriate audience.

The Management Challenge As if the complexity and variety of information systems were not enough, organizations are also faced with an explosion of data contained in these systems. A typical organization might have as many as eight customer databases crossing several isolated systems such as customer relationship management (CRM), enterprise resource planning (ERP), multiple spreadsheets, and documents. Each of these systems has a reporting mechanism to access the data, but there is generally no way to see all of the data together to create a single view of a customer, a supplier, or a partner. Consequently, organizations are forced to create manual systems to collect and analyze information. Executive information workers need visibility into business processes in order to judge the health of the organization and make adjustments. This process of analyzing KPIs against goals followed by adjusting the business processes is known as performance management. Most executives really have no effective means beyond simple reports to manage the organizational performance. Furthermore, these reports are often nothing more than spreadsheets created by professional information workers who route them to executives via e-mail. As a result of this situation, many executives have simply given up trying to proactively manage organizational performance. Instead, they examine financial data and try to make strategic adjustments after the fact. All of this is to say that the computing environment for most end users has become unbearably complicated. In this environment, end users are crying out for simplicity and consolidation. They need tools that give them a more personal view of enterprise resources to cut through the layers of complexity and make them more productive. Stop for a moment and consider the role of Microsoft Outlook in most organizations. Microsoft Outlook is truly the workhorse of corporate America. Outlook is often the first application an end user opens at the beginning of the day and the last one closed at night. Why? The answer is because end users are trying to impose simplification by using Microsoft Outlook to access their enterprise resources. Think about it. Your organization may have a document management system, but you generally get your documents as e-mail attachments. Your organization may have an enterprise reporting system, but you get your reports through e-mail as well. This is because end users do not want to use the document management client or wade through the hundreds of reports available in the enterprise reporting system. These systems are too painful to access and too complicated to use. What’s more, the end user has probably forgotten her password for the document management system and isn’t about to spend 30 minutes on the phone with the help desk to get it reset. System complexity and variety, overwhelming amounts of data, and work-style challenges have all led end users to a frustrating relationship with their computers. They are begging for simplification, but each new effort rolled out by the IT department only seems to add to the problems. The key to solving this problem lies in creating a user experience that truly consolidates and simplifies.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

The Regulatory Challenge No one in business has to be told these days about the impact of regulations. This is especially true if you are part of a public company, but it is increasingly true for everyone. Not only is compliance a necessity, but organizations must also be much more vigilant about identifying and maintaining records so that they are available for audit or discovery. This has become a significant problem in a world where e-mail is functioning as a process and collaboration engine. Most organizations have no effective way to understand what information is contained in their e-mail systems. Yet, estimates are that as much as 50% of all organizational knowledge now resides in e-mail inboxes and public folders. For organizations trying to comply with record retention regulations, this is an impossible situation. There is no way to know what e-mail is important, so many organizations simply save it all. This is a massive amount of information to store and will be nearly impossible to search later.

Understanding Business Scenarios SharePoint products and technologies form a versatile set of building blocks that you can use to solve a variety of business problems. Unlike most technical solutions, however, a SharePoint implementation has the ability to transform the way in which an organization works. This is because SharePoint touches nearly all aspects of daily operations. SharePoint solutions can bring together information in the form of documents, forms, records, scheduling, communications, transactions, and reporting. This information can then be delivered to employees, partners, and customers.

Increasing Individual Productivity Perhaps the most obvious and straightforward scenario involving a SharePoint deployment is the improvement of personal productivity for employees. I have already addressed in detail the system and data challenges that are facing users of the Windows desktop, but a productivity solution based on SharePoint products and technologies can also be used to make relevant applications, documents, and data available to end users more quickly. The typical end user spends a significant amount of time searching for documents and information each day. This is essentially lost productivity, while users browse document management systems, reporting systems, or the Internet. Documents are easily lost on file servers because no standards for file taxonomy, naming, or version control are in use. What’s more, business users are often frustrated by technical barriers such as mapped network drives or server names. A SharePoint solution can bring immediate relief to this situation through the use of enterprise search capabilities. MOSS ships with an enterprise search feature that allows you to search nearly every information repository in your organization. This includes documents, people, databases, and web sites. Figure 1-1 shows a view of the Search center with results.

9

10

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Figure 1-1. Search center

Increasing Team Productivity Along with personal productivity solutions, SharePoint products and technologies can also create team productivity solutions. Increasingly, team productivity is a vital part of business success. Today, most organizations have some combination of formal teams and ad hoc teams. The formal teams are often fixed and departmentalized whereas the other teams may form spontaneously or for a limited time. SharePoint products and technologies support both kinds of teams. Because formal teams are generally long-lived, a SharePoint solution may contain several fixed sites for these teams. These sites may be created during an initial rollout and then enhanced over time. For these types of teams, SharePoint Portal Server (SPS) supports both document and meeting workspaces where team members can collaborate even if they are not physically present. Along with meetings and documents, team members can also take advantage of threaded discussion forums that facilitate collaboration even if team members are not present in both time and place. Figure 1-2 shows a typical team site in WSS. Ad hoc teams can benefit from the same collaborative features enjoyed by formal teams, but the sites that host these groups may be created on the fly. SPS is a truly decentralized model. The philosophy is intended to support team building and productivity from the boardroom to the company softball team. A collaborative solution focused on team building may give site-creation permissions to many individuals who can then easily create team sites from directly within the portal.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Figure 1-2. A team site

Increasing Divisional and Enterprise Productivity At the division and enterprise level, SharePoint products and solutions can be used by management personnel to better understand performance and make adjustments. Figure 1-3 shows a management dashboard created in the Report Center. The Report Center is designed to be the single place in the enterprise that provides information on organizational performance. Beyond performance management, SharePoint sites can also be used to improve communication within the organization. This can be accomplished by using SharePoint as the basis for the corporate intranet. In support of this role, MOSS also has special publishing capabilities that allow intranet—and Internet—content to be created, routed, approved, and published.

11

12

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Figure 1-3. Report Center

Supporting Remote Workers Increasingly, the concept of a central place where employees commute to perform work is fading. Organizations today have more telecommuters, distant offices, and mobile workers than ever before. For organizations, this has typically meant an increase in support costs. Remote workers often require high-end laptops, remote synchronization, wireless connectivity, and more client-side software. Using a SharePoint solution focused on remote workers, organizations can eliminate some of the maintenance required to support them. Solutions built around SPS may be made accessible outside of an organization’s firewall. Using this type of approach, an organization can make sites and services available to employees as long as they have an Internet connection. This means that telecommuters can easily access required resources with less software installed on their local machine. For mobile workers, such a solution can ease the burden of data synchronization by integrating such operations within the portal. Figure 1-4 shows a SharePoint solution running on a mobile device.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Figure 1-4. A site on a mobile device

Integrating with Partners and Customers Because SharePoint solutions can be safely exposed outside the firewall, they make excellent platforms for integrating with customers and partners. SharePoint now supports forms-based authentication so that external users do not have to be members of the organization’s domain in order to log in. This means that you can place an entire SharePoint site within the DMZ and safely publish information for partners and customers. Figure 1-5 shows a typical SharePoint login form.

13

14

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Figure 1-5. Logging in to an extranet

Complying with Regulations Records management has become an increasing concern for organizations that need to comply with regulations. Identifying critical e-mail and documents, applying retention policies, and protecting documents from change are all key parts of a record management strategy. In this version, MOSS provides a record repository template that you can use to store and control key documents. Documents can be sent to the repository manually or as the result of a workflow process. When documents expire, they can be automatically deleted or initiate a workflow process. Figure 1-6 shows an example of the records repository in MOSS.

Figure 1-6. Using a records repository

ae1c89095f95abda90126f30663a4984

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Analysis and Design Considerations SharePoint can be remarkably easy to install. In fact, if you follow the single-server deployment strategy, you can have SPS up and running in 45 minutes. However, that does not mean that it is simple to create an effective business solution using SharePoint products and technologies. The key to properly designing a SharePoint solution is to spend the required time to identify the business problem to be solved and the expected result. Once you understand the solution, you must document the roles, policies, and systems that constitute the solution. Finally, you must design a solution that incorporates all of the elements in a way that solves the original business problem.

Documenting the Business Vision For as long as I have been involved in designing software solutions, teams have always agreed in principle that identifying the business problem and understanding the return on investment (ROI) are critical to the success of every project. However, I have rarely seen a team actually engage in these activities, and in the end, this often is a leading factor in the failure of a project. Shortcutting required analysis is a fact of life in the information technology world, and it is driven equally by managers and engineers. On the management side, project sponsors are frequently unable to articulate the expected return from a technology project. When interviewed, managers are incapable of explaining the productivity increases or cost savings that are expected from a technology effort. Instead, they rely on a vague feeling that the mere presence of a tool, or portal, will surely help the organization be better. On the technical side, most engineers are not trained to look at technology issues as essentially business problems. Instead they look at business issues as primarily technology problems. The typical technical thought process asks the following question: What data does the end user need? Then it asks this: What application provides that data? The solution then is to deploy the application that provides the data and declare the problem solved. A solution based on SharePoint products and technologies is a web of solutions to a myriad of problems. Organizations considering such an implementation would do well to begin by interviewing key project sponsors to document the expected company benefit from such an effort. Sponsors should be clear about the expected productivity increases or cost savings associated with the effort. Use this exercise as a litmus test for the entire project. If a significant return cannot be envisioned for the project, it may not be worth the effort. If the return is determined to warrant the project effort, the correct process is first to create a vision document. The vision document is the first deliverable of the project. This document articulates the business problem, proposed solution, and expected benefit. This document is the highest-level guidance for the project. It acts as the beacon to which the team is headed. In well-run projects, the vision is periodically revisited to ensure that no extraneous effort is expended and that the team is correctly implementing the vision and achieving the desired results.

15

16

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Documenting Policies, Practices, and Regulations Once the vision document is completed, the next step is to document the policies, practices, and regulations that will constrain the use of the solution. Policies, practices, and regulations act as boundary conditions for the solution. Successful projects exist within these boundaries while solving the original business problem. Policies are restrictions placed on the organization by its management and articulated as simple statements. For example, the statement “company credit cards are not to be used for personal expenses” is a policy that restricts the use of a company credit card. Similarly, the statement “only port 80 will be open on the firewall” is also a policy. This policy restricts the use and configuration of the company infrastructure. Policies are not easily changed; therefore, a successful project must identify the policies that constrain it. Practices are similar to policies in that they act as boundary conditions on the solution design. However, practices are more closely associated with the tactical processes used by the organization to do business. For example, the use of an approved vendor list to simplify the purchase process is a practice. Practices are less formal than policies, but they can easily be just as limiting on the final design. Policies and practices exist at many levels in an organization. Some policies may apply to an entire organization whereas others may be specific to a single process. Initially, you should try to identify the policies and practices that are most likely to constrain the general use of a solution. As the effort matures, you will identify departmental processes constrained by additional policies, practices, and regulations. As a starting point, consider the following common areas where policies, practices, and regulations may affect the initial deployment: allowing external access, negotiating service-level agreements, accessing the application, managing content, and addressing regulatory requirements.

Allowing External Access If external access will be allowed, then document the policies for authentication. Determine whether a simple username and password will be sufficient, or whether stronger measures will be required. Specifically, you should determine whether Secure Sockets Layer (SSL) and certificates will be required. Along with system policies, determine whether users will be required to access the solution utilizing a two-factor authentication system such as RSA SecurID. SecurID tokens act as virtual ATM cards for the portal. In order to access the portal, users must possess the token and know a personal identification number (PIN). The passcode generated by the token changes every 60 seconds, so a user must be in possession of the token at the time of login. The PIN is a fixed set of numbers known only to the user. The combination of these two elements to complete a login request is the reason it is called two-factor authentication. When combined with SSL and certificates, such access schemes are exceedingly hard to hack. In addition to considerations about personnel access, you should document policies for system deployments. Determine what parts of the system will be deployed behind the firewall or in a DMZ. All of these issues arise early in a development project and will affect the final design significantly.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Negotiating Service-Level Agreements Based on the business vision, you should determine the expected availability for the solution. If the solution is functioning as little more than an intranet, perhaps no significant impact will occur if it goes down. On the other hand, some organizations are utilizing the portal as the primary workspace for employees. In this case, a formal service-level agreement should be negotiated for the system. Along with a service-level agreement, the solution may have to be part of the disaster recovery/business continuity plan. Again, based on the business vision, determine whether the criticality of this system warrants a replicated site on the disaster recovery network. If so, make disaster recovery an integral part of the project plan. I have seen many organizations ignore this point and roll out a solution as “just a pilot.” These same organizations turn around a few months later and realize they have a single point of failure in their system architecture and a gaping hole in their disaster recovery plan.

Accessing the Application Determine the policies and practices you will use to provide application access. This includes both internal and external access along with the method of authentication. Additionally, the Microsoft vision of SharePoint incorporates tight integration with Office 2007. If this is in line with your company vision, you must evaluate your current Office deployment. Give thought to any planned upgrades and how you will handle installation and maintenance on the client machines.

Managing Content Documents and other content are a significant part of a SharePoint solution. Therefore, organizations must document the policies and practices that determine how the content is created, posted, and managed. Determining the policies and practices surrounding content will have a lot to do with the culture of the organization. In its heart, SharePoint is a distributed solution. This means that it is structured to allow easy content creation and posting. Additionally, sites and subsites can be created without necessarily requiring centralized approval. Many organizations find this philosophy incompatible with the traditional centralized approach to information technology. Administrators do have significant control over permissions granted to portal users; however, every organization will have to determine which people will be responsible for creating and maintaining content. This may be a formal system where each department has a content manager, or it may be a freewheeling approach that lets nearly anyone create a site on the fly and populate it with relevant content. In any case, you should consider these issues carefully before you begin designing the portal.

Addressing Regulatory Requirements SharePoint solutions allow you to create and manage content through its entire life cycle. In order to properly design a solution, you should identify the content that must be retained for regulatory or historical purposes. For each type of content, you should gather the retention requirements and define what to do when the retention period ends.

17

18

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Project and Design Documents SharePoint products and technologies are best thought of as a solution platform. This means, however, that it is impossible to define exactly what constitutes a SharePoint solution and therefore what design deliverables are required. I have seen many SharePoint projects that are nothing more than installing WSS and turning a departmental team loose. While this approach may violate several planning and change principles, it certainly is not a project that requires layers of design documents. On the other hand, I have also been part of unique projects that utilize forms, documents, search, and workflow to implement specific processes. In these projects, good documentation—specifically use cases—is invaluable. Furthermore, SharePoint solutions are iterative by nature; as users become more familiar with the environment, you end up fine-tuning your solution. As a result, you must decide for each project how much documentation is needed. The danger here, however, is that it’s just so easy to start customizing in SharePoint. While this is not necessarily a bad approach for small projects, it can also lead to a maintenance nightmare if entire departmental or enterprise solutions are approached in this way. Instead of customizing many sites individually, for example, creating a single site template that can be used over and over will be much more efficient.

Managing Change During a presentation, a customer once asked me to describe the most difficult issue surrounding a SharePoint deployment. My answer was immediate. I responded “It’s the same issue as every other project—managing the change for the end users.” Change management is the process that helps end users adopt new ways of doing business, and it is never easy. Despite its ability to affect the success of a project, change management is rarely considered in sufficient detail. In my experience, this is because the team is primarily concerned with correctly implementing the technical solution. What’s more, technical teams really are not trained to help users through the change management process. Successful change management is about educating and assisting end users. Every good project must involve some key elements to help end users adapt and be productive. Scheduling end-user training is an obvious first step, but it is rarely enough to ensure success. Instead, consider the entire group of end users and have a complete plan to manage the change. Begin by mentally dividing the end users into three groups. The first group is the set of people who are excited about the project. This group can be a strong ally in your effort to bring others through the change process. The second group is the set of people who are neutral about the project. This group is waiting to see if the project will be successful before they get behind it. The last group is the set of people who are openly hostile toward the project. This group does not want to change and is typically very vocal about it. Although the third group is the loudest and cries for the most attention, it should be largely ignored. Instead, I like to start a pilot with the first group. Don’t worry about the traditional approach of piloting your project with a particular department. This approach is too narrow and invites people from all three groups into the pilot. This will surely result in someone from the third group declaring the project a disaster. Just locate the most enthusiastic people you can—regardless of department—and start a pilot.

CHAPTER 1 ■ SHAREPOINT BUSINESS SOLUTIONS

Piloting with enthusiastic people guarantees good press. This means that the people in the second group—the ones who are waiting for success—will begin to hear good things about the project. This will result in more people from the second group becoming enthusiastic and joining the first group. Now you can expand your pilot to include more people. In this way, you can continue to build momentum for the project. This strategy can save you a lot of heartache when rolling out something with as much organizational impact as a portal.

19

CHAPTER

2

SharePoint Overview, Planning, and Installation B

efore planning a SharePoint installation, you should have a strong understanding of the intended purpose. You should identify whether the installation will serve sites on the intranet, extranet, or Internet. You should also determine how many users and documents the system must support. Finally, you need to decide if the system is mission-critical or if downtime can be tolerated. In this chapter, I walk you through the major components of SharePoint and help you plan your installation. At the end of the chapter is a complete installation procedure you can use to create a development environment for use with this book.

Windows SharePoint Services Windows SharePoint Services (WSS) is an application framework that is primarily designed to facilitate collaboration among teams through customizable web sites known as team sites. Team sites are secure, document-centric sites that provide a set of tools for sharing documents, tracking progress, and communicating with colleagues. Within a team site, document libraries provide basic document management capabilities. Task lists, contact lists, discussion forums, and calendars provide the means to coordinate and track associated work, which can be automated through workflow processes. All of these tools are managed through an administrative interface designed to allow groups to service themselves. Figure 2-1 shows a typical team site in WSS.

21

22

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Figure 2-1. A WSS team site

Document Libraries Every WSS team site you create may have one or more document library associated with it. A document library is like a mini document management system with check-in, checkout, version control, and approval capabilities built right in. Document libraries are intended to contain all of the documents that a team needs to accomplish a business function. These documents may be Office documents built into the Office suite or they may be non-Office documents such as Adobe Acrobat files, text files, e-mail, or even media assets. Just about any document may be stored in a document library. It is true, however, that there are several special integration points between Office documents and SharePoint that are not extended to other file types. I cover these special integration points throughout the book. Figure 2-2 shows a typical document library in a WSS team site. Document libraries also support an event system that you can tap into programmatically. These events can call into .NET assemblies when new documents are placed in a library, modified, or deleted. This version of WSS also comes with its own workflow engine. Based on the Windows Workflow Foundation, the engine provides simple workflow processes such as document approval out of the box. Power users can develop more sophisticated workflows using the SharePoint Designer (formerly called Microsoft FrontPage) while developers can create custom workflows with Visual Studio 2005 and harness all the power of the .NET Framework.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Figure 2-2. A document library

Lists Teams really need more than just document information in order to accomplish a business purpose. For example, teams may need a task list, a list of contacts, or a calendar to facilitate and coordinate their efforts. This type of information all falls under a broad category in WSS simply called lists. In the previous version of WSS, lists used a different underlying infrastructure than document libraries. In the 2007 version, lists and libraries are essentially the same thing to SharePoint, although they are seen by users as quite different. Lists in WSS can be lists of anything, but most often they take the form of information typically found in Microsoft Outlook. In fact, many list types can be synchronized with information contained in Outlook. For example, you can create a list of key contacts on a WSS team site and synchronize it with your contact list in Outlook. Just like document libraries, lists are also capable of raising events that you can trap in code. Lists can also participate in workflow processes. Figure 2-3 shows a typical task list in a WSS team site.

23

24

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Figure 2-3. A task list

Web Parts and Custom Development Along with documents and lists, teams may also need functionality that is not a part of SharePoint out of the box. Adding this functionality is accomplished using a SharePoint technology called web parts. Web parts are .NET assemblies that add customized functionality to a site where normally a developer might use ASP.NET code. This version of WSS utilizes ASP.NET 2.0 web parts, which are the same web parts you can use in your own custom ASP.NET applications. Additionally, this version has complete backward compatibility for web parts created in the 2003 version. I cover the various ways to customize SharePoint through code in the second half of this book. The latest version of WSS is built on top of ASP.NET 2.0, so developers can take advantage of the .NET Framework 2.0. Furthermore, Microsoft has done away with the previous approach of using an ISAPI filter to intercept HTTP requests for processing by SharePoint. Instead, WSS now utilizes an HttpModule and an HttpHandler that are registered inside of the web.config file. This approach gives WSS more stability by ensuring that an ASP.NET context always exists before any custom code is run. The HttpModule and HttpHandler allow the incoming page request to be processed by WSS and the appropriate HTML is constructed on the fly for return to the calling client. The web pages you see in a WSS site do not actually exist on the web server. Instead they are constructed from a combination of page templates located on the file system and data contained in the Content Database. The Content Database is a SQL Server 2005 database that maintains all of the web page definitions, documents, lists,

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

and security information. This means that SharePoint products and technologies require an associated SQL Server 2005 installation. It also means that all documents in document libraries are saved in the Content Database as binary large objects (BLOB).

Site Creation and Branding In previous versions of WSS, it was very difficult to create a new type of site that differed dramatically from the out-of-the-box templates. To accomplish this task, you had to create a new site definition using an XML language known as the Collaborative Application Markup Language (CAML). Even after these site definitions were created, branding the site remained challenging and was often accomplished by extensively modifying individual pages in Microsoft FrontPage. WSS also introduces a new concept for deploying site functionality called a Feature. A Feature with a capital F—is a modular approach to defining a site. Using this new capability, developers can create packages of web parts, workflows, or other customizations that may be turned on and off by site administrators. This approach allows Features to be reused across sites, which makes the WSS site infrastructure much more maintainable. For controlling site styling, WSS now takes advantage of ASP.NET master pages. Master pages were introduced in ASP.NET 2.0 and provide a way for developers and designers to specify the basic look and feel of a site in just one place. The master page defines colors, styles, and visual elements—often called the chrome—that will appear on every page. It is now possible to brand a significant portion of a site by changing a single file. In the past, many developers were reluctant to use Microsoft FrontPage for customizations because it would cause a site to become “unghosted.” Unghosting refers to a situation in which an individual page is separated from its site definition. This separation could lead to strange behavior and performance issues in the previous versions of WSS. In the latest version of WSS, unghosted pages are now called customized pages, and modifying an uncustomized page in the SharePoint Designer will still cause it to become separated from its site definition. However, the performance issues have now been eliminated, and the SharePoint Designer will even allow you to revert a customized page back to its uncustomized state. While there are still good reasons to avoid customizing pages—such as when you are rolling out many sites with the same branding—the improvements in the SharePoint Designer make it a serious option for organizations that need a tool specifically for nonprogrammers and content creators.

Microsoft Office 2007 Microsoft Office 2007 is the most significant revision to the Office suite in ten years and is the result of countless hours of user testing by Microsoft. The entire user interface has been completely reworked around the central concept of a ribbon. The ribbon interface is designed to group functions together by activity. This approach is intended to make it easier for users to find commands that might have been buried deep in a menu tree in previous versions. Beginning and intermediate users of Office are likely to adopt the new interface quickly and become more productive as they discover new commands exposed on the ribbon. Advanced Office users, however, will probably react negatively to the new user interface because it is completely different, and familiar patterns of clicking will no longer work. In fact, I see this as the

25

26

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

greatest obstacle to rolling out the new Office suite because advanced users with dozens of linked spreadsheets, for example, will have to relearn the interface before they can be productive again. Figure 2-4 shows the new ribbon interface in Word 2007.

Figure 2-4. The Office ribbon

Document Panels Just like Office 2003, Office 2007 is tightly integrated with SharePoint. Along with the ribbon interface, Microsoft has also changed the interface Office users see when working with SharePoint. The Shared Workspace available in Office 2003 still exists, but it has been replaced as the primary view into WSS team sites. Instead, users will now see two panels that appear beneath the ribbon interface called the Document Information Panel (DIP) and the Document Action Panel (DAP). The DIP is a view of the metadata associated with the current document. The purpose of the DIP is to make metadata visible throughout the document editing process so that users can update the information as they determine the right values. The goal is to get better metadata through a nonmodal interface as opposed to the old approach of demanding all the metadata values when the document is saved to a library. Additionally, you can synchronize the DIP with the document so that metadata is filled in automatically as the document is created, or document text is automatically added when a user enters metadata. Figure 2-5 shows the DIP.

Figure 2-5. The Document Information Panel

The DAP is a view of tasks associated with the document that apply to the current user. These tasks become visible when the document is associated with a workflow in SharePoint. These tasks can involve review, approval, content creation, or any other activity dictated by an associated workflow.

Working Offline, While Mobile, or With Peers With this version of Office, Microsoft has made significant improvements in the offline capabilities of WSS. The primary tool for working with WSS data offline is Microsoft Outlook.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Outlook has the ability to synchronize with many different types of WSS data including lists, calendars, tasks, discussions, contacts, and document libraries. This means that users can, for example, take an entire document library offline, edit the documents, and then synchronize their changes later. Mobility has improved as well with the ability to create sites that specifically target mobile devices. WSS sites are also enabled with Really Simple Syndication (RSS) and Outlook is equipped with an RSS reader. This means that end users can subscribe to SharePoint RSS feeds and collect all of the information in Outlook. However, RSS will not allow users to write data back to a WSS site. You can, however, send e-mail to lists in this version of WSS, which can include attachments that get saved into SharePoint. With the acquisition of Groove Networks, Office now has the capability to support peerto-peer integration with WSS sites and other users. Utilizing Microsoft Groove, end users can get documents from a WSS site and then take advantage of the peer-to-peer capabilities of Groove to share and edit the documents with others. Groove also makes an excellent offline solution with more capability than Microsoft Outlook alone. The capabilities of Groove are beyond the scope of this book, but they are worth investigating for those organizations where peer-to-peer capabilities may be beneficial.

Microsoft Office 2007 Suites Microsoft Office 2007 is available in no less than eight different suites. The suites range from Microsoft Office Basic 2007—containing Word, Excel, and Outlook—to Microsoft Office Enterprise 2007, which contains all of the standard Office products plus Communicator and Groove support. In this book, I cover all of the advanced integration and development techniques with Office products; therefore, I assume that you have one of the advanced suites available. Specifically, you should have the Microsoft Office Ultimate 2007, Microsoft Office Professional Plus 2007, or Microsoft Office Enterprise 2007 suite. Information on all the suites can be obtained at http://office.microsoft.com.

Microsoft Office SharePoint Server The Microsoft Office SharePoint Server (MOSS) is a significant new product with broad and deep capabilities designed to support a wide variety of enterprise functions to manage content, present business intelligence data, automate workflow processes, manage records, and build both public and private web sites. Although MOSS can be thought of as the next version of SharePoint Portal Server 2003 (SPS), it is really a completely new product. Its organizational structure and customization patterns are much different than those of SPS. MOSS is based entirely on WSS technology and is a true superset of WSS functionality. Every enhancement you create in WSS will function identically in MOSS. This also means that the end user experience is consistent between MOSS and WSS. Navigation elements, styles, and site organization are the same whether you are in MOSS or WSS. This is a far cry from SPS, which often seems to have no relationship at all to WSS. For those who experienced SPS, you will find that the old Topic and Area structure has been eliminated in favor of a more flexible interface that can easily be changed.

27

28

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Portal Features Many of the portal features of MOSS will be familiar to anyone who has worked previously with SPS. Although the look and feel of MOSS more closely resembles the current version of WSS than the previous version of SPS, familiar capabilities of SPS such as Audiences, Profiles, My Site, and Single Sign-On (SSO) have been retained. These features differentiate a true organizational portal from a simple team collaboration site and should be thought of as one of the primary differences between MOSS and WSS. Audiences in MOSS are used to target content at portal users. Within MOSS, you may define an audience based on user attributes such as membership in an Active Directory group. Then you may use that audience definition to show or hide content when a page is viewed. MOSS user profiles allow you to define, search, and present metadata about portal users. Profiles draw information from Active Directory to provide basic information such as first name and last name, but you may also extend the metadata to include custom fields such as languages spoken or areas of expertise. Additionally, these custom fields can even be derived from other systems, for example like PeopleSoft. Once defined, profiles can be a search scope that allows users to locate people within the organization. Along with their profile, every MOSS user can also be given their own personal site— called My Site. My Site functions as a personal workspace for MOSS users and allows them to organize their own documents and information. Through My Site, users may connect to colleagues, manage their profiles, and be alerted when key information changes somewhere in MOSS. Although SSO services were available in SPS, my experience is that they were rarely used. In MOSS, however, SSO takes on new meaning, because it is used to facilitate access to several new features such as data in line-of-business systems. SSO allows you to specify a set of credentials for accessing a secondary system and then give those credentials an application name that may be invoked later by either a MOSS feature or your own custom code.

Enterprise Content Management Enterprise Content Management (ECM) is a broad term that refers to managing the entire document life cycle from ideation through archival. This includes not only the same workflow capabilities I described earlier for WSS sites, but also the ability to archive these records and apply retention policies to them. Additionally, ECM encompasses web content management (WCM) to support the creation, approval, and deployment of web sites. MOSS supports several different templates that allow organizations to create both public and private sites. One of those templates allows you to create a records repository that you can use to archive documents according to a document retention policy. Documents may be added to the records repository either manually from within a SharePoint document library, or automatically by associating a workflow with a retention policy. In the latter case, a document could, for example, be routed through a review process and then sent to the repository after it has reached a certain age. It might also be good to mention at this point that both WSS and MOSS have a recycle bin that works similarly to the Windows Recycle Bin and allows a single document to be recovered if it is inadvertently deleted. Along with documents, MOSS also manages web content. Prior to the release of MOSS, the Microsoft Content Management Server (MCMS) was the primary way that organizations created, approved, and published web content. With the release of MOSS, MCMS is being

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

retired. The major capabilities formerly in MCMS have been moved to MOSS. This includes creating page templates with content placeholders, implementing approval processes, and deploying pages in bulk from separate development environments to production environments. Figure 2-6 shows a typical MOSS page template in design mode with content being added to placeholders on the page.

Figure 2-6. Modifying page content

Business Intelligence Business intelligence represents a key area where MOSS brings many new capabilities that were unknown in previous versions of SharePoint. One of the MOSS templates available out of the box is a Report Center template designed to act as a hub for business intelligence data. While business intelligence capabilities can be utilized anywhere within MOSS, the Report Center template is specially designed to support report distribution and the creation of key performance indicator (KPI) dashboards. Reports can be delivered either by creating Excel spreadsheets or by designing reports in Microsoft Reporting Services. KPI dashboards can be created either by hand or by connecting them to a spreadsheet or an analysis cube built in SQL Server 2005. Along with these features, MOSS also supports two new server-based versions of Office products: Excel Services and Office Forms Server. With these servers, you can distribute Excel spreadsheets and InfoPath forms to end users even when they do not have Excel or InfoPath installed. This means that spreadsheet-based reports and dashboards can be delivered over the web without exposing critical data or calculation formulas to users. It’s also now possible to expose InfoPath forms over the web to traveling personnel, customers, and partners who might need to fill out a form but do not have the InfoPath client available.

29

30

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Rounding out the business intelligence feature set is the Business Data Catalog (BDC). The BDC is a new no-code mechanism for exposing line-of-business data within MOSS. Using the BDC, you can define the data structure in back-end systems such as your customer relationship management (CRM) system or human resources database. This data may then be mapped into web parts for easy searching, displaying, and filtering.

Shared Services Many of the advanced capabilities of MOSS are configured and delivered through a Shared Services Provider (SSP). The SSP allows you to configure things such as Enterprise Search, Excel Services, and the BDC one time and then use them across many different MOSS and WSS sites. Because you can configure multiple SSPs in the same farm, this architecture gives you the flexibility to expose specially configured services where you want them. For example, you may configure an SSP with a public search for use on the Internet, and another SSP with a private search for use on the corporate intranet.

MOSS Versions While WSS is a free component, MOSS must be licensed separately. MOSS comes in several different versions that target different deployment scenarios and have different licensing requirements. Regardless of your scenario, however, every organization using MOSS must purchase the base MOSS 2007 server license. Along with the server license, you must also purchase the appropriate client access licenses (CAL) to meet your needs. For general use, MOSS comes in a Standard and an Enterprise edition. The Standard edition gives you access to the basic set of MOSS functionality, including content management, workflow, and collaboration. The Enterprise edition includes the functionality of the Standard edition but adds the BDC, Excel Services, Office Forms Server, and more. Additional versions allow you to use MOSS solely for deploying Internet sites or separate features such as the Office Forms Server. In this book, I always assume that you have the MOSS 2007 Enterprise edition available.

Installation Considerations Planning for a WSS or MOSS deployment is not trivial. There are many issues to consider as you try and decide exactly how much hardware and what configuration is necessary to support your end users. The Microsoft Office System technical library (http://technet2.microsoft.com/ Office/en-us/library/3e3b8737-c6a3-4e2c-a35f-f0095d952b781033.mspx?mfr=true) is an excellent resource for performing detailed planning, and I will not try to repeat all of that information in this chapter. However, there are some fundamental considerations worth covering that will provide you a framework for deciding what type of deployment you will need.

User Capacity Planning Whenever I discuss SharePoint infrastructure with customers, they almost immediately jump on user capacity. This is because we tend to think of systems in terms of how many people are going to use them. However, determining the actual number of people who can

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

access a SharePoint infrastructure is based on so many variables as to be nearly meaningless. First of all, you must consider the usage profile. Light site usage for simple browsing might mean that you can support three to five times as many concurrent users as you can if people are performing heavy queries and displaying complicated data views. Performance will also be affected by whether the activity is distributed across the farm or concentrated in a single area. In any case, even a single-server deployment is good for several hundred concurrent users on a typical day with typical activity. The total latency of a SharePoint farm is split about evenly between server-side processing and client-side processing. On the server, latency is affected by ASP.NET processing, trips to the database, and security trimming designed to remove all of the menu actions that are inappropriate for the current user. On the client side, latency is affected by client-side scripting and asynchronous processing (e.g., AJAX) as well as the quality of the client machine. The biggest impact on latency, however, is poorly designed custom web parts. When web parts make too many round trips to the database or exhaustively recurse the SharePoint object model, latency increases dramatically. Before deploying any new web part, you would be wise to profile its performance and address areas that will cause excessive latency.

Storage Capacity Planning Storage capacity is a major planning point in any SharePoint deployment. Since all of the pages, lists, and documents are stored in SQL Server 2005, you must adequately size the disk space to support not only your initial needs, but also to allow for growth over a period of years. Start by considering any existing documents that you want to migrate to SharePoint. For these documents, plan on having disk storage equal to one and a half times the total size of the documents to be migrated. Additionally, you’ll need another 30% for indexing the new content, and an additional 60% for the search server. Finally, you’ll need to consider growth, including the number of versions that will be created. This is calculated by assuming an average document size multiplied by an average number of versions. Table 2-1 details the planning formulas and shows an example based on migrating 100GB of existing documents with an average file size of 1MB and planning for five years of growth. Table 2-1. Calculating Storage Requirements

Item

Formula

Example

Existing documents

1.5 ✕ file size

1.5 ✕ 100GB = 150GB

Indexes

30% of document storage

150GB ✕ .3 = 45GB

Search server

60% of document storage

150GB ✕ .6 = 90GB

Growth

Average document size ✕ average number of versions ✕ documents created annually ✕ years

1MB ✕ 5 ✕ 10,000 ✕ 5 = 250GB

Access and Authentication Planning SharePoint offers new capabilities that make it a much stronger choice for extranet and Internet applications than it was previously, with templates specifically designed to support applications both inside and outside the firewall. Because SharePoint now also supports

31

32

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

several different authentication providers including NT LAN Manager (NTLM), Kerberos, and Forms authentication, you should give some thought to access and authentication to determine the best combination.

NTLM and Kerberos Integrated Windows Authentication is the simplest form of authentication for browser applications where the end user has a Windows account. Whenever a user browses to a site that uses Integrated Windows Authentication, the browser sends a token to the server identifying the Windows account of the user. If the server can authenticate the user with this information, access is granted. If the server cannot authenticate the user, a login box appears prompting the user to enter credentials manually. Both NTLM and Kerberos are forms of Integrated Windows Authentication. NTLM uses a challenge-response protocol to authenticate the client to the server. It begins when the client attempts to connect to a secure application. The server sends a challenge to the client, and the client responds with a hashed value that the server can use to validate the user and password. All of this is seamless to the end user who simply sees the requested web page open in the browser. NTLM is simple, works well, and developers have often been able to ignore authentication concerns because it was essentially transparent. As security concerns have grown, however, the need for a more secure authentication provider has become increasingly obvious. This is where Kerberos comes in to the picture. Kerberos is a ticket-based authentication protocol. When a client wants to access a secure application, it requests a ticket from the key distribution center (KDC), which is the server running Active Directory. The KDC then creates a ticket based on the user credentials stored in Active Directory. The ticket is then sent back to the client, which can only use the ticket if it has the correct password. Once the user is authenticated, the ticket is cached locally where it remains until it expires. Kerberos has several advantages over NTLM that SharePoint developers should care about. First, Kerberos has much better performance than NTLM. Because Kerberos caches credentials, servers can respond more quickly than under NTLM. Kerberos is also more secure than NTLM because the client can essentially authenticate the server as well as have the server authenticate the client. The biggest reason for developers to care about Kerberos, however, is delegation. Take a step back and consider the process of connecting to a WSS team site using NTLM authentication. We know that NTLM will successfully authenticate a user that has a Windows account and grant access to the team site, which will then appear in the browser. While most of the page content will appear correctly, what if a web part on that page displays information from a line-of-business system with its own separate database? The web part itself must also authenticate against this other database. What credentials does it use? In many cases, we want the web part to use the same credentials as the current user. In other words, we want the web part to impersonate the current user. SharePoint sites are set up so that web parts will initially impersonate the user accessing them. The user credentials may subsequently be passed to any system residing on the same server as SharePoint or on a different server that requires only a single additional authentication. If the data source requires a second authentication—like when you access a web service, which subsequently accesses a database—the impersonation will fail. This is typically referred to as the “double-hop” issue.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Kerberos, on the other hand, supports impersonation across machines. This type of extended impersonation is known as delegation. If the end user were authenticating to the team site using Kerberos, the web part would successfully authenticate to the line-of-business database and information would appear in the page. It’s important to point out that Kerberos requires some additional configuration that can only be accomplished if you have rights to Active Directory. Additionally, there are other ways to solve the double-hop issue. Many developers, for example, utilize a SQL Server standard security account buried in a connection string that a web part uses to access the database. The MOSS SSO service can also be used to gain access to any system in the enterprise. The bottom line, however, is that Kerberos is superior to NTLM in several ways and you should utilize it where you can. In the exercise in this chapter, “Creating a Development Environment,” I detail the steps necessary to set up and configure Kerberos.

Forms Authentication One of the reasons that previous versions of SharePoint have not been ideal candidates for extranets is that they did not directly support forms-based authentication. Therefore, organizations would often have to create a separate domain for partners and customers where they could be assigned a Windows account for authentication. Under SharePoint 2007, however, you can now implement forms-based authentication and utilize a data store such as SQL Server to manage the accounts. I discuss setting up forms authentication in Chapter 3.

Limitations SharePoint has several limitations that you should keep in mind as you are planning your deployment. Generally, the limits presented here are not hard limits, but exceeding them can cause performance degradation. The limits are typically quite large and you’re unlikely to run into most of them, but it is possible. For example, you could easily exceed the recommended 2,000 documents per folder unless you plan your document migration accordingly. When examining the SharePoint limits, you’ll see references to several terms that are specific to SharePoint. In SharePoint, a web application refers to an Internet Information Server site that has been extended with SharePoint. Each web application may contain one or more site collection. A site collection is typically a complete intranet, extranet, or Internet implementation. A site collection is made up of one or more sites. A site is a dedicated section of the site collection for team collaboration, business intelligence reporting, records management, or the like. Sites contain lists and documents and may have subsites underneath them. Table 2-2 lists the SharePoint limits associated with these terms. Table 2-2. SharePoint Limitations

Item

Limit

Number of site collections in a web application

50K

Number of sites in a site collection

250K

Number of subsites nested under a site

2K

Number of lists on a site

2K Continued

33

34

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Table 2-2. Continued

Item

Limit

Number of items in a list

10M

Number of documents in a library

2M

Number of documents in a folder

2K

Maximum document file size

2GB

Number of documents in an index

50M

Number of search scopes

1K

Number of user profiles

5M

Deployment Architectures SharePoint may be deployed in several different architectural configurations from a single server utilizing SQL Server Express to a multiserver farm with an active-passive SQL cluster. The exact deployment architecture will be based on the number of users, storage requirements, and availability requirements. Small team-based installations may be able to use a single server while large Internet presence sites will need a farm. Table 2-3 lists the various configurations and their specifications based on an average corporate user with an average amount of activity. Table 2-3. Deployment Architectures

Configuration

Users

Sites

Documents

Index

Availability

Single server

500

1,000

10K

100K

Low

Small farm

5,000

Thousands

Tens of thousands

Hundreds of thousands

Low

Medium farm

100,000

Tens of thousands

Hundreds of thousands

Hundreds of thousands

High

Large farm

500,000

Tens of thousands

Millions

Millions

High

Single-Server Configuration A single-server deployment of WSS or MOSS can be created on a server that has a 2.8GHz processor with 2GB of RAM and a 100GB hard drive. In this scenario, you would utilize SQL Server Express to create the required databases directly on the server without the need for a separate installation of SQL Server 2005. This deployment is remarkably easy to set up by simply running the WSS or MOSS installation and following the steps. However, this is the least reliable configuration because everything obviously relies on the availability of a single machine.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Small Farm Configuration System performance can be improved by moving the database off of the single server and onto its own server. This requires a separate installation of SQL Server, but improves performance significantly because all database operations can happen on the separate server. However, this configuration is really no more reliable than the single-server configuration because it is still vulnerable to a single failure.

Medium Farm Configuration True enterprise reliability begins with the medium farm configuration. In this configuration, the web front-end servers, application server, and database servers are separate. A typical configuration would have two front-end web servers, a single application server, and an activepassive SQL Server cluster. Generally, these servers are dual-processor machines with at least 4GB of RAM and upward of 200GB hard drives. Performance and reliability in this configuration are greatly enhanced by separating the required functions across machines.

Large Farm Configuration The large farm configuration is a scaled-out version of the medium farm configuration. In the large farm, upward of four front-end web servers are used to handle hundreds of thousands of users. An application server and active-passive SQL Server cluster are employed in the same way as the medium farm configuration. This configuration is typical for a large Internet presence site.

Exercise 2.1. Creating a Development Environment As discussed in this chapter, there are several different configurations you can use to set up a SharePoint environment. You can, for example, install WSS on a single server using the Express version of SQL Server and work many examples in the book. However, the exercises in this book assume that you have a certain development environment available when specifying the steps to follow. This means that if you create a development environment that differs significantly from the one described in this exercise, you may experience some difficulty getting certain examples to work. Furthermore, the examples and exercises will deal with features of both WSS and MOSS. Therefore, if you do not install the Enterprise edition of MOSS, you will not be able to work exercises that specifically require it. I have included setup instructions for WSS in this exercise because I recognize that many readers will have easy access to WSS while MOSS requires a separate license.

■Tip Even if you are not going to use the Enterprise edition of MOSS in your production environment, you can still get a trial version free for 180 days. The download and trial keys are available at http:// www.microsoft.com/downloads/details.aspx?FamilyID=2e6e5a9c-ebf6-4f7f-8467f4de6bd6b831&DisplayLang=en.

35

36

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

I have chosen to specify a development environment from scratch assuming you have no existing domain controller, e-mail server, or web server. My infrastructure will consist of three servers—a domain controller, a web server, and a database server—in a medium farm configuration. I have selected this configuration because it is not overly complex, but it will allow you to get a feeling for the farm installation process. The only difference between the infrastructure described here and a production environment is that I would normally include an application server in the farm for handling expensive operations such as indexing. In this exercise, all of the services will reside on the web server. Additionally, I will utilize Kerberos authentication throughout the farm. You may choose to complete this exercise without using Kerberos; however, you may have some issues later with authenticating web parts or assemblies using NTLM. Generally, I recommend using Kerberos authentication whenever it is practical to do so. You will need to be a domain administrator to properly configure Kerberos authentication. For maximum flexibility, I recommend creating the development environment using Microsoft Virtual Server 2005 virtual machines. Virtual machines allow you to create multiple operating system installations on a single hardware platform, which can be reconfigured to set up various scenarios. Using virtual machines, for example, would allow you to create a development environment that can easily switch between MOSS and WSS. In this exercise, I include the instructions for downloading and installing Microsoft Virtual Server 2005. This exercise is not intended to walk you through an exhaustive screen-by-screen installation of the required software. Instead, I focus on special areas of the installation where you need to configure the software or take special care to ensure a correct installation. Generally, I assume that you have some idea of how to install Microsoft server products, but I will try to give enough guidance to keep you from going astray.

Prerequisites In setting up the development environment, I use a single dual-processor server running Microsoft Virtual Server 2005. If you are using Microsoft Virtual Server 2005 to create your development environment, you must meet the minimum requirements to create and run virtual machines. In order to ensure that you have a trouble-free environment, I recommend that you install the software on a server-class machine with at least a 3GHz processor and at least 4GB of RAM (more is better). If you are not using virtual machines, you must have servers that meet the minimum requirements for Windows 2003 operating systems, SQL Server, and SharePoint. Generally speaking, you should strive to have machines with at least a 3GHz processor and at least 2GB of RAM. Table 2-4 lists the virtual machines I created and the software installed on each. When using virtual machines, I connect them to the required software through the use of an ISO file. An ISO file is a complete image of a CD-ROM or DVD, which can be mounted to a virtual machine. Once mounted, the ISO file appears as a CD or a DVD drive in the virtual machine. ISO files can be created using many popular disk-burning software titles such as Nero (http://www.nero.com), and are available directly through Microsoft subscription downloads for those readers with access to a software subscription.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Table 2-4. Machine Configurations

Machine

List of Software

VSPDC

Microsoft Windows Server 2003 R2, Active Directory, POP3 service

VSSQL

Microsoft Windows Server 2003 R2, SQL Server 2005

VSMOSS

Microsoft Windows Server 2003 R2, Microsoft .NET Framework 3.0, Microsoft Office SharePoint Server, Visual Studio 2005

VSWSS

Microsoft Windows Server 2003 R2, Microsoft .NET Framework 3.0, Microsoft Windows SharePoint Services, Visual Studio 2005

VSCLIENT

Microsoft Vista, Microsoft Office Ultimate 2007

Next, if you are using Microsoft Virtual Server 2005, proceed to the next section, “Section 1: Installing Virtual Server 2005.” Otherwise, proceed to “Section 3: Creating the Domain Controller.”

Section 1: Installing Virtual Server 2005 In this section, you’ll download and install Microsoft Virtual Server 2005. Because you’ll need several virtual machines for the development environment, my strategy will be to create one base operating system and then make copies of it for the other machines. This is possible because of the portable nature of the virtual hard drive (VHD) files used by Virtual Server. Before a base image can be copied, however, it must be processed using a utility called SYSPREP. SYSPREP guarantees unique identifiers for each of the operating systems you clone from the original base image. Microsoft Virtual Server 2005 is available as a free download from Microsoft at http:// www.microsoft.com/windowsserversystem/virtualserver/software/default.mspx. When you link to this address, you will be able to download the software after logging in using a Windows Live identity. The software is contained in a single self-extracting executable named SETUP.EXE. After downloading the software, simply run the executable and perform a complete install. Figure 2-7 shows the virtual machine management panel in Microsoft Virtual Server 2005. Once the software is installed, follow these steps to create the base machine image: 1. Log into the server where Microsoft Virtual Server 2005 is installed as a local administrator. 2. Select Start ➤ All Programs ➤ Microsoft Virtual Server ➤ Virtual Server Administration Website. 3. In Virtual Server Administration Website, select Virtual Machines ➤ Create. 4. On the Create Virtual Machine page, type VSIMAGE in the Virtual Machine Name field. 5. Specify a value in the Virtual Machine Memory. 6. Specify a size for a new Virtual Hard Disk. 7. Select External Network from the Virtual Network Adapter drop-down list. 8. Once the values are specified, click the Create button.

37

38

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

■Tip If possible, run your VHD files on separate disks. This will greatly improve performance.

Figure 2-7. Managing virtual machines

Section 2: Creating the VPC Images In this section, you will create the base virtual PC (VPC) image that you will use to create the other virtual machines. Creating this image is accomplished by installing the operating system onto a virtual machine and then preparing the image for cloning. Once created, we’ll use this image in the rest of the exercise to make setup easier.

Getting Started In this section, I walk through a moderately detailed procedure for setting up Windows 2003 Server. In subsequent sections, I simply direct you to copy the base image. To get started, boot the server using the Windows Server 2003 R2 CD-ROM. Follow these steps to boot the virtual machine: 1. On the Virtual Server 2005 home page, select Configure ➤ VSIMAGE. 2. On the VSIMAGE Status page, click the CD/DVD link. 3. On the VSIMAGE CD/DVD Drive Properties page, specify the complete path to the ISO image for the Windows 2003 Server R2 software. 4. Click the OK button to return to the VSIMAGE Status page. 5. On the VSIMAGE Status page, select VSIMAGE ➤ Turn On.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Once the virtual machine is started, you may either click the screen thumbnail to view the session or utilize the Virtual Machine Remote Control Client to view the session. The Virtual Machine Remote Control Client is located in the Microsoft Virtual Server Program Group. I prefer to use the Virtual Machine Remote Control Client because it has a full-screen mode.

Formatting the Partition When prompted during the installation, be sure to format the installation partition using the NTFS file format. SharePoint products require the NTFS file format.

■Caution The hard drive that you use to store your VHD files must also be formatted as NTFS. Many external USB hard drives are formatted as FAT32 by default.

Naming the Server When prompted during installation, name this machine VSIMAGE. When you use this image to make copies later, you will change the copied machine name to match the entries in Table 2-4.

Skipping the Domain When prompted during installation, do not join an existing domain because this server will be used as the base image. Later when you create the other servers, you will join them to a new domain.

Post-Setup Security After the initial installation is complete, log on to the local machine as the system administrator. The Windows Server Post-Setup Security Updates page appears automatically. This page allows you to apply updates and configure automatic updates for the server. Once you have completed these tasks, click the Finish button.

Virtual Machine Additions This is a good time to install the Virtual Machine Additions. These additions help improve the performance and stability of virtual machines. You can install them through the Virtual Server web interface under the Configurations section.

■Note Installing the Virtual Machine Additions can unmount the Windows 2003 Server installation disk. Verify that the installation disk is still available because you will need it for preparing the virtual image.

39

40

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Creating an Answer File Preparing the base virtual image for cloning is accomplished using a utility called SYSPREP. SYSPREP is available in the SUPPORT\TOOLS directory of the Windows 2003 installation disk. The utility, along with several other files, is contained in the file DEPLOY.CAB. In order to use SYSPREP, you must first create a configuration file known as an answer file. The answer file contains all of the information necessary to automate the operating system installation. Follow these steps to create an answer file: 1. Locate DEPLOY.CAB in the SUPPORT\TOOLS directory of the Windows 2003 installation disk. 2. Double-click the DEPLOY.CAB file to view the contents in the File Explorer. 3. Create a new directory at C:\Deploy and extract all of the files from DEPLOY.CAB into the directory. 4. Execute the file C:\Deploy\setupmgr.exe to begin creating the answer file. 5. On the Welcome screen of the wizard, click the Next button. 6. On the New or Existing Answer File screen, select Create New and click the Next button. 7. On the Type of Setup screen, select Sysprep Setup and click the Next button. 8. On the Product screen, select the version of the Windows Server 2003 operating system you are using and click the Next button. 9. On the License Agreement screen, select Fully Automate the Installation and click the Next button. 10. On the Name and Organization screen, type in values and click the Next button. 11. On the Display Settings screen, accept the default settings and click the Next button. 12. On the Time Zone screen, select your time zone and click the Next button. 13. On the Product Key screen, enter your product key and click the Next button. 14. On the Licensing Mode screen, make any changes you want and click the Next button. 15. On the Computer Name screen, type VSIMAGE in the Computer Name field and click the Next button. 16. On the Administrator Password screen, enter a password and click the Next button. 17. On the Networking Components screen, select Typical Settings and click the Next button. 18. On the Workgroup or Domain screen, leave the machine in the workgroup and click the Next button. 19. On the Telephony screen, click the Next button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

20. On the Regional Settings screen, click the Next button. 21. On the Languages screen, click the Next button. 22. On the Install Printers screen, click the Next button. 23. On the Run Once screen, click the Next button. 24. On the Additional Commands screen, click the Next button. 25. On the Identification String screen, click the Finish button. 26. When finished, save the file to C:\Deploy\sysprep.inf.

Prepping the Operating System Once the answer file is created, you can run the SYSPREP utility. The SYSPREP utility will prepare the image for cloning so that all subsequent copies have unique identifiers and will not conflict on the network. Once prepared, you must never start the base operating system image because it will undo all of the changes you make in this section. Follow these steps to prepare the base image: 1. Close all of the open windows in VSIMAGE. 2. Open a command prompt and execute C:\Deploy\SYSPREP.EXE. 3. When the warning dialog appears, click the OK button. 4. In the System Preparation Tool dialog, check the box labeled Don’t Reset Grace Period for Activation. 5. Ensure that the Shutdown Mode drop-down list is set to Shutdown. 6. Click the Reseal button. 7. When the warning dialog appears, click the OK button. 8. Wait until the system is prepared and shut down. 9. When the system is shut down, open the Virtual Server Administration web site. 10. On the Master Status page, select Remove from the fly-out menu associated with the VSIMAGE virtual machine. Next, if you are going to have a separate domain controller for the development environment, proceed to “Section 3: Creating the Domain Controller.” If you are going to join an existing domain, proceed to “Section 4: Creating the Database Server.”

Section 3: Creating the Domain Controller In this section, you will clone the base VPC image and create a domain controller. In my development environment, I use the VSPDC virtual machine as the domain controller. Although an Active Directory domain is not required for SharePoint to function, I assume its presence in this and many other exercises throughout the book.

41

42

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Cloning the Base VPC Once the base VPC image is prepared, it can be used to create as many images as you want. The basic process involves creating a new virtual machine without a hard drive and then attaching a copy of the prepared hard drive from the clone. When you first start the new image, it will subsequently be configured based on the options you selected in the answer file. Follow these steps to create a new cloned image: 1. Log into the server where Microsoft Virtual Server 2005 is installed as a local administrator. 2. Select Start ➤ All Programs ➤ Microsoft Virtual Server ➤ Virtual Server Administration Website. 3. In Virtual Server Administration Website, select Virtual Machines ➤ Create. 4. On the Create Virtual Machine page, type VSPDC in the Virtual Machine Name field. 5. Specify a value in the Virtual Machine Memory. 6. Select the option Attach a Virtual Hard Disk Later. 7. Select External Network from the Virtual Network Adapter drop-down list. 8. Once the values are specified, click the Create button. 9. Open the File Explorer and copy the VSIMAGE.VHD file into the directory where the VSPDC.VMC file was created. 10. In Virtual Server Administration Website, select Configure ➤ VSPDC. 11. In the Configuration section, click the Hard Disks link. 12. Click the Add Disk button. 13. Specify the complete path to the VSIMAGE.VHD file you just copied and click the OK button. 14. On the VSPDC Status page, select VSPDC ➤ Turn On.

Configuring the Domain Controller After you log in to the new virtual machine, you should immediately change the name to VSPDC. You should also configure the networking settings to a static IP address. Domain controllers function much better with static IP addresses. After the new server starts up, the Manage Your Server applet will open automatically. This applet can be used to set up the server in various roles. Follow these steps to set up the server as a domain controller: 1. From the Manage Your Server applet, select the right-facing arrow to add or remove a role to the server. 2. On the Preliminary Steps screen, click the Next button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

3. On the Server Role screen, select Domain Controller (Active Directory) from the list of available roles and click the Next button. 4. On the Summary of Selections screen, click the Next button to start the Active Directory Wizard. 5. When the Active Directory Wizard starts, click the Next button. 6. On the Operating System Compatibility screen, click the Next button. 7. On the Domain Controller Type screen, make sure the Domain Controller for a New Domain option is selected and click the Next button. 8. On the Create New Domain screen, ensure the Domain in New Forest option is selected and click the Next button. 9. On the Install or Configure DNS screen, select No, Just Install and Configure DNS on This Computer and click the Next button. 10. On the New Domain Name screen, enter the name of a new domain (I use domain.local and will refer to it throughout the book) and click the Next button. 11. On the NetBIOS Domain Name screen, click the Next button. 12. On the Database and Log Folders screen, accept the default values by clicking the Next button. 13. On the Shared System Volume screen, click the Next button. 14. On the Permissions screen, accept the default selection by clicking the Next button. 15. On the Directory Services Restore Mode Administrator Password screen, enter a password and then click the Next button. 16. On the Summary screen, click the Next button. 17. When the Wizard completes, restart the server.

Setting Up the POP3 Service In order to work with the many e-mail features of SharePoint, you will need an e-mail server with test accounts. Although you could certainly use Microsoft Exchange for this purpose, setting up a POP3 service uses significantly fewer resources, and SharePoint does not require Microsoft Exchange. Follow these steps to set up a POP3 service on the domain controller: 1. From the Manage Your Server applet, select the right-facing arrow to add or remove a role to the server. 2. On the Preliminary Steps screen, click the Next button. 3. On the Server Role screen, select Mail Server (POP3, SMTP) from the list of available roles and click the Next button.

43

44

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

4. On the Configure POP3 Service screen, enter the name of an e-mail domain (I use domain.local and will refer to it throughout the book) and click the Next button. 5. On the Summary of Selections screen, click the Next button to start the installation. 6. When the installation is complete, click the Finish button.

Adding Users and Groups to the Domain After the domain controller is installed, you must add required users and groups to Active Directory. Whether you are setting up MOSS or WSS, several groups and accounts are required to run services and application pools. These groups and accounts do not need any special configuration because the installation process handles it for you. Table 2-5 describes the required accounts and indicates if they are required for a WSS or a MOSS installation. Follow these steps to add the accounts: 1. Select Start ➤ Administrative Tools ➤ Active Directory Users and Computers. 2. In the Active Directory Users and Computers management console, expand the tree until the Users folder is visible. 3. Right-click the Users folder and select New ➤ User from the context menu. 4. In the New Object dialog, type the name of the account into the Full Name field and the User Logon name field. 5. Click the Next button. 6. On the next screen, give the account a password and uncheck the box titled User Must Change Password at Next Logon. 7. Check the boxes titled Password Never Expires and User Cannot Change Password. 8. Click the Next button. 9. Click the Finish button. 10. Repeat these steps to add each account. 11. When finished, add the SPAdmins group shown in Table 2-5.

■Note This is a good time to add some test users to Active Directory. These test accounts are useful for setting up various scenarios in SharePoint. When you add a new account, be sure to also set up a new mailbox for each account in the POP3 service.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Table 2-5. Required Users and Groups

Name

Group/ Account

SPAdmins

Description

WSS/MOSS

Group

The SharePoint administrators security group

WSS/MOSS

SPConfigAcct

Account

The account used to connect to the Configuration database, run the administration application pool, and run the timer service

WSS/MOSS

SPContentPool

Account

The account used for the site collection application pool

WSS/MOSS

SPSearchAcct

Account

The account used to perform searches

WSS/MOSS

SPCrawlAcct

Account

The account used to crawl and index content

WSS/MOSS

SPSharedServicesPool

Account

The account used for the Shared Services application pool

MOSS only

SPSharedServicesAcct

Account

The account under which Shared Services run

MOSS only

■Tip Although SharePoint is supposed to grant all of the necessary permissions to your accounts, I have regularly seen DCOM errors in the System event log that indicate the application pool accounts were not given the required launch permissions for the IWAM Reg Admin Service component. After you complete the installation, check your System event log. If you see these errors, you can fix them by adding the SPContentPool and SPSharedServicesPool accounts to the launch permissions list of the IWAM Reg Admin Service component. The System event log message will give you the exact details to guide you in correcting the error.

Configuring Remote Desktop Administration The Remote Desktop for Administration (RDA) is a handy way to access the domain controller when you are logged into another machine. This is especially helpful if you have created your development environment using separate machines. The RDA uses only about 2MB of memory and has little impact on processing power, so Microsoft recommends enabling it for every server. The RDA is enabled from the System Properties dialog on the server. Clients attach to it using the Remote Desktop Connection applet. You can find the client applet on a Windows XP machine at Start ➤ All Programs ➤ Accessories ➤ Communications ➤ Remote Desktop Connection. Follow these steps to enable the RDA: 1. Select Start ➤ Control Panel ➤ System to open the System Properties dialog. 2. Select the Remote tab.

45

46

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

3. Check the box titled Enable Remote Desktop on this Computer. 4. If you want to provide access for any other accounts besides the domain administrator, click the Select Remote Users button and add the accounts. 5. Click OK. Next, if you are going to create a database server for the development environment, proceed to “Section 4: Creating the Database Server.” Otherwise, proceed to either “Section 5: Installing Windows SharePoint Services” or “Section 6: Installing Microsoft Office SharePoint Server.”

Section 4: Creating the Database Server Follow the same steps as you did for creating the image for the domain controller. There are only two differences in the installation process. First, be sure to name this server VSSQL. Second, join the server to the domain that you created earlier.

Adding the Application Server Role ASP.NET is required on the server where SQL Server 2005 will be installed in order to support Reporting Services. The SQL Server 2005 setup will automatically install the .NET Framework 2.0, but you must first configure the Application Server role. Follow these steps to configure the server: 1. From the Manage Your Server applet, select the right-facing arrow to add or remove a role to the server. 2. On the Preliminary Steps screen, click the Next button. 3. On the Server Role screen, select Application Server (IIS, ASP.NET) from the list of available roles and click the Next button. 4. On the Application Server Options screen, leave both boxes unchecked and click the Next button. 5. On the Summary of Selections screen, click the Next button.

Installing SQL Server 2005 SQL Server 2005 is the back end for all SharePoint data. You can also use Analysis Services with SharePoint to create dashboards of KPIs. Additionally, you can use SQL Reporting Services to create reports that may be viewed in SharePoint. Having a fully functional set of SQL Server services will significantly enhance your SharePoint installation. Follow these steps to install SQL Server 2005: 1. Mount the SQL Server 2005 ISO file or insert the setup disk to start the installation. 2. On the installation Start screen, click the link titled Server Components, Tools, Books Online, and Samples. 3. On the End User License Agreement screen, accept the agreement and click the Next button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

4. On the Installing Prerequisites screen, click the Install button. 5. When the prerequisites are installed, click the Next button. 6. On the Welcome screen of the installation wizard, click the Next button. 7. When the System Configuration Check appears, verify that your system has passed all of the checks and click the Next button. 8. On the Registration Information screen, enter your Product Key and click the Next button. 9. On the Components to Install screen, select to install SQL Server Database Services, Analysis Services, Reporting Services, and Workstation Components, Books Online, and Development Tools. Then click the Next button. 10. On the Instance Name screen, make sure the Default Instance option is selected and click the Next button. 11. On the Service Account screen, select the Use the Built-In System Account option. 12. Select Local System from the drop-down list of accounts and click the Next button. 13. On the Authentication Mode screen, ensure the Windows Authentication Mode option is selected and click the Next button. 14. On the Collation Settings screen, click the Next button. 15. On the Report Server Installation Options screen, select the option to Install the Default Configuration and click the Next button. 16. On the Error and Usage Report Settings screen, click the Next button. 17. On the Ready to Install screen, click the Install button.

Configuring SQL Server 2005 Surface Areas When configuring a farm environment for MOSS, you must modify the SQL Server surface areas to support communication among the components. This is because SQL 2005 installs in a secure mode that you must open up. Follow these steps to configure SQL Server surface areas: 1. Select Start ➤ All Programs ➤ Microsoft SQL Server 2005 ➤ Configuration Tools ➤ SQL Server Surface Area Configuration. 2. In the SQL Server 2005 Surface Area Configuration window, click the link titled Surface Area Configuration for Services and Connections. 3. In the Surface Area Configuration for Services and Connections dialog, select Remote Connections from the tree control. 4. Select the option labeled Using Both TCP/IP and Named Pipes. 5. Click the OK button. 6. When the alert dialog appears, click the OK button.

47

48

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

7. Close the SQL Server Surface Area Configuration dialog. 8. Reboot the VSSQL server. Next, proceed to “Section 5: Installing Windows SharePoint Services” or “Section 6: Installing Microsoft Office SharePoint Server.”

Section 5: Installing Windows SharePoint Services You can follow the steps in this section if you do not plan on deploying MOSS. If you are going to deploy MOSS, you can skip this section and move on to the MOSS deployment. Initially, you can follow the same steps as you did for creating the virtual server for the domain controller or database server. Name this server VSWSS and join the server to the domain that you created earlier.

Adding the Application Server Role ASP.NET is required to run Windows SharePoint Services. In the next section, you will install the .NET Framework 2.0, but you must first configure the Application Server role. Follow these steps to configure the server: 1. From the Manage Your Server applet, select the right-facing arrow to add or remove a role to the server. 2. On the Preliminary Steps screen, click the Next button. 3. On the Server Role screen, select Application Server (IIS, ASP.NET) from the list of available roles and click the Next button. 4. On the Application Server Options screen, leave both boxes unchecked and click the Next button. 5. On the Summary of Selections screen, click the Next button.

Installing the .NET Framework 2.0 Windows SharePoint Services requires the .NET Framework 2.0. You can access and download the framework using Windows Update. Follow these steps to install the .NET Framework 2.0: 1. Launch the Microsoft .NET Framework Version 2.0 Redistributable Package DOTNETFX.EXE. 2. Follow the simple steps in the wizard to complete the installation. 3. When the installation completes, select Start ➤ Administrative Tools ➤ Internet Information Services (IIS) Manager. 4. In the IIS Manager applet, click the Web Service Extensions folder. 5. Select ASP.NET 2.0.50727 from the list of extensions and click the Allow button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Installing the .NET Framework 3.0 Windows SharePoint Services requires the .NET Framework 3.0 for workflow support. You can access and download the framework using Windows Update. The installation is straightforward and requires no special considerations.

Installing WSS Software Installing WSS on the server requires installation and then configuration. The installation is straightforward and only requires a few steps through a wizard interface. Configuration is performed after the software is installed. Follow these steps to install Windows SharePoint Services: 1. Run SETUP.EXE for WSS v3. 2. On the License Agreement screen, accept the agreement and click the Continue button. 3. On the next screen, click the Advanced button. 4. On the Server Type tab, select the Web Front End option. 5. Click the Install Now button. 6. When the installation is complete, check the box to run the Configuration Wizard and click the Close button. Configuring Authentication and Database Options Configuring the basic WSS installation is done through a wizard interface. In the wizard, you will specify the database server and configuration database name. You will also select to use either NTLM or Kerberos as the authentication provider. Follow these steps to configure WSS: 1. On the welcome screen, click the Next button. 2. In the warning dialog, click the Yes button to acknowledge that the listed services will be stopped. 3. On the Connect to a Server Farm screen, select No, I Want to Create a New Server Farm and click the Next button. 4. On the Configuration Database Settings screen, enter VSSQL in the Database Server field. 5. Enter WSS_Config in the Database Name field. 6. Enter DOMAIN\SPConfigAcct in the Username field. 7. Enter the password for the SPConfigAcct in the Password field. 8. Click the Next button. 9. On the Configure SharePoint Central Administration Web Application, select either NTLM or Kerberos as the authentication provider and click the Next button.

49

50

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

■Caution If you choose to use Kerberos authentication, further steps will be necessary to configure the authentication provider. Do not use Kerberos authentication if you do not have the ability to access and modify Active Directory.

10. On the completion screen, click the Next button to apply the configuration settings. 11. After closing the configuration wizard, the Central Administration site will open automatically. If prompted with a login dialog, enter the administrator credentials. 12. When prompted, add the Central Administration site to the list of trusted sites. 13. After the Central Administration site opens, close it until you have finished configuring security. Turning Off Internet Explorer Enhanced Security Windows Server 2003 installs Internet Explorer with Enhanced Security activated. Although this is a good default setting for production machines, it can and will prevent content from being rendered in SharePoint. You’ll want to disable Enhanced Security in the development environment to make sure you have complete access to administrative functions. Follow these steps to disable Internet Explorer Enhanced Security: 1. Select Start ➤ Control Panel ➤ Add or Remove Programs. 2. Click the Add/Remove Windows Components button on the Add/Remove Programs screen. 3. Uncheck the Internet Explorer Enhanced Security Configuration box. 4. Click the Next button. Adding WSS to the List of Trusted Sites You may find that when you access WSS sites that you are prompted for a username and password. You can eliminate this behavior by adding the VSWSS server to the list of trusted sites or the Local Intranet zone. In either case, you should also ensure that the browser settings are configured to automatically log the user on to the site. Follow these steps to add the server to the list of trusted sites: 1. In the Internet Explorer, select Tools ➤ Internet Options. 2. On the Security tab, click the Trusted Sites icon. 3. Click the Sites button. 4. Clear the box titled Require Server Verification (https) for All Sites in this Zone. 5. Verify that http://vswss is in the Websites list. If not, add it to the list. 6. Click the Close button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

7. Click the Custom Level button. 8. In the Settings list, under User Authentication, select Automatic Logon with Current Username and Password. 9. Click the OK button. 10. Click the OK button to close the options dialog. Configuring Kerberos Authentication If you selected to use Kerberos as the authentication provider, you must perform additional configuration steps. The steps involve the definition of a Service Principal Name (SPN) for the application pool account. The SPN is used to authenticate the server to the client. Follow these steps to configure Kerberos authentication: 1. Log in to VSPDC as a domain administrator. 2. Select Start ➤ Administrative Tools ➤ Active Directory Users and Computers. 3. In the Active Directory Users and Computers applet, click the Computers folder. 4. Right-click VSWSS and select Properties from the context menu. 5. On the General tab, check the box labeled Trust Computer for Delegation and then click the OK button. 6. Click the Users folder. 7. Right-click the SPConfigAcct account and select Properties from the context menu. 8. On the Account tab, check the box labeled Account is Trusted for Delegation and click the OK button. 9. Repeat steps 7 and 8 for the SPContentPool account. 10. Download the SPN tool from the following URL: http://www.microsoft.com/ downloads/details.aspx?familyid=5fd831fd-ab77-46a3-9cfeff01d29e5c46&displaylang=en. 11. Create the SPN for the SPConfigAcct by running the following command: SETSPN –A HTTP/VSWSS.DOMAIN.LOCAL DOMAIN\SPConfigAcct 12. Repeat step 11 for the SPContentPool account.

Configuring WSS Components Once you have the security settings properly configured, you can open the SharePoint Central Administration site on VSWSS by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Administration. On the home page, you will see a task list of recommended actions you should take to configure WSS. Figure 2-8 shows the WSS Central Administration site. In this exercise, you will configure several items, but not all of the items in the task list. Several of these tasks

51

52

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

will be configured later in the book where they are explained in more detail. The following sections will help you get the basic WSS configuration completed.

Figure 2-8. WSS Central Administration

Designating the SharePoint Administrators Group Earlier in the exercise, you created a security group for the SharePoint administrators. At this point, only the account you used to install WSS can function as the administrator. By adding a group to the list of administrators you can easily grant others administration capabilities through Active Directory. Follow these steps to designate an administrator group: 1. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Administration. 2. On the SharePoint Central Administration page, click the Operations tab. 3. Under the Security Configuration section, click the link titled Update Farm Administrator’s Group. 4. On the People and Groups: Farm Administrators page, select New ➤ Add Users. 5. On the Add Users page, enter DOMAIN\SPAdmins in the Users field. 6. Click the OK button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Starting the Search Service The WSS Search Service is not running initially. In order to use search functions, you must configure the service with an appropriate account for searching and one for crawling. In this section, you will use the accounts you created earlier to configure the Search Service. Follow these steps to configure the Search Service: 1. On the SharePoint Central Administration page, click the Operations tab. 2. In the Topology and Services section, click the link titled Services on Server. 3. On the Services on Server page, click the Start link next to the Windows SharePoint Services Search. 4. In the Service Account section, enter DOMAIN\SPSearchAcct in the User Name field. 5. Enter the account password in the Password field. 6. In the Content Access Account section, enter DOMAIN\SPCrawlAcct in the User Name field. 7. Enter the account password in the Password field. 8. Click the Start button. Configuring Outgoing E-Mail WSS uses an SMTP server to send alerts and messages to users. In this section, you will enter the e-mail settings for WSS. Follow these steps to configure the e-mail settings: 1. On the SharePoint Central Administration page, click the Operations tab. 2. In the Topology and Services section, click the link titled Outgoing E-mail Settings. 3. On the Outgoing E-Mail Settings page, enter VSPDC in the Outbound SMTP Server field. 4. Enter [email protected] in the From Address field. 5. Enter [email protected] in the Reply To field. 6. Click the OK button.

Creating a New Web Application and Site Collection Once WSS is properly configured, you can finally create your first site. In this section, you will create a site collection based on the team site template. Follow these steps to create your first site: 1. On the SharePoint Central Administration page, click the Application Management tab. 2. On the Application Management page, click the link titled Create or Extend Web Application.

53

54

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

3. On the Create or Extend Web Application page, click the link titled Create a New Web Application. 4. On the Create a New Web Application page, select the option Use an Existing IIS Web Site. 5. Choose Default Web Site in the drop-down list. 6. Under the Authentication Provider, choose either Negotiate (Kerberos) or NTLM, depending upon the choice you made earlier. 7. In the Application Pool section, select Create a New Application Pool. 8. Enter WSS_Pool as the pool name. 9. Select the Configurable option for the application pool security account. 10. In the User Name field, enter DOMAIN\SPContentPool. 11. In the Password field, enter the account password. 12. In the Reset Internet Information Services section, select the option to Restart IIS Automatically. 13. In the Search Server section, select VSWSS from the drop-down list. 14. Click the OK button. 15. On the Application Created page, click the link titled Create Site Collection. 16. On the Create Site Collection page, enter Home Site in the Title field. 17. Use the drop-down list in the Web Site Address section and verify that just the single forward slash is selected. This will create the site at the root for the server. 18. Under the Primary Site Collection Administrator section, enter DOMAIN\Administrator in the User Name field. 19. Click the OK button to create the new site collection. 20. Once the Site Collection is created, return to the Application Management tab. 21. Click the link titled Policy for Web Application under the Application Security section. 22. On the Policy for Web Application page, click the Add Users button. 23. On the Add Users page, click the Next button. 24. Under the Choose Users section, enter any accounts that should have administrative control over the Site Collection. Be sure to include the DOMAIN\Administrator and VSWSS\Administrator accounts. 25. In the Choose Permissions section, check the box labeled Full Control. 26. Click the Finish button. You should now have full access to the new Site Collection.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Installing Visual Studio 2005 and SharePoint Designer Throughout the book, I utilize Visual Studio 2005 and SharePoint Designer to customize SharePoint. For simplicity, you should install these products directly on the WSS server. There are no special considerations; simply install the products in a typical configuration. Next, proceed to “Section 7: Creating a Test Client.”

Section 6: Installing Microsoft Office SharePoint Server Installing MOSS is the best way to experience the information, examples, and exercises in the book. MOSS has many components that are simply not available in WSS. This section will walk you through creating a MOSS installation for development. Start out cloning Windows 2003 Server just as you did on every other machine. Name this machine VSMOSS and join it to the domain you created earlier.

■Caution Always install MOSS using a domain account that is a local administrator on every machine in the farm. Never install MOSS as simply a local administrator on the SharePoint server. The MOSS installation automatically makes the installation account the administrator for shared services, and using a local account can cause you to be denied access to the farm later.

Adding the Application Server Role ASP.NET is required to run MOSS. In the next section, you will install the .NET Framework 2.0, but you must first configure the Application Server role. Follow these steps to configure the server: 1. From the Manage Your Server applet, select the right-facing arrow to add or remove a role to the server. 2. On the Preliminary Steps screen, click the Next button. 3. On the Server Role screen, select Application Server (IIS, ASP.NET) from the list of available roles and click the Next button. 4. On the Application Server Options screen, leave both boxes unchecked and click the Next button. 5. On the Summary of Selections screen, click the Next button.

Installing the .NET Framework 2.0 MOSS requires the .NET Framework 2.0. You can access and download the framework using Windows Update. Follow these steps to install the .NET Framework 2.0: 1. Launch the Microsoft .NET Framework Version 2.0 Redistributable Package DOTNETFX.EXE. 2. Follow the simple steps in the wizard to complete the installation.

55

56

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

3. When the installation completes, select Start ➤ Administrative Tools ➤ Internet Information Services (IIS) Manager. 4. In the IIS Manager applet, click the Web Service Extensions folder. 5. Select ASP.NET 2.0.50727 from the list of extensions and click the Allow button.

Installing the .NET Framework 3.0 MOSS requires the .NET Framework 3.0 for workflow support. You can access and download the framework using Windows Update. The installation is straightforward and requires no special considerations.

Installing Microsoft Office SharePoint Server Software Installing MOSS on the server requires installation and then configuration. The installation is straightforward and only requires a few steps through a wizard interface. Configuration is performed after the software is installed and is somewhat more complicated than the typical WSS installation. Follow these steps to install MOSS: 1. Run SETUP.EXE for MOSS. 2. On the License Agreement screen, accept the agreement and click the Continue button. 3. On the next screen, click the Advanced button. 4. On the Server Type tab, select Complete. 5. Click the Install Now button. 6. When the installation is complete, check the box to run the Configuration Wizard and click the Close button.

Configuring Authentication and Database Options Configuring the basic MOSS installation is done through a wizard interface. In the wizard, you will specify the database server and configuration database name. You will also select to use either NTLM or Kerberos as the authentication provider. Follow these steps to configure MOSS: 1. On the welcome screen, click the Next button. 2. In the warning dialog, click the Yes button to acknowledge that the listed services will be stopped. 3. On the Connect to a Server Farm screen, select No, I Want to Create a New Server Farm and click the Next button. 4. On the Configuration Database Settings screen, enter VSSQL in the Database Server field. 5. Enter MOSS_Config in the Database Name field.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

6. Enter DOMAIN\SPConfigAcct in the Username field. 7. Enter the password for the SPConfigAcct in the Password field. 8. Click the Next button. 9. On the Configure SharePoint Central Administration Web Application, select either NTLM or Kerberos as the authentication provider and click the Next button.

■Note If you choose to use Kerberos authentication, further steps will be necessary to configure the authentication provider. Do not use Kerberos authentication if you do not have the ability to access and modify Active Directory.

10. On the completion screen, click the Next button to apply the configuration settings. 11. After closing the configuration wizard, the Central Administration site will open automatically. If you are presented with a login dialog, use the administrator credentials. 12. When prompted, add the Central Administration site to the list of trusted sites. 13. After the Central Administration site opens, close it until you have finished configuring security.

Turning Off Internet Explorer Enhanced Security Windows Server 2003 installs Internet Explorer with Enhanced Security activated. Although this is a good default setting for production machines, it can and will prevent content from being rendered in SharePoint. You’ll want to disable Enhanced Security in the development environment to make sure you have complete access to administrative functions. Follow these steps to disable Internet Explorer Enhanced Security: 1. Select Start ➤ Control Panel ➤ Add or Remove Programs. 2. Click the Add/Remove Windows Components button on the Add/Remove Programs screen. 3. Uncheck the Internet Explorer Enhanced Security Configuration box. 4. Click the Next button.

Adding MOSS to the List of Trusted Sites You may find that when you access SharePoint sites that you are prompted for a username and password. You can eliminate this behavior by adding the VSMOSS server to the list of trusted sites or the Local Intranet zone. In either case, you should also ensure that the browser settings are configured to automatically log the user on to the site.

57

58

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Follow these steps to add VSMOSS to the list of trusted sites: 1. In the Internet Explorer, select Tools ➤ Internet Options. 2. On the Security tab, click the Trusted Sites icon. 3. Click the Sites button. 4. Clear the box titled Require Server Verification (https) for All Sites in This Zone. 5. Verify that http://vsmoss is in the Websites list. If not, add it. 6. Click the Close button. 7. Click the Custom Level button. 8. In the Settings list, under User Authentication, select Automatic Logon with Current Username and Password. 9. Click the OK button. 10. Click the OK button to close the options dialog.

Configuring Kerberos Authentication If you selected to use Kerberos as the authentication provider, you must perform additional configuration steps. The steps involve the definition of a Service Principal Name (SPN) for the application pool account. The SPN is used to authenticate the server to the client. Follow these steps to configure Kerberos authentication: 1. Log in to the domain controller as a domain administrator. 2. Select Start ➤ Administrative Tools ➤ Active Directory Users and Computers. 3. In the Active Directory Users and Computers applet, click the Computers folder. 4. Right-click VSMOSS and select Properties from the context menu. 5. On the General tab, check the box labeled Trust Computer for Delegation and then click the OK button. 6. Click the Users folder. 7. Right-click the SPConfigAcct account and select Properties from the context menu. 8. On the Account tab, check the box labeled Account Is Trusted for Delegation and click the OK button. 9. Repeat steps 7 and 8 for the SPContentPool account. 10. Download the SPN tool from the following URL: http://www.microsoft.com/ downloads/details.aspx?familyid=5fd831fd-ab77-46a3-9cfeff01d29e5c46&displaylang=en.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

11. Create the SPN for the SPConfigAcct by running the following command: SETSPN –A HTTP/VSMOSS.DOMAIN.LOCAL DOMAIN\SPConfigAcct 12. Repeat step 11 for the SPContentPool, SPSharedServicesPool, and SPSharedServicesAcct accounts.

Configuring MOSS Components Once you have the security settings properly configured, you can open the SharePoint Central Administration site on VSMOSS. On the home page, you will see a task list of recommended actions you should take to configure MOSS. Figure 2-9 shows the MOSS Central Administration site. In this exercise, you will configure several items, but not all of the items in the task list. Several of these tasks will be configured later in the book where they are explained in more detail. The following sections will help you get the basic MOSS configuration completed.

Figure 2-9. MOSS Central Administration

Designating the SharePoint Administrators Group Earlier in the exercise, you created a security group for the SharePoint administrators. At this point, only the account you used to install MOSS can function as the administrator. By adding a group to the list of administrators you can easily grant others administration capabilities through Active Directory.

59

60

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Follow these steps to designate an administrator group: 1. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Administration. 2. On the SharePoint Central Administration page, click the Operations tab. 3. Under the Security Configuration section, click the link titled Update Farm Administrator’s Group. 4. On the People and Groups: Farm Administrators page, select New ➤ Add Users. 5. On the Add Users page, enter DOMAIN\SPAdmins in the Users field. 6. Click the OK button.

Starting Required Services The MOSS Search Service is not running initially. In order to use search functions, you must configure the service with an appropriate account for searching and one for crawling. Additionally, you must start several other shared services that I will cover in Chapter 4. In this section, you will use the accounts you created earlier to configure the services.

■Caution In this exercise, you’ll be running all of the farm services on the same machine as MOSS. Because many of these services are resource intensive, you would normally deploy these services to a separate application server for improved performance.

Follow these steps to configure the Search Service: 1. On the SharePoint Central Administration page, click the Operations tab. 2. In the Topology and Services section, click the link titled Services on Server. 3. On the Services on Server page, click the option titled Web Server for Medium Farm. 4. Click the Start link next to the Excel Calculation Services. 5. Click the Start link next to the Document Conversions Load Balancer Service. 6. Click the Start link next to the Document Conversions Launcher Service. 7. On the Launcher Service Settings page, select VSMOSS from the Load Balancer Server drop-down list. 8. Click the OK button. 9. Click the Start link next to Office SharePoint Server Search. 10. On the Office SharePoint Services Search Settings page, check the boxes labeled Use This Server for Indexing Content and Use This Server for Serving Search Queries. 11. Enter [email protected] in the E-mail Address field.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

12. In the Farm Search Service Account section, enter DOMAIN\SPSearchAcct in the User Name field. 13. Enter the account password in the Password field. 14. Click the Start button. 15. On the Services on Server page, click the Start link next to Windows SharePoint Services Search. 16. In the Service Account section, enter DOMAIN\SPSearchAcct in the User Name field. 17. Enter the account password in the Password field. 18. In the Content Access Account section, enter DOMAIN\SPCrawlAcct in the User Name field. 19. Enter the account password in the Password field. 20. Click the Start button.

Setting Up the Shared Services Provider The Shared Services Provider hosts several services that can be used across web applications in the farm. Services such as search and user profiles typically only need to be created one time and then used by all sites. In this section, you will create a new web application for the Shared Services Provider. Follow these steps to set up the Shared Services Provider: 1. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Administration. 2. On the Application Management tab, under the Office SharePoint Server Shared Services section, click the link titled Create or Configure this Farm’s Shared Services. 3. On the Manage This Farm’s Shared Services page, click New SSP. 4. On the New Shared Services Provider page, click the link titled Create a New Web Application under the SSP Name field. 5. On the Create a New Web Application page, select the option Create a New IIS Web Site. 6. Enter SharedServices – 8080 in the Description field. 7. Enter 8080 in the Port field. 8. Under the Authentication Provider, choose either Negotiate (Kerberos) or NTLM, depending upon the choice you made earlier. 9. In the Application Pool section, select Create a New Application Pool and enter SSP_Pool in the Application Pool Name field. 10. Select the Configurable option for the application pool security account. 11. In the User Name field, enter DOMAIN\SPSharedServicesPool. 12. In the Password field, enter the account password.

61

62

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

13. Select the option Restart IIS Automatically. 14. Click the OK button. 15. On the New Shared Services Provider page, click the link titled Create a New Web Application under the My Site Location section. 16. On the Create a New Web Application page, select the option Create a New IIS Web Site. 17. Enter PersonalSites – 8081 in the Description field. 18. Enter 8081 in the Port field. 19. Under the Authentication Provider, choose either Negotiate (Kerberos) or NTLM, depending upon the choice you made earlier. 20. In the Application Pool section, select Use Existing Application Pool and choose SSP_Pool from the drop-down list. 21. Select Restart IIS Automatically. 22. Click the OK button. 23. On the New Shared Services Provider page, enter Shared Services in the SSP Name field. 24. Under the SSPService Credentials section, enter DOMAIN\SPSharedServicesAcct in the Username field. 25. Enter the account password in the Password field. 26. In the Index Server section, select VSMOSS from the Index Server drop-down list. 27. Click the OK button.

Configuring Outgoing E-Mail Once the Shared Services are set up, you may return to the Central Administration pages to continue configuring additional components. In this exercise, you will configure an SMTP server for MOSS. MOSS uses an SMTP server to send alerts and messages to users. Follow these steps to configure the e-mail settings: 1. Click the Operations tab in SharePoint 3.0 Central Administration. 2. Click the link titled Outgoing E-Mail Settings under the Topology and Services section. 3. On the Outgoing E-Mail Settings page, enter VSPDC in the Outbound SMTP Server field. 4. Enter [email protected] in the From Address field. 5. Enter [email protected] in the Reply To field. 6. Click the OK button.

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

Creating a New Web Application and Site Collection Once MOSS is properly configured, you can create a new web application and site collection. The site templates available to you include intranets, public web sites, wikis, and blogs. In this section, you will create a corporate intranet site. Follow these steps to create your first site: 1. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. On the Application Management tab, under the SharePoint Web Application Management section click the link titled Create or Extend Web Application. 3. On the Create or Extend Web Application page, click the link titled Create a New Web Application. 4. On the Create a New Web Application page, select the option Use an Existing IIS Web Site. 5. Choose Default Web Site in the drop-down list. 6. Under the Authentication Provider, choose either Negotiate (Kerberos) or NTLM, depending upon the choice you made earlier. 7. In the Application Pool section, select Create a New Application Pool. 8. Enter Intranet_Pool as the pool name. 9. Select the Configurable option for the application pool security account. 10. In the User Name field, enter DOMAIN\SPContentPool. 11. In the Password field, enter the account password. 12. In the Reset Internet Information Services section, select the option to Restart IIS Automatically. 13. Click the OK button. 14. On the Application Created page, click the link titled Create Site Collection. 15. On the Create Site Collection page, enter Intranet in the Title field. 16. In the Web Site Address section, select /sites/ from the drop-down list and enter intranet in the URL field. 17. Under the Template Selection section, click the Publishing tab and then select the Collaboration Portal template. 18. Under the Primary Site Collection Administrator section, enter DOMAIN\ Administrator in the User Name field. 19. Click the OK button to create the new site collection. 20. Once the site collection is created, return to the Application Management tab. 21. Click the link titled Policy for Web Application under the Application Security section.

63

64

CHAPTER 2 ■ SHAREPOINT OVERVIEW, PLANNING, AND INSTALLATION

22. On the Policy for Web Application page, click the Add Users button. 23. On the Add Users page, click the Next button. 24. Under the Choose Users section, enter any accounts that should have administrative control over the site collection. Be sure to include the DOMAIN\Administrator and VSMOSS\Administrator accounts so you can always access the site collection. 25. In the Choose Permissions section, check the box labeled Full Control. 26. Click the Finish button. You should now have full access to the new site collection.

Installing Visual Studio 2005 and SharePoint Designer Throughout the book, I utilize Visual Studio 2005 and SharePoint Designer to customize MOSS. For simplicity, you should install these products directly on the MOSS server. There are no special considerations; simply install the products in a typical configuration.

Section 7: Creating a Test Client In order to work with the examples in the book, you will need to create at least one client machine running Windows Vista or XP. While installing the operating system, you should name the client VSCLIENT and join the client machine to the domain you created earlier. Once joined to the domain, you should be able to view the site you created in SharePoint. Remember to add the SharePoint server to the list of trusted sites in order to avoid being prompted for credentials. After the operating system is installed, you will need to install Microsoft Office 2007. All of these setups are straightforward; you can simply use the typical installations.

CHAPTER

3

SharePoint Fundamentals S

harePoint 2007 is a significant product with many functional areas to master. Installing the software and creating a web application are only the beginning of the administrative and programming tasks you must perform to develop a professional site. These tasks include managing users, configuring authentications, and deploying functionality to the site. In this chapter, I cover the fundamental configurations, features, and functions that are required to get a site up and running.

Managing Users Once you have created a web application and a site collection, you will want to give users permission to access the new site. Adding users is relatively straightforward. However, determining the permissions that should be granted to each user requires understanding and planning. When planning user permissions, you should consider what permissions you will make available to a web application and how to group those permissions for assignment to end users. SharePoint defines 33 separate rights divided into three categories: list permissions, site permissions, and personal permissions. The list permissions determine whether a user can create new lists or manage list items within the site. The site permissions determine whether a user can change the content and appearance of various site aspects. The personal permissions allow the user to manage personal content. All of the available SharePoint rights are explained in the following three tables. Table 3-1 shows list permissions and their descriptions. Table 3-1. List Permissions

Right

Description

Manage Lists

Create and delete lists, add or remove columns in a list, and add or remove public views of a list.

Override Check Out

Discard or check in a document that is checked out to another user.

Add Items

Add items to lists, add documents to document libraries, and add web discussion comments.

Edit Items

Edit items in lists, edit documents in document libraries, edit web discussion comments in documents, and customize web part pages in document libraries. Continued 65

66

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Table 3-1. Continued

Right

Description

Delete Items

Delete items from a list, documents from a document library, and web discussion comments in documents.

View Items

View items in lists, documents in document libraries, and web discussion comments.

Approve Items

Approve a minor version of a list item or document.

Open Items

View the source of documents with server-side file handlers.

View Versions

View past versions of a list item or document.

Delete Versions

Delete past versions of a list item or document.

Create Alerts

Create e-mail alerts.

View Application Pages

View forms, views, and application pages. Enumerate lists.

Table 3-2 shows site permissions and their descriptions. Table 3-2. Site Permissions

Right

Description

Manage Permissions

Create and change permission levels on the web site and assign permissions to users and groups.

View Usage Data

View reports on web site usage.

Create Subsites

Create subsites such as team sites, meeting workspace sites, and document workspace sites.

Manage Web Site

Grant the ability to perform all administration tasks for the web site as well as manage content and permissions.

Add and Customize Pages

Add, change, or delete HTML pages or web part pages, and edit the web site using a Windows SharePoint Services–compatible editor.

Apply Themes and Borders

Apply a theme or borders to the entire web site.

Apply Style Sheets

Apply a style sheet (CSS file) to the web site.

Create Groups

Create a group of users that can be used anywhere within the site collection.

Browse Directories

Enumerate files and folders in a web site using SharePoint Designer and WebDAV interfaces.

Use Self-Service Site Creation

Create a web site using self-service site creation.

View Pages

View pages in a web site.

Enumerate Permissions

Enumerate permissions on the web site, list, folder, document, or list item.

Browse User Information

View information about users of the web site.

Manage Alerts

Manage alerts for all users of the web site.

Use Remote Interfaces

Use SOAP, WebDAV, or SharePoint Designer interfaces to access the web site.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Right

Description

Use Client Integration Features

Use features that launch client applications. Without this permission, users will have to work on documents locally and upload their changes.

Open

Allow users to open a web site, list, or folder in order to access items inside that container.

Edit Personal User Information

Allow a user to change his or her own user information, such as adding a picture.

Table 3-3 shows the personal permissions and their descriptions. Table 3-3. Personal Permissions

Right

Description

Manage Personal Views

Create, change, and delete personal views of lists.

Add/Remove Private Web Parts

Add or remove private web parts on a web part page.

Update Personal Web Parts

Update web parts to display personalized information.

SharePoint allows you to control which of these rights are available for assignment to a user in a web application; not all of them must be made available to every site. Depending upon the site template you use, several of the rights may already be available to your web application by default. However, you can change the available rights for any site as you require. Follow these steps to view and modify the rights available in a web application: 1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Application Management tab. 3. Under the Application Security section, click the link titled User Permissions for Web Application. 4. On the User Permissions for Web Application Page, select the rights that will be available to the web application. 5. Click the Save button.

Understanding Permission Levels and SharePoint Groups Although you can specifically control the availability of each of the individual SharePoint rights, you will never directly assign one of these rights to a user. Instead, SharePoint gives you a way to collect rights into permission levels and levels into SharePoint groups. You then assign a user to a group, which assigns all of the contained rights from the associated permission levels. Levels and groups are defined and assigned by an administrator directly within the SharePoint site. If you have appropriate permissions within the site to perform administrative tasks, you will see the Site Actions menu on the page. Clicking this item causes a drop-down menu

67

68

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

to appear with available administrative options. The Site Actions menu, along with just about everything else in SharePoint, is security-trimmed. This means that users will only see options and menus that are valid for their permission set. This is a big improvement over the previous version of SharePoint, which allowed users to click any menu item only to be denied access later when the system discovered they had insufficient rights. Although there are several specific items on the drop-down menu, the easiest way to get started with site administration is to open the Site Settings page. The Site Settings page gives you access to a broad range of settings grouped together by category. In order to access the Site Settings page through the MOSS site you created in Chapter 2, click the Site Actions menu and select Site Settings ➤ Modify All Site Settings. In WSS, simply select Site Settings from the Site Actions drop-down menu. Figure 3-1 shows the drop-down menu with items available for an administrator in MOSS.

Figure 3-1. Accessing site administration functions

When you create a site collection within a web application, SharePoint provides you with several predefined permission levels and groups that you can use immediately to assign rights to users. From the Site Settings page, you can see the predefined groups by clicking the link titled Advanced Permissions under the Users and Permissions section. From the list, select Add ➤ New Users from the list toolbar to put users into the existing groups. When you look at the list of available groups, you’ll notice that they are associated with permission levels that have unfamiliar names. For example, the Hierarchy Managers group is associated with the permission levels Limited Access and Manage Hierarchy. When you first set up SharePoint, it can be difficult to know exactly what rights are being assigned to a user in these groups. Fortunately, you can access the definition for the permission levels by selecting Settings ➤ Permission Levels from the list toolbar. This brings up a page listing all of the defined permission levels. From this page, you can define your own permission levels or modify the existing ones. You cannot, however, modify the Full Control or Limited Access permission levels because SharePoint assumes their presence for things such as administrative tasks. Table 3-4 lists the rights and groups that exist by default in MOSS. WSS contains a subset of the MOSS groups.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

69

Table 3-4. Default Groups, Permission Levels, and Rights

Visitors

Quick Deploy Users

Restricted Readers

Right

Approvers

Designers

Hierarchy Managers

Manage



X

X



X







Override Check

X

X

X



X







Add Items

X

X

X

X

X







Edit Items

X

X

X

X

X







Delete Items

X

X

X

X

X







View Items

X

X

X

X

X

X



X

Approve Items

X

X





X







Open Items

X

X

X

X

X

X



X

View Versions

X

X

X

X

X

X





Delete Versions

X

X

X

X

X







Create Alerts

X

X

X

X

X

X





View Application Pages

X

X

X

X

X

X





Manage Permissions





X



X







View Usage Data





X



X







Create Subsites





X



X







Manage Web Site





X



X







Add and Customize Pages



X





X







Apply Themes and Borders



X





X







Members

Owners

Apply Style Sheets



X





X







Create Groups





X



X







Browse Directories

X

X

X

X

X







Use Self-Service Site Creation

X

X

X

X

X

X





View Pages

X

X

X

X

X

X



X

Enumerate Permissions





X



X







Browse User Information

X

X

X

X

X

X

X

X

Manage Alerts





X



X







Use Remote Interfaces

X

X

X

X

X

X

X

X

Use Client Integration Features

X

X

X

X

X

X

X

X

Open

X

X

X

X

X

X

X

X Continued

70

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Table 3-4. Continued

Visitors

Quick Deploy Users

Restricted Readers

Right

Approvers

Designers

Hierarchy Managers

Edit Personal User Information

X

X

X

X

X







Manage Personal Views

X

X

X

X

X







Add/Remove Private Web Parts

X

X

X

X

X







Update Personal Web Parts

X

X

X

X

X







Members

Owners

Configuring Anonymous Access Before you can configure a site to allow anonymous access, the associated web application must first have anonymous access enabled through Central Administration. If the web application is set through Central Administration to allow anonymous access, you can control what parts of your site are visible to anonymous users. If the central administrator has not enabled anonymous access for the web application, the functionality will not be visible. Follow these steps to enable anonymous access for the web application: 1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Application Management tab. 3. Under the Application Security section, click the link titled Authentication Providers. 4. On the Authentication Providers page, make sure that the correct web application is selected. If not, drop the menu and select Change Web Application. 5. On the Authentication Providers page, click the Default Zone link. 6. On the Edit Authentication page, check the box labeled Enable Anonymous Access. 7. Click the Save button. Once the web application is configured for anonymous access, you can return to the Permissions page. From the Permissions page, you can select Settings ➤ Anonymous Access to open the Anonymous Access Settings page. On this page, you may select to expose the entire site, all lists and libraries, or nothing at all. Additionally, you can control the visibility of an individual list or library through its permission settings. This combination of site-level and list-level configuration gives you a good deal of control over what parts of the site can be accessed anonymously.

Understanding Security Policies Along with assigning rights to end users, you can also establish broader security policies for a web application. On the Application Management tab of the Central Administration site, you

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

can click the link titled Policy for Web Application to set security policies. Using the Policy for Web Application page, you can change the policy for anonymous access, grant full control, or deny all access. These security policies override the rights that have been assigned through the Site Settings page so they should only be used when you want to grant a high-level of permission to an administrator or completely deny access to a set of users. You used this functionality in Chapter 2 to grant access rights to the administrator in the development environment. Additionally, these policies are set for a given zone, which determines whether they apply to users inside the firewall or outside. Zones are discussed in detail later in the section titled “Understanding Authentication Options.”

Managing Site Structure When you first create a web application and a site collection, you will notice that a default structure has been created for you based on the template you selected. You will likely want to modify the site structure significantly before making it accessible to end users. Modifying the structure, however, should not be done lightly. You should first begin by understanding all of the sites, pages, and lists that come with the template. Then you can move on to making changes. Figure 3-2 shows the home page of the site collection you created in Chapter 2, which contains a number of predefined sites, pages, and lists.

Figure 3-2. A site collection home page

71

72

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

The best way to understand the existing site collection structure is to examine it inside SharePoint using the Site Content and Structure explorer, which is only available within MOSS. This page presents a tree view of the entire site collection that you can navigate. Additionally, you can add and delete elements from the site collection directly from this one page. You can access the Site Content and Structure explorer by selecting Site Actions ➤ Manage Content and Structure from the MOSS home page.

Working with Sites A site collection in SharePoint contains one or more sites. Sites within a site collection represent a security boundary and a way to group teams and functionality for a business purpose. When you create a site collection, SharePoint will define some initial sites based on the template that you selected. The sites that SharePoint creates are designed to support the audience for which the template was designed. In the case of the MOSS site collection you created in Chapter 2, SharePoint defined sites named Document Center, News, Reports, Search, and Sites. If you created a site collection in WSS, you’ll only see a home page with no additional sites defined. The Document Center site in MOSS is designed to act as a central repository for documents throughout the organization. This site seems to be an acknowledgement that many customers simply want to use SharePoint as a document management system without necessarily taking advantage of its many other features. In previous versions of SharePoint, it was difficult to create such a document management system because of limitations in the library metadata and available document templates. SharePoint 2007 has largely overcome these limitations; I discuss the document management features in detail in Chapter 6. The News site is designed to support the creation and publishing of news articles for the organization. This site makes use of special article templates, content management, and publishing features that allow the creation and approval of content directly within SharePoint. Content management is a major area of new functionality within SharePoint 2007 that I cover in Chapter 5. The Reports site is a site designed to function as a report center for all business intelligence information within an organization. Using this site, you may define data connections to external sources such as SQL databases, and utilize that data to create reports and dashboards. These reports and dashboards can be presented in a number of ways, including scorecards, Excel spreadsheets, and SQL Reporting Services reports. Business intelligence is another major area of functionality that I cover in detail in Chapter 8. The Search site implements an enterprise search capability that allows you to search all of the content within MOSS as well as external content and even external databases. Search is greatly enhanced in this version of SharePoint, and the Search site has the ability to truly function across all enterprise systems. I cover search in Chapter 4. The Sites site forms a site directory that lists and catalogs all of the sites within the collection. The Site Directory helps end users locate sites of interest and understand the structure of the collection. If you have appropriate permissions, you can also create a new site within the collection by clicking the Create Site link. The Create Site link is a shortcut to the site creation page, which can also be reached through the Site Settings page. Most administrators will use the Site Settings page for site creation because it is conveniently grouped with other administrative tasks and works the same in both MOSS and WSS.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

To create a new site, follow these steps: 1. Open the home page of the intranet site you created in Chapter 2 (http://vsmoss/ sites/intranet). 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions drop-down menu. 3. Under the Site Administration section, click the link titled Sites and Workspaces. 4. On the Sites and Workspaces page, click the Create link. 5. On the New SharePoint Site page, enter Softball Team in the title field. 6. Enter softball in the URL field. 7. Under the Permissions section, select the option to Use Same Permissions as Parent Site. 8. Under the Template section, select to create a site based on the Team Site template. 9. Click the Create button. When you create sites in WSS or MOSS, you may see some different options for configuring how the site is displayed in the navigation system or how it is categorized in the Site Directory. If you are using MOSS in particular, you will notice that you have options to specify a division and a region with which to associate the site. These are the same options available in the previous version of SharePoint Portal Server. These options are configurable and can even be eliminated altogether (which is good because I don’t know of any organization that uses the default values). The key to altering these options lies in modifying the columns associated with the Sites list. Follow these steps to modify the division and region options in MOSS: 1. Click the Sites tab in MOSS to open the Site Directory. 2. On the Site Directory page, click View All Site Content. 3. On the All Site Content page, click the Sites list. 4. On the Sites list page, select Settings ➤ List Settings from the drop-down menu on the list toolbar. 5. On the Customize Sites page, scroll down to the Columns section and click either the Division column or the Region column. 6. On the Change Column page, change the list of available options and click the OK button. Alternately, you could click the Delete button to eliminate the column.

Working with Lists Lists represent a broad umbrella of functionality in SharePoint that encompasses everything from document management to scorecards. This is because at the lowest level, SharePoint manages groups of items as lists regardless of what the items are. For administrative purposes, however, SharePoint divides list functionality into four distinct categories: Libraries,

73

74

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Communications, Tracking, and Custom lists. The Libraries category contains list types for managing documents. The Communications category contains list types for communicating with other people. The Tracking category contains list types for managing tasks, plans, and issues. The Custom category allows you to create a custom list to meet your own needs. In this section, I provide an overview of each list type.

Using Document Libraries In many ways, libraries are the central feature of SharePoint. Nearly all site users will be involved with creating, retrieving, and sharing documents. You can create document libraries at any level in the site hierarchy and assign different permissions at the item or library level. This makes libraries useful for facilitating collaboration among organizational teams. What’s more, you’ll see in Chapters 6, 7, and 9 that document libraries are fully integrated with Microsoft Office 2007. When a new site is created it often comes with predefined libraries. The softball site you created earlier uses the Team Site template, which comes with a document library suitable for managing all kinds of documents including Office documents, text documents, PDF documents, and others. In WSS, you can also elect to create a picture library, a form library, or a wiki library for managing images, InfoPath forms, and wiki pages, respectively. In MOSS, you can create additional types of libraries for managing documents in multiple languages, reports, data connections, and slide libraries of PowerPoint presentations. When new documents are added to any library, a document profile is created based on the content type of the new document. A content type is a set of characteristics—such as a document template, workflow processes, and properties—that uniquely define a document. Content types allow you to manage multiple kinds of documents within a single library. This is a great improvement over the previous version of SharePoint, which was designed to support only a single document profile for every document in a library. I discuss content types in greater detail throughout the book. Once documents are part of a library, users can take advantage of the document management features built into SharePoint. These document management features include check-in, checkout, version control, initiating workflows, editing properties, and publishing. You may restrict the ability of users to utilize the document management feature set based on their membership in a security group, as I described earlier in the section “Managing Users.” In this version of SharePoint, you may control these permissions at the document level, whereas the previous version controls them at the library level. Access to the document management features of a library is accomplished through a drop-down list associated with each document. Figure 3-3 shows the drop-down list for a document in a library. You can check out documents directly from the document library using the drop-down list. When a document is checked out, it is still listed in the document library and visible to site users, but the username of the person who checked it out is visible in the list. For each library, you may control whether to require a checkout before a document can be edited. If you do not require a checkout, the document can be opened in a read-only mode by other users.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Figure 3-3. Accessing document management functions

Follow these steps to require checkout for a document library: 1. Open the home page of the softball team site you created earlier. 2. In the Quick Launch pane, click the link titled Shared Documents. 3. On the Shared Documents page, select Settings ➤ Document Library Settings from the drop-down menu on the list toolbar. 4. On the Customize Shared Documents page, click the link titled Versioning Settings. 5. On the Document Library Versioning Settings page, select the Yes option under the Require Check Out section. Once changes are made to a document, it may be saved back to the library and checked in. Users can be granted the authority to cancel an existing checkout by another person. This action causes the document to be checked back in to the library immediately; however, all changes made to the document since it was checked out are lost. This feature is primarily used to recover a checked-out document when the holder is unavailable for some reason. By default, the document library overwrites the old document version with the new version and does not keep any history. If you would like to keep version history, you must enable it from the Versioning Settings page. These settings allow you to specify whether you want to create major or minor versions and how many versions to retain. Once versioning is enabled, you can access the version history page from the drop-down menu associated with a document. This page will list all of the document versions and allow you to restore any of them as the current version. Along with version control, you can also enable content approval for a document library. When document approval is enabled, new documents will not be visible to the general population of site users. Instead, the documents must be approved before they become generally available. Rejections and approvals are issued directly in the portal using the drop-down menu associated with each document.

75

76

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Using Form Libraries A form library can be thought of as a special document library. The purpose of the form library is to store XML-based forms created through Microsoft InfoPath. For example, you might create a form library in the human resources area of the site that contains a vacation request form, a 401(k) change form, or a health insurance change form. In this way, key forms are centralized and easily located. Creating a form library can be done directly in the SharePoint site if you have appropriate permissions. Unlike document libraries, form libraries do not generally exist by default. When you create a form library, it is given a default form template for use with the library, but you will certainly want to modify it. As with any library, you can have multiple content types associated with the form library. To create a form library, follow these steps: 1. Open the home page of the softball team site you created earlier. 2. Select Create from the Site Actions drop-down menu. 3. On the Create Page, click the Form Library link under the Libraries section. 4. In the Name field type Team Forms. 5. Click the Create button. Once the form library is created, you can create and upload forms. Forms in InfoPath may be designed based on an existing template or a database schema or from scratch. All of the forms created with InfoPath are interactive with complete control sets such as list boxes, options, and text fields. Once the form is created, you can publish it to the form library. Take these steps to publish a default InfoPath form: 1. Open Microsoft InfoPath 2007 on VSCLIENT. 2. In the Getting Started dialog, select Customize a Sample. 3. In the Customize a Sample window, double-click Sample – Travel Request. 4. In the Design Tasks window, select Publish Form Template. 5. When prompted, save the file to your desktop as Travel.xsn. 6. When the Publishing Wizard starts, select the publishing option To a SharePoint Server With or Without InfoPath Forms Services. 7. Click the Next button. 8. Type in the URL of the site you created earlier (e.g., http://vsmoss/sites/intranet/ softball). 9. On the next screen of the wizard, uncheck the box labeled Enable This Form to Be Filled Out by Using a Browser. 10. Click the Next button. 11. On the next screen of the wizard, select the option to Update the Form Template in an Existing Document Library.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

12. Select the Team Forms library and click the Next button. 13. On the next screen of the wizard, simply click the Next button. 14. On the next screen of the wizard, click the Publish button. 15. On the final screen of the wizard, check the box labeled Open This Document Library, and then click the Close button. 16. When the form library opens, you should be able to fill out the new form by selecting New ➤ New Document from the drop-down menu on the library toolbar.

Using Picture Libraries Like form libraries, picture libraries are a special type of document library. These libraries are specifically intended to manage digital photography and images such as corporate logos and web site images. Although images can be stored in any document library, picture libraries have special features to view and use graphical content. Uploading pictures into the library is similar to uploading any document or form and can be done using the Upload menu on the library toolbar. Once the images are uploaded, however, they may be presented in special views available only in the picture library. The images may also be edited with Microsoft Picture Manager or sent directly to any Office application for inclusion in a document.

Using Announcements An announcements list is used to create a list of announcements with a title and a rich-text body. Announcements are simple list types that typically display the title and a few lines of the body on the home page of a site. Additionally, each item can be given an expiration date so that they are automatically hidden after a period of time.

Using Contacts A contact list is used to track contact information about people. You can either type contact information directly into the list, or import the information from an address book. SharePoint contact lists can also be synchronized with Outlook contact lists by selecting Actions ➤ Connect to Outlook from the drop-down menu on the list toolbar.

Using Discussion Boards Discussion boards are lists that can be used to start threaded discussions. Threaded discussions allow users to post topics and responses in a tree structure that keeps them together. Discussion boards are superior to e-mail threads when you want to preserve the discussion postings for reference.

Using Links Link list items are hyperlinks to web pages of interest to a team or an organization. A blank list of links typically appears on any new site added to the portal. When users add links to the list, they provide the target URL and a description.

77

78

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Using Calendars Calendars are events associated with meetings, seminars, parties, and so on. When you create a new site, a blank calendar list typically appears on the home page. Users may enter new events directly from the home page and can also associate a document with the event. This is useful for linking directions or agendas with events. Calendars can be synchronized with Outlook by selecting Actions ➤ Connect to Outlook from the drop-down menu on the list toolbar.

Using Tasks Task items form a to-do list for a team. When a new site is created, a blank task list is available. When you create a new task in the list, you may assign it to a team member. The list may then be viewed in summary to track all items for the team. Task lists can be synchronized with Outlook by selecting Actions ➤ Connect to Outlook from the drop-down menu on the list toolbar.

Using Project Tasks Project task items are similar to normal task items except that they show the task list using a Gantt chart format. This list type is useful for creating mini project plans and tracking progress. Project task lists can be synchronized with Outlook by selecting Actions ➤ Connect to Outlook from the drop-down menu on the list toolbar. Figure 3-4 shows a picture of a Gantt chart displayed from a project task list.

Figure 3-4. A Gantt chart display

Using Issues Tracking Issue tracking lists are used to track problems for resolution. This list type is used like a simple help-desk application that assigns an identifier to each issue, a person to resolve it, and a due date. You can also associate other related issues together.

Using Surveys Surveys provide a way to poll portal users for input on a subject. When a site is first created, it usually does not have a survey associated with it. Once created, surveys support a wide variety of response types from simple yes/no answers to free-form text. When the survey is filled out, you may display a number of simple reports to show the results. The list also supports branching logic for surveys, which allows you to present questions based on the response to previous questions.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Using Custom Lists Custom lists in SharePoint allow you to create your own list with your own field definitions. You can create your custom list either in a standard list format or in a datasheet view. Additionally, you can import an existing Excel spreadsheet to create a custom list in SharePoint.

Configuring E-Mail–Enabled Lists Along with using lists to manage documents and items, you can also configure them to receive e-mail. E-mail–enabled lists are given their own e-mail addresses. When they receive mail, the message can be stored and any attached documents can be saved. Configuring e-mail–enabled lists first requires that you set up the SMTP service on the server running MOSS. Follow these steps to install and configure the SMTP service: 1. Log in to VSMOSS as an administrator. 2. Select Start ➤ Administrative Tools ➤ Configure Your Server Wizard. 3. In the Configure Your Server Wizard, click the Next button. 4. On the Preliminary Steps screen, click the Next button. 5. On the Server Role screen, select Mail Server (POP3, SMTP) and click the Next button. 6. On the Configure POP3 Service screen, enter vsmoss.domain.local in the E-Mail Domain Name field. 7. Click the Next button. 8. On the Summary of Selections screen, click the Next button. 9. When the SMTP service is installed, click the Finish button. 10. Open the IIS Manager by selecting Start ➤ Administrative Tools ➤ Internet Information Services Manager. 11. In the IIS Manager, right-click the Default SMTP Server and select Properties from the context menu. 12. In the Properties dialog, click the Access tab. 13. On the Access tab, click the Relay button. 14. On the Relay Restrictions screen, select the option to allow All Except the List Below and click the OK button. 15. Click the OK button. Once the SMTP service is set up, you need to configure the general incoming e-mail settings for the farm. This is done through the Central Administration site. When you configure these settings, you can choose to simply relay incoming mail to the targeted list with no other frills, or you can choose to enable the directory management service (DMS). DMS is used to create mailing lists that you can use through Exchange and Outlook. This makes it easy to find addresses for lists in the same way that you find them for people.

79

80

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Follow these steps to configure incoming e-mail settings: 1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Operations tab. 3. On the Operations page, click the link titled Incoming E-Mail Settings under the Topology and Services section. 4. On the Configure E-Mail Settings page, select the Yes option under the Enable Incoming E-Mail section. 5. Click the OK button. Once the incoming e-mail settings are configured for the farm, you can finally enable an individual list to receive mail. Enabling a list is done through the settings associated with the list. In these settings, you specify the address to use for the list and options regarding the handling of attachments and the original mail message. Follow these steps to e-mail–enable a list: 1. Open the home page of the softball team site you created earlier. 2. In the Quick Launch pane, click the link titled Shared Documents. 3. On the Shared Documents page, select Settings ➤ Document Library Settings from the drop-down menu on the list toolbar. 4. On the Customize Shared Documents page, click the Incoming E-Mail Settings Link. 5. On the Incoming E-Mail Settings page, select the Yes option under the Incoming E-Mail section. 6. Enter softball in the E-Mail Address field. 7. Click the Yes option under Save Original E-Mail. 8. Click the OK button. 9. Now try sending an e-mail to [email protected] and verify that the new e-mail appears in the list.

Working with Pages When you first create a site, it is made up of only the home page. However, you can add additional pages to the site at any time by using the Create page. Although you can access the Create page from the Site Settings page, it is often easier to simply select Site Actions ➤ Create from within the site. From the Create page, you can select to either create a basic page or a web part page. A basic page allows you to create content using a standard web page, while a web part page allows you to design the page using web parts. Regardless of the type of page you create, all pages are stored within a document library. Therefore, you’ll need to create a document library for storing pages.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Follow these steps to create a new page: 1. Open the home page of the softball team site you created earlier. 2. Select Create from the Site Actions drop-down menu. 3. On the Create page, click the Document Library link under the Libraries section. 4. On the New page, name the new document library Basic Pages. 5. In the Document Template drop-down list, select Basic Page. 6. Click the Create button. 7. When the Basic Pages library appears, click New ➤ New Document from the dropdown menu on the library toolbar. 8. On the New Basic Page, enter SoftballRules in the name field. 9. Click the Create button. 10. When the rich-text editor appears, type Rule #1: Have Fun!. 11. Try using various format tools in the dialog to make the text look interesting. 12. Click the Save button. 13. When the new page appears in the browser, copy the URL from the address bar so you can make a link to the new page. 14. Return to the home page of the softball site and locate the Links list. 15. Click the link titled Add New Link. 16. On the Add New Link page, paste the URL you copied earlier into the URL field. 17. Type Softball Rules in the description field. 18. Click the OK button, and you should now have a link from the home page to your new page.

Understanding Alerts and RSS Feeds Alerts provide notification to a particular user when an item of interest has been added or updated within the portal. When a new alert is created, the user can define the areas of interest and set up how the notification will occur. An alert can be established for any list in SharePoint by selecting Actions ➤ Alert Me from the drop-down menu on the list toolbar. When you set up an alert, you can specify options regarding how you want to be alerted. You can ask for an e-mail immediately or have all alerts packaged and sent to you periodically. Figure 3-5 shows a typical alert received in Microsoft Outlook.

81

82

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Figure 3-5. A SharePoint alert

Really Simple Syndication (RSS) is a mechanism for aggregating web content from multiple sources and displaying it in a reader. SharePoint 2007 now supports RSS feeds, which have long been available on the Internet and can make any SharePoint list a source for RSS. Additionally, Outlook 2007 contains an RSS reader that can collect the information from SharePoint lists and display it. You can establish an RSS feed for any SharePoint list by selecting Actions ➤ View RSS Feed from the drop-down menu on the list toolbar. Once established, the RSS feed appears in the folder list of Outlook 2007 and allows you to view list items. Figure 3-6 shows an RSS feed in Outlook 2007 based on the announcements list in the softball site you created earlier.

Figure 3-6. An RSS feed

Understanding Features In the previous version of SharePoint, a significant distinction exists between collaboration sites and portal sites. Microsoft saw these two types of sites as fundamentally different. As a result, different capabilities are built into them. For example, SharePoint Portal Server 2003 has the ability to hide content based on the current user’s membership in a group known as

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

an audience. However, Windows SharePoint Services Version 2 team sites do not have this capability. With this newest release of SharePoint, however, capabilities are packaged into Features that can be activated and deployed to any site in a collection. This means that every site in the collection can have a different combination of portal and collaboration capabilities as desired. While it’s still true that MOSS has more Features than WSS, WSS sites can now use the MOSS Features when they are deployed together. Features can be activated or deactivated at the farm, web application, and site level. You can see the list of available Features for the farm by clicking the link titled Manage Web Application Features on the Application Management tab of the Central Administration site. Similarly, you can access the available Features for a site by opening the Site Settings page and clicking the link titled Site Features. While some Features enable simple changes in a site, many of the listed Features represent significant areas of functionality that I describe in detail in later chapters. Figure 3-7 shows a typical list of Features associated with a site.

Figure 3-7. Viewing Features

Understanding Authentication Options In Chapter 2, I discuss in detail how SharePoint utilizes Windows authentication in the form of NTLM or Kerberos and include detailed steps for enabling Kerberos. A SharePoint site always uses Windows authentication to start; however, you can change the authentication provider later to support authenticating users in a variety of ways. Typically, you will establish a new

83

84

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

access zone, which is a configuration option representing an alternate access path, and associate an authentication mechanism with the new zone. Besides Windows authentication, you can configure web form authentication, web single sign-on authentication, or Active Directory Account Creation Mode.

Extending Web Applications WSS and MOSS support a set of zones that allow you to establish different access methodologies to a single web application. Zones are an administrative category, which you use to specify a different URL for accessing the same web application. The value of this configuration is that you can establish different authentication methods for different zones while delivering the same content to each zone. When you first create a new web application, it is always created in the Default zone. The Default zone is always set up to utilize Windows authentication either through NTLM or Kerberos as you specify. If your web application will only be accessed inside the firewall, you can simply use the Default zone and not worry about any further configuration. However, if you want to make the same content available outside the firewall or change the authentication method, you should extend the web application into another zone. Extending a web application is done from the Central Administration pages on the Application Management tab. Under the SharePoint Web Application Management section, there is a link titled Create or Extend Web Application. Whenever you extend an existing web application, you can choose to associate it with a zone. Figure 3-8 shows part of the administration page where you can select to extend an existing web application into another zone.

Figure 3-8. Extending an existing web application into another zone

Using Forms Authentication Forms authentication uses a web form to collect a username and password that is submitted for verification against a credential store. This is a common way to authenticate users who are not members of the domain. The nice thing about Forms authentication is that you can use a SQL Server database or another Lightweight Directory Access Protocol (LDAP) source to authenticate the user. The data source you use is dictated by an authentication provider that is capable of authenticating users against the desired store. While you can use any authentication provider with SharePoint, common ones include SqlMembershipProvider for use with a SQL Server database; ActiveDirectoryMembershipProvider for use with Active Directory; and LDAPMembershipProvider for use with other LDAP sources such as Lotus Notes. When you want to use Forms authentication, you must add a connectionStrings and a membership section to the web.config file of the web application. Additionally, you must add

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

the same sections to the SharePoint Central Administration application so that permissions can be managed centrally. The exact syntax of the new sections varies, and you may have to perform some additional steps depending on what data store you will use. I cover the configuration details for key providers in the next few sections.

■Tip Save a backup copy of each web configuration file before you modify it. You may want to roll back your changes later.

Authentication with SqlMembershipProvider One of the most common scenarios with Forms authentication employs a SQL Server database as the credential store. The SqlMembershipProvider is used to authenticate users against a SQL database when that database utilizes the same schema as a standard ASP.NET 2.0 application. When Visual Studio 2005 is installed, it automatically configures an instance of SQL Express to serve as a credential store for any ASP.NET 2.0 applications. If you want to use a SQL Server 2005 database instead, it must be configured with the appropriate schema. Creating a credential store in SQL Server 2005 that can be used with Forms authentication in SharePoint is done using the ASPNET_REGSQL.EXE utility. Follow these steps to create a credential store in SQL Server 2005: 1. Log in to VSMOSS or VSWSS as a local administrator. 2. Open a command prompt window and change the directory to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727. 3. At the command prompt, run ASPNET_REGSQL.EXE. 4. On the Welcome screen of the wizard, click the Next button. 5. On the Select a Setup Option screen, select the option labeled Configure SQL Server for Application Services. 6. Click the Next button. 7. On the Select the Server and Database screen, enter VSSQL in the Server field. 8. Click the Next button. 9. On the Confirm Your Settings screen, click the Next button. 10. On the Finish Screen, click Next. When using SQL Server 2005 as the credential store, you are not provided with a good interface for initially populating the database with usernames. If no names are initially in the database, no one can be designated as the site administrator for managing additional users. Therefore, you have to find a way to get at least one name into the database before enabling Forms authentication. The best option for entering users is to simply use the web site configuration tools that ship with Visual Studio 2005. These tools are preconfigured to work with an instance of SQL

85

86

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Express installed alongside Visual Studio. The strategy is to create an ASP.NET project and add a web configuration file that refers to the database you created earlier. Then you can configure the database directly from Visual Studio. Follow these steps to edit the credential database with Visual Studio: 1. Log in to VSMOSS or VSWSS as a local administrator. 2. Start Visual Studio 2005. 3. In Visual Studio, select File ➤ New ➤ Web Site from the main menu. 4. In the New Web Site dialog, select to create a new ASP.NET Web Site. 5. In the Location drop-down list, select File System. 6. Click the OK button. 7. In the Solution Explorer, right-click the project and select Add New Item from the context menu. 8. In the Add New Item dialog, select Web Configuration File and click the Add button. 9. In the web configuration file, replace the element with the following:



10. Select Build ➤ Build Solution from the main menu. 11. After the project is built, select Website ➤ ASP.NET Configuration from the main menu to run the Web Site Administration Tool.

■Tip If you have trouble running the Web Site Administration Tool, you can try creating your web site as an HTTP web site. I have seen some issues when file-based web sites and SharePoint are on the same machine.

12. In the Web Site Administration Tool, click the Security tab. 13. On the Security tab, click the link titled Select Authentication Type. 14. Click the option labeled From the Internet, and click the Done button. 15. On the Security tab, click the Create User link. 16. Fill in some information to create a user and click the Create button.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Once the credential store is created, you can add the new sections to the web.config files of the SharePoint sites. Remember, you must add the section to both the application you want to access and the Central Administration site. The configuration files are all located in subfolders in the path \Inetpub\wwwroot\wss\VirtualDirectories. Here you will find a subdirectory for each of the web applications you have created and the Central Administration site.

■Note SharePoint often uses port numbers to name the application subdirectories. This can make it hard to tell which site is associated with which directory. You can figure this out by examining the Local Path field in the site properties dialog in IIS Manager.

For each file, create a connectionStrings section immediately before the tag and a membership section immediately following the tag. The connectionStrings section defines a valid connection string to access the credential database. The membership section provides configuration information for the SqlMembershipProvider class to use the information in the credential store. Listing 3-1 shows example sections with the tag visible between them. These entries are based on the database you created earlier. Listing 3-1. A Partial Web Configuration File







87

88

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

■Note Not all of the configuration elements associated with the SqlMembershipProvider are necessary for SharePoint. When you use Visual Studio to create the membership database, however, it creates many of the configuration entries by default. You can learn more about the SqlMembershipProvider options at http://msdn2.microsoft.com/en-us/library/system.web.security. sqlmembershipprovider.aspx.

After the configuration files are updated, you are ready to enable Forms authentication. This is done through the Central Administration site. In the Central Administration site, you will switch the provider for the extended web application from Windows to Forms authentication. Follow these steps to enable Forms authentication: 1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Application Management tab. 3. Under the Application Security section, click the link titled Authentication Providers. 4. On the Authentication Providers page, locate the entry for the extended web application. It will be listed alongside the zone into which it was extended and will currently show that it is using Windows authentication. 5. Click the Windows Authentication link to change the provider. 6. On the Edit Authentication page, select the Forms option under Authentication Type. 7. In the Membership Provider Name field, type DB, which is the name of the provider as it appears in the web configuration file. 8. Click the Save button. 9. Click the Application Management tab. 10. Under the Application Security section, click the link titled Policy for Web Application. 11. If the correct web application is not already selected, drop down the web application selection list and click Change Web Application. 12. Click the Add Users button. 13. On the Add Users page, select the Custom zone where you extended the application earlier. 14. Click the Next button. 15. On the Add Users page, type the name of the user you entered into the credential database into the Users field and click the Check Names image button.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

■Note If the Central Administration application cannot find the username you entered, it is very likely that the connection string contained in the configuration file is incorrect. You will generally not receive an error telling you this, but the vast majority of issues are related to the connection string.

16. Under the Choose Permissions section, check the box labeled Full Control – Has Full Control. 17. Click the Finish button. Once the initial user has been given rights to the site you can open the site in a browser. You should see a login page where you can type the credentials you entered into the database earlier. Because you granted full control to this user, you can now use the Site Settings from within the site to add new users and give them rights.

Authentication with ActiveDirectoryMembershipProvider The ActiveDirectoryMembershipProvider is an authentication provider for use with Active Directory. Using this provider, you can set up Forms authentication for users who have accounts within the domain. This type of authentication is good for creating extranet solutions where you want to provide a login screen rather than just popping up the ugly gray Windows authentication box. Exercise 3.1 at the end of this chapter uses the ActiveDirectoryMembershipProvider to create an extranet, so I will not cover it in detail here.

Authentication with LDAPMembershipProvider MOSS ships with an additional authentication provider called LDAPMembershipProvider. The LDAPMembershipProvider allows you to authenticate users against other LDAP sources such as Lotus Notes. This provider is most useful for environments that are not using Active Directory—although it certainly could be used with Active Directory, which is LDAP-compliant. Like all of the other providers, the LDAPMembershipProvider requires you to make connectionString and membership entries in the web configuration file. Listing 3-2 shows an example configuration for the provider for the Active Directory you set up in Chapter 2. Listing 3-2. Configuring LDAP Authentication



Using Web Single Sign-On In addition to the authentication providers already discussed, SharePoint also gives you the option to use a web single sign-on service for authentication. A web single sign-on service is a separate third-party service used to provide authentication across many disparate systems. Windows Live ID service is an example of a web single sign-on service. In addition to registering a provider in the web configuration file, these types of providers also require you to register an HTTP module with specific information about the provider. Web single sign-on providers are beyond the scope of this book.

Using Active Directory Account Creation Mode The final authentication option available in SharePoint is a special account mode known as Active Directory Account Creation (ADAC). This mode is intended for use by Internet service providers (ISPs) who support large constituencies that are not members of the hosting domain. In ADAC mode, users can self-register using e-mail addresses instead of domain accounts. In this way, an ISP can host Internet users without having to specifically add them to a domain. It’s important to note that ADAC is incompatible with the normal domain account mode. During the installation of WSS, you select the mode in which the farm will operate. After you make the selection, you cannot alter it. Throughout this book, I assume that SharePoint Services are operating in domain account mode.

Extending Web Applications Outside the Firewall Once a new web application is created in SharePoint you can extend the web application onto another IIS site. Extending an existing web application to another IIS site allows you to create multiple access paths to the same web application. This is useful for setting up scenarios in which a web application will be accessed by one group of people inside the firewall and another group of people outside the firewall. Each time you extend a web application, you have the opportunity to change the authentication methods and URL mappings to suit the intended audience. Additionally, you can secure SharePoint sites using Secure Sockets Layer (SSL).

Working with Alternate Access Mappings When you create a new web application in WSS or MOSS, it is configured by default to utilize internal server names and URLs. This means that a web application in the Default zone is not initially suitable for exposure outside the firewall. If you were to simply forward port 80 from your firewall to the internal IP address of the SharePoint server, you would discover that external users are redirected to the internal name of the server and access would fail. In order to

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

make external access function correctly, you must provide an alternate access mapping that directs the incoming URL to the SharePoint web application. Incoming URLs are associated with a specific zone so you can limit the mapping to a given set of users. Establishing alternate access maps is done through the Central Administration site on the Operations tab. Figure 3-9 shows a page from the Central Administration site with some mappings defined. Exercise 3.1 at the end of this chapter covers the steps necessary to create alternate mappings for an externally facing site.

Figure 3-9. Alternate access mappings

Enabling Secure Sockets Layer When you create or extend a web application, you will have the option to enable SSL. Enabling SSL provides an extra level of security based on certificates and encryption. In order to enable SSL for SharePoint, you must obtain and install a server certificate on any IIS web sites that will be accessed through SSL. Exercise 3.1 walks you through the process of creating a secure site with SSL enabled.

Exercise 3.1. Creating a Secure Internet Site In the previous version of SharePoint, creating web sites that are accessible from outside the firewall is a challenge. Under SharePoint 2007, this capability is greatly improved through the use of zones, Forms authentication, and alternate access mappings. In this exercise, you will create a secure Internet site using several of these capabilities. This exercise assumes that you have set up the development environment described in Chapter 2 and will work with either WSS or MOSS. If your environment is different, you may have to modify some steps.

■Note If you have previously modified your SharePoint installation to use another Forms authentication provider—such as SqlMembershipProvider—while working through the chapter text, roll those changes back before you start this exercise.

91

92

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Extending the Web Application When you created your first web application in Chapter 2, it was created in the Default zone using Windows authentication. Generally speaking, it is a good idea to always use Windows authentication in conjunction with the Default zone so that users inside the firewall can access the web application. If you want to make the web application available outside the firewall, you should extend it into the Internet or Extranet zone. In this exercise, you will extend the existing web application into the Extranet zone in order to create a secure site. Follow these steps to extend the existing web application into the Extranet zone:

■Tip Normally, you would want to set up the Default zone on a port other than port 80. Then when you extend the web application, you would extend it onto port 80. In this exercise, you are setting up the extranet on a port other than 80, because you used port 80 in Chapter 2.

1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Application Management tab. 3. Under the SharePoint Web Application Management section, click the link titled Create or Extend Web Application. 4. On the Create or Extend Web Application page, click the link titled Extend an Existing Web Application. 5. On the Extend Web Application to Another IIS Web Site page, drop down the Web Application selection list and click Change Web Application. 6. In the Select Web Application page, click the link for the web application that you set up in Chapter 2. 7. Under the IIS Web Site section, choose Create a New IIS Web Site. 8. In the Description field type Extranet, but leave the port number in parentheses as part of the name. 9. Under the Security Configuration section, choose Yes from the Use Secure Sockets Layer (SSL) option group. 10. Under the Load Balanced URL section, select Extranet from the Zone drop-down list. 11. Make note of the URL for the extended web application so you can access it later. 12. Click the OK button.

Creating an Alias Creating an alias for your web site is a simple matter of making a new record entry in the Domain Name Service for the network. Creating an alias will allow you to use a name such

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

as sharepoint.domain.local when accessing a web application. Although you will create your alias solely for internal use, you can create an alias for external use and map it to an IP address that will expose the portal on the Internet.

■Note Remember to add a new incoming URL entry to SharePoint when you utilize an external IP address. The steps for adding an incoming URL entry are covered earlier in this exercise.

Follow these steps to create an alias for the SharePoint server: 1. Log in to VSPDC as the domain administrator. 2. Select Start ➤ Administrative Tools ➤ DNS. 3. In the dnsmgmt dialog, expand the Forward Lookup Zones folder. 4. Right-click the domain.local folder and select New Alias (CNAME) from the pop-up menu. 5. In the New Resource Record dialog, type extranet. 6. Click the Browse button. 7. Double-click the VSPDC node. 8. Double-click the Forward Lookup folder. 9. Double-click the domain.local folder. 10. Select the VSWSS or the VSMOSS entry from the list as appropriate and click the OK button. 11. In the New Resource Record dialog, click the OK button.

Installing Certificate Services Server certificates can be purchased commercially from a trusted source such as VeriSign, or you can create your own using Microsoft Certificate Services. In our exercise, we will install and utilize Microsoft Certificate Services. Making your own certificates is fine for testing and limited production use, but if you are going to allow access to the portal to a wide audience, you should consider getting a certificate from a trusted provider.

Adding the Application Server Role IIS is required in order to make certificates available for download and distribution. Therefore, you must install IIS before installing Certificate Services. Follow these steps to configure VSPDC: 1. Log in to VSPDC as a domain administrator. 2. Start ➤ Administrative Tools ➤ Configure Your Server Wizard. 3. On the Preliminary Steps screen, click the Next button.

93

94

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

4. On the Server Role screen, select Application Server (IIS, ASP.NET) from the list of available roles and click the Next button. 5. On the Application Server Options screen, check the ASP.NET box and click the Next button. 6. On the Summary of Selections screen, click the Next button.

Adding Certificate Services Once IIS is installed, you may proceed to add Certificate Services to the server. This will allow you to issue your own trusted certificates to SharePoint servers. Follow these steps to install Certificate Server: 1. Log in to VSPDC as a domain administrator. 2. Select Start ➤ Control Panel ➤ Add or Remove Programs. 3. In the Add or Remove Programs dialog, click the Add\Remove Windows Components button. 4. In the Windows Components dialog, check the Certificate Services box. 5. Respond to the warning dialog by clicking the Yes button. 6. Uncheck the Internet Explorer Enhanced Security Configuration box. 7. In the Windows Components dialog, click the Next button. 8. In the CA Type step, select Stand-Alone Root CA. 9. Click the Next button. 10. In the CA Identifying Information step, type VSPDC into the Common Name for This CA text box. 11. Click the Next button. 12. In the Certificate Database Settings step, accept the default values and click the Next button. 13. Click the Finish button to complete the operation.

Requesting a New Certificate Creating a certificate begins by preparing a request using the virtual server that you want to secure. This server prepares a text file that may then be submitted to Certificate Services. In this exercise, you can create a request for either VSWSS or VSMOSS depending upon whether you installed WSS or MOSS in Chapter 2. Follow these steps to prepare a request: 1. Log in to VSWSS or VSMOSS as a local administrator. 2. Open the Windows File Explorer.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

3. Create a new directory named c:\certificates\sharepoint. 4. Select the c:\certificates directory, right-click it and select Sharing and Security from the pop-up menu. 5. On the Sharing tab, select Share This Folder. 6. Click the Permissions button. 7. Select Grant Everyone Full Control and click the OK button. 8. Press the OK button to close the directory properties dialog. 9. Select Start ➤ Administrative Tools ➤ Internet Information Services (IIS) Manager. 10. Open the Web Sites folder. 11. Right-click the Web Site node where the web application was extended into the Extranet zone and select properties from the pop-up menu. 12. On the Directory Security tab, click the Server Certificate button. 13. In the Web Server Certificate Wizard, click the Next button. 14. In the Server Certificate step, select the option to create a new certificate, and click the Next button. 15. In the Delayed or Immediate Request step, select the option to Prepare the Request Now, but Send It Later, and click the Next button. 16. In the Name and Security Settings step, leave the values as they are and click the Next button. 17. In the Organization Information step, type your company name in the Organization field and your company unit in the Organizational Unit field. 18. Click the Next button. 19. In the Your Site’s Common Name step, type VSWSS or VSWOSS in the Common Name field as appropriate. 20. Click the Next button. 21. In the Geographical Information step, enter the appropriate information and click the Next button. 22. In the Certificate Request File Name step, click the Browse button. 23. In the Saves As dialog, navigate to the c:\certificates\sharepoint directory and click the Save button. 24. In the Certificate Request File Name step, click the Next button. 25. In the Request File Summary step, click the Next button. 26. Click the Finish button to complete the operation.

95

96

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Creating a New Certificate Once the request is prepared, you may use it to create a new certificate. Certificate Services uses the text file created under IIS to generate the certificate. The new certificate may then be installed on the SharePoint server. Follow these steps to create the new server certificate: 1. Log in to VSPDC as the domain administrator. 2. Open the Internet Explorer and navigate to http://vspdc/certsrv/default.asp. 3. Click the Request a Certificate link. 4. Click the Advanced Certificate Request link. 5. Click the link to submit a certificate request by using a base-64–encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64–encoded PKCS #7 file. 6. Open the certificate text file in Notepad that you previously saved at \\vswss\ certificates\sharepoint or \\vsmoss\certificates\sharepoint as appropriate. 7. Copy the entire contents of the certificate file and paste it into the Saved Request field. 8. Click the Submit button. 9. Select Start ➤ Administration Tools ➤ Certification Authority. 10. In the Certification Authority dialog, expand the tree and open the Pending Requests folder. 11. Locate the pending request, right-click it and select All Tasks ➤ Issue from the pop-up menu. 12. Open Internet Explorer and navigate to http://vspdc/certsrv/default.asp. 13. Click the link titled View the Status of a Pending Certificate Request. 14. Click the link for the pending certificate. 15. On the Certificate Issued page, click the Download Certificate link. 16. In the File Download dialog, click the Save button. 17. Save the file into the \certificates\sharepoint directory. 18. On the Certificate Issued page, click the Download Certificate Chain link. 19. In the File Download dialog, click the Save button. 20. Save the file into the \certificates\sharepoint directory.

Installing the New Certificate Once the new certificate is created, you can install it on the SharePoint server. When using the Microsoft Certificate Services, you must install the certificate file with the P7B extension. This file will establish the appropriate trusts to ensure that you can view the web application.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

To install the new certificate, do the following: 1. Log in to VSWSS or VSMOSS as the local administrator. 2. Select Start ➤ Administrative Tools ➤ Internet Information Services (IIS) Manager. 3. Expand the VSWSS or VSMOSS node as appropriate and open the Web Sites folder. 4. Right-click the Web Site node where web application was extended into the Extranet zone and select Properties from the context menu. 5. On the Directory Security tab, click the Server Certificate button. 6. In the Web Server Certificate wizard, press the Next button. 7. In the Pending Certificate Request step, select Process the Pending Request and Install the Certificate. 8. Press the Next button. 9. In the Process a Pending Request step, press the Browse button. 10. In the Open dialog, navigate to the \certificates\sharepoint directory and select the file with the P7B extension. 11. Click the Open button. 12. In the Process a Pending Request step, click the Next button. 13. In the SSL Port step, accept the default value and click the Next button. 14. In the Certificate Summary step, view the details and click the Next button. 15. Click the Finish button to complete the operation. 16. In the Default Web Site Properties dialog, click the View Certificate button. 17. In the Certificate dialog, verify that the certificate is valid by viewing the Certification Path tab. 18. Click the OK button. 19. In the Web Site Properties dialog, click the Edit button under the Secure Communications section. 20. In the Secure Communications dialog, check the Require Secure Channel box and click the OK button. 21. In the Web Site Properties dialog, click the OK button.

Configuring Forms Authentication Forms authentication allows you to configure a SharePoint page as a login form instead of utilizing Windows authentication directly. SharePoint supports many different providers for authenticating users against other data stores such as SQL Server or an LDAP service. In this exercise, you will make use of the ActiveDirectoryMembershipProvider to configure Forms

97

98

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

authentication against Active Directory. In this scenario, users will enter their Windows credentials into the login form to gain access to the secure site. Follow these steps to set up Forms authentication: 1. Log in to VSWSS or VSMOSS as the local administrator. 2. Open the File Explorer and navigate to \Inetpub\wwwroot\wss\VirtualDirectories. 3. Under the VirtualDirectories folder, identify the subdirectory that is associated with your extranet site and the folder associated with the Central Administration site.

■Note Because the subdirectory names can be quite cryptic, it is often useful to open the properties dialog for a web site directly in the IIS Manager to determine which directory is associated with which site.

4. Open the web.config file for both the extranet site and the Central Administration site. The provider information must be added to both files. 5. Directly above the tag in both files, add the following section to define a connection to Active Directory:

6. Directly underneath the tag in both files, add the following section to utilize the ActiveDirectoryMembershipProvider as the authentication provider:

■Note Be sure to change the password in the following code to match your development environment.





CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

7. Save and close both files. 8. Select Start ➤ Run. In the Run dialog, type iisreset and click the Open button. 9. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 10. In the Central Administration site, click the Application Management tab. 11. Under the Application Security section, click the link titled Authentication Providers. 12. If the correct web application is not already selected, drop down the Web Application selection list and click Change Web Application. Then click the link for the initial web application that you set up in Chapter 2. 13. On the Authentication Providers page, click the Windows link associated with the Extranet zone. 14. On the Edit Authentication page, select Forms as the Authentication Type. 15. In the Membership Provider Name field, type AD, which is the name of the provider as it appears in the web.config file. 16. Click the Save button. 17. In the Central Administration site, click the Application Management tab. 18. Under the Application Security section, click the link titled Policy for Web Application. 19. If the correct web application is not already selected, drop down the Web Application selection list and click Change Web Application. Then click the link for the initial web application that you set up in Chapter 2. 20. Click the Add Users button. 21. On the Add Users page, select Extranet from the zone list. 22. Click the Next button. 23. On the Add Users page, type Administrator into the Users field and click the Check Names image button. 24. Under the Choose Permissions section, check the box labeled Full Control – Has Full Control. 25. Click the Finish button.

99

100

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Adding a New Incoming URL Whenever you use an alias or external IP address to access a SharePoint site, you must set up alternate access mappings or else the authentication will fail. This is because SharePoint will deliver URLs that reference internal server names by default. In this exercise, you need to add a new incoming URL because the project site uses an alias. Follow these steps to specify an incoming URL: 1. Open the Central Administration site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 2. In the Central Administration site, click the Operations tab. 3. Under the Global Configuration section, click the link titled Alternate Access Mappings. 4. On the Alternate Access Mappings page, click the Add Internal URLs button. 5. On the Add Internal URLs page, drop down the Alternate Access Mapping Collection selection list and click Change Alternate Access Mapping Collection. 6. In the Select Alternate Access Mapping page, click the link for the initial web application that you set up in Chapter 2. 7. In the URL Protocol, Host, and Port field, enter https://extranet.domain.local:[port]. 8. In the Zone drop-down list, select Extranet. 9. Click the Save button. 10. On the Alternate Access Mappings page, click the Edit Public URLs button. 11. On the Edit Public Zone URLs page, enter https://extranet.domain.local:[port] in the Extranet field replacing the internal reference that SharePoint initially created. 12. Click the Save button.

Testing Secure Access Once the certificate is installed on the SharePoint server, you are ready to utilize SSL. When users access the portal through SSL, they will initially see the certificate warning. They can subsequently install the certificate on their machines and trust your root authority. This will allow them to access the portal without acknowledging the certificate each time.

CHAPTER 3 ■ SHAREPOINT FUNDAMENTALS

Follow these steps to test secure communications: 1. Log in to VSCLIENT as a portal end user. 2. Open Internet Explorer and navigate to https://extranet.domain.local:[port]/ sites/intranet/Pages/default.aspx, which should correspond to the home page of the extended web application if you set up the environment in Chapter 2. 3. When the Security Alert dialog appears, click Yes. 4. When the login form appears, enter Administrator in the Username field along with the associated password and click the Sign In button. Figure 3-10 shows the login page.

Figure 3-10. Forms authentication on a secure site

101

CHAPTER

4

SharePoint Shared Services W

hile a SharePoint farm gives you the ability to create many separate web applications, there are several services that you will not necessarily want to recreate for each new web application. The most obvious example of such a service is the Search Service. In many scenarios, it makes sense to set up the Search Service one time and then share it across several web applications. This is the concept behind the Shared Services Provider (SSP) in SharePoint. An SSP provides not only a shared Search Service, but also audiences, user profiles, personal sites, Excel Services, and the Business Data Catalog (BDC). Audiences allow you to target content at particular groups of users. The profile service allows you to track and share information about portal users. Personal sites give each user a private space to utilize. Excel Services makes spreadsheet information and calculations available as a web application, while the BDC allows you to integrate SharePoint sites with back-end line-of-business systems. I cover each of these services in detail throughout this chapter.

Creating and Managing Shared Services Providers Creating an SSP is done through the Central Administration site in MOSS. While WSS sites can utilize an SSP, you cannot create one through WSS. Within a farm, you can configure zero or more SSPs, and MOSS will typically create one during the installation process. In fact, you already have one available if you set up the development environment described in Chapter 2. Follow these steps to manage your SSP: 1. Log in to VSMOSS as a SharePoint administrator. 2. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. From the home page of the Central Administration site, click the Application Management tab. 4. On the Application Management tab, click the link titled Create or Configure This Farm’s Shared Services. On the Manage This Farm’s Shared Services page, you’ll see a list of all the SSPs that you have defined on your farm. Additionally, you’ll see all of the web applications that are currently using those services. From this page, you can create a new SSP, change the associations with web applications, and recover an SSP from a backed-up database. Figure 4-1 shows the page with several web applications listed. 103

104

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-1. Managing Shared Services

When you create a new SSP, you get an administration site where you can configure and manage the Shared Services. You can access the administration site from the Manage This Farm’s Shared Services page by clicking the appropriate link listed under Shared Services Administration. You can also hover over the name of the SSP in the list and select Open Shared Services Admin Site from the drop-down menu. In either case, you will be taken to the Shared Services Administration site shown in Figure 4-2.

■Tip If you should receive an “Access Denied” error, be sure your account has been given Full Control rights under the Policy for Web Application associated with the Shared Services web application.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-2. The Shared Services Administration site

Configuring Search When you first installed MOSS, you started the Search Service, which is configured with the basic settings necessary to search web applications. However, you will want to spend some time adjusting the search configuration to control how content is indexed and delivered through the service. From the home page of the Shared Services Administration site, clicking the Search Settings link will take you to the Configure Search Settings page where you can refine the Search Service configuration.

■Note If you are just using WSS, you’ll have a separate Search Service available to you. You can configure the service from the Central Administration web site. Click the link titled Services on This Server on the Operations tab. On the Services page, start the Windows SharePoint Services Search Service.

Crawling Content Sources The crawl settings on the Configure Search Settings page determines what content is indexed by the Search Service. The first setting to check in this section is the default content access account. This account is the one that is used to crawl content and create an index. Therefore,

105

106

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

the account must have access to all of the content to be indexed. If you set up the development environment in Chapter 2, you should use the DOMAIN\SPCrawlAcct account you created during the MOSS installation. After the content access account is set, you’ll want to define the content sources to be indexed. By default, MOSS creates a content source for SharePoint sites. If you only intend to search SharePoint content, this source may be all you need. However, you can define other content sources including web sites, file shares, Exchange public folders, and business data from the BDC. Along with the content source, you can also define crawl rules. Crawl rules allow you to specify what content is included or excluded from a source. You can also set a special account to use when crawling the source if the default account does not have access for some reason. If the content you crawl has a different address than you want to appear in the search results, you can create a server name mapping. This is useful if, for example, you crawl content using an address inside the firewall but want to make the results available outside the firewall. Simply enter the address of the crawled content and the mapped address for the search results. After you have configured the content sources, you need to specify a schedule for the crawl. You won’t get any results back from the Search Service until a full crawl of the content sources has been completed. Because a full crawl is resource intensive, you should try to schedule it for off-hours. Follow these steps to set up a crawl schedule: 1. From the Configure Search settings page, click Content Sources and Crawl Schedules. 2. On the Manage Content Sources page, hover over the Local Office SharePoint Server Sites content source and select Edit from the drop-down menu. 3. On the Edit Content Source page, click the Create Schedule under the Full Crawl Schedule list. 4. In the Manage Schedules dialog, accept the default settings by simply clicking the OK button. 5. Check the box labeled Start Full Crawl of This Content Source. 6. Click the OK button.

Including File Types When the Search Service creates a content index, it does not include all of the file types it encounters. This is because many file types might not make any sense in the search results. For example, EXE files are not included in the content index because they are not documents and might even contain a virus. While the out-of-the-box settings index most of the commonly used file types, not every file type you may want is included. In particular, most organizations want to include Adobe Acrobat portable document format (PDF) files in the search results, but they are not included by default. In order to include other file types, you must first install the appropriate IFilter. IFilters are used to build indexes for specific document formats. Each file type that you want to include must have an installed IFilter before it can be part of the index. After you install the IFilter, you must then provide an image to represent the file within SharePoint and specifically tell the index to include the file type.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Follow these steps to include PDF files in your search results: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open Internet Explorer and navigate to http://www.adobe.com/support/downloads/ thankyou.jsp?ftpID=2611&fileID=2457 to download the Adobe PDF IFilter v6.0. 3. Download and install the IFilter on VSMOSS. The installation is straightforward and requires no special considerations. 4. Open the Internet Explorer and navigate to http://www.google.com. 5. On the Google home page, click the Images link. 6. Type ICPDF.GIF in the search field and click the Search Images button. 7. In the search results, locate a 16-by-16 PDF icon image and click it. 8. On the Google Images page, click the link titled See Image Alone. 9. When the image appears alone in the browser, right-click the image and select Save Picture As from the content menu. 10. Save the image to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES. 11. Open a copy of the File Explorer and locate the file C:\Program Files\Common Files\ Microsoft Shared\web server extensions\12\TEMPLATE\XML\DOCICON.XML. Open this file in a text editor. 12. In the DOCICON.XML file, locate the element. In this section, add the following code to specify the icon for use with PDF files:

13. Save and close DOCICON.XML. 14. On the Configure Search Settings page of the Shared Services Administration site, click the link titled File Types. 15. On the Manage File Types page, click the New File Type link. 16. On the Add File Type page, type pdf into the File Extension field and click the OK button. 17. Close the browser. 18. Select Start ➤ Run from the menu. 19. Type iisreset into the Open field and click the OK button. Once you complete the previous steps, you should be able to add PDF documents to libraries and immediately see them associated with the appropriate icon. After the search index is rebuilt, you should also be able to return them in the search results. Of course, users will still need to have the Adobe Acrobat Reader installed to view the documents. For other file types, you can search the Internet for available third-party IFilters. It is even possible to create your own custom IFilter, although that topic is well beyond the scope of this book.

107

108

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Understanding Search Scopes While content sources define groups of documents to index, they may not correspond to groups of documents that users want to search. Search scopes allow you to define sets of documents from various content sources that should be searched together. Search scopes help users get better results by narrowing the search to items of interest. Follow these steps to set up a new search scope: 1. From the Configure Search Settings page, click View Scopes. 2. On the View Scopes page, click New Scope. 3. On the Create Scope page, enter Special Interest Groups and click the OK button. 4. On the View Scopes page, locate the Special Interest Groups scope and click the Add Rules link. 5. On the Add Scope Rule page, select the Web Address option. 6. Enter the complete address to the softball site you created earlier in the Folder field (e.g., http://vsmoss/sites/intranet/softball). 7. Click the OK button. 8. On the Configure Search Settings page, click the Start Update Now link under the Shared Scopes section. Once the search scope is created, it must be added to the search page in order to use it. Requiring a separate operation to make the scope visible allows you to control which web applications can use the scope. This ensures that only appropriate users make use of the scope. Follow these steps to add the scope to the search page: 1. Open the home page to the MOSS intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/Default.aspx). 2. Select Sites Settings ➤ Modify All Site Settings from the Site Actions drop-down menu. 3. On the Site Settings page, click the Search Scopes link under the Site Collection Administration section.

■Tip If you do not see the Search Scopes link, make sure that you are on the Site Settings page for the top-level site in the Site Collection.

4. On the View Scopes page, click the Search Dropdown link. 5. On the Edit Scope Display Group page, check the box next to the Special Interest Groups scope. 6. Click the OK button.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Using Keywords and Best Bets Oftentimes organizations have important terms that are well-known by all of their members. These terms have definite meaning within an organization and are associated with certain documents. Therefore, when a user searches a particular term, you might want to ensure that it is always associated with the correct results. This is the purpose behind keywords and best bets. Keywords allow you to define the terms that have special meaning in your organization. You can then associate those terms with a specific search result, or “best bet.” The best bet results will appear at the top of the search results list whenever the keyword is used in a search. You can define keywords and best bets from the Site Settings page by clicking the Search Keywords link.

Reporting on Search Usage One of the best ways to improve search results is to understand how users are searching. In order to support this, Shared Services provides a set of search usage reports for profiling search activity. You can access these reports from the home page of the Shared Services Administration site under the Search section.

Using Audiences Although you will undoubtedly spend a significant amount of time deciding what content to display on which page, most users will be interested in only a subset of the information on a page. Furthermore, page real estate is often in short supply, especially if you want to limit the amount of scrolling required to view a page. With this in mind the Office SharePoint Standard Feature provides the ability to define audiences. Audiences in SharePoint are groups of users that share common interests and can be used to display or hide various content elements based on the audience membership of the current user. Audiences can be defined based on various properties of user accounts in Active Directory. You can define an audience based on membership in an Active Directory group, position in the organizational structure, or other characteristics. Once defined, the audience must be compiled in order to make it available for use with web parts. Follow these steps to define an audience: 1. Log in to VSPDC as a domain administrator. 2. Select Start ➤ Administrative Tools ➤ Active Directory Users and Computers. 3. In the Active Directory Users and Computers dialog, expand the tree underneath the DOMAIN.LOCAL node until the Users folder is visible. 4. Right-click the Users folder and select New ➤ Group from the context menu. 5. In the New Object – Group window, enter Information Technology in the Group Name field. 6. Click the OK button. 7. In the Active Directory Users and Computers dialog, right-click the Information Technology group and select properties from the context menu.

109

110

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

8. Click the Members tab and then the Add button. 9. In the Select Users, Contacts, or Computers window, add some users to the group. 10. Click OK to close the dialog when you are finished. 11. Log in to VSMOSS as a site administrator. 12. Open the Central Administration web site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 13. From the Central Administration home page, click the Application Management tab. 14. On the Application Management page, click the link titled Create or Configure This Farm’s Shared Services. 15. In the Quick Launch area, click the link for the Shared Services Administration site. 16. On the Shared Services Administration home page, click the Audiences link. 17. On the Manage Audiences page, click the Create Audience link. 18. On the Create Audience page, type Information Technology in the Name field. 19. Click the OK button. 20. On the Add Audience Rule page, select the User option. 21. In the Operator drop-down list, select Member Of. 22. In the value field, type Information Technology and click the Check Names button. 23. Click the OK button. 24. On the Manage Audiences page, click the Start Compilation link, which will create the audience membership based on the rules you defined. Audiences will not have members until they are compiled. Because audience membership can change over time, it’s best to set up a compilation schedule. You can specify a compilation schedule by clicking the link on the Manage Audiences page. After that, the audience will always be available for use with web parts, documents, list items, and other content items in MOSS. Using audiences to display or hide content is generally done as part of the configuration properties for an item. You can show or hide web parts in a page based on audience membership using the web parts property pane. Simply type the name of the audiences that you want to see the content. Figure 4-3 shows a Content Editor web part being targeted at the Information Technology audience.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-3. Targeting content with audiences

Understanding User Profiles Members of a SharePoint site are not simply anonymous users who view web pages and read documents. Instead, users are active participants whose information is part of the overall content. In MOSS, the information about portal users is significantly enhanced through user profiles. User profiles are created in a separate database that is populated by both manual data entry and importing data directly from Active Directory. Once created, the profile may be viewed after a search within the People scope or as the result of following a link associated with a person. Figure 4-4 shows a typical public profile page. Setting up profiles requires you to configure an import connection to Active Directory. Typically, the import is scheduled to run daily using a specific account you assign to this task. As a best practice, you should define a new group in Active Directory for all accounts that will be imported and create a new account that SharePoint can use for reading Active Directory information.

111

112

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-4. Profile information on MOSS

Follow these steps to create required groups and users: 1. Log in to VSPDC as a domain administrator. 2. Select Start ➤ Administrative Tools ➤ Active Directory Users and Computers. 3. In the Active Directory Users and Computers dialog, expand the tree underneath the DOMAIN.LOCAL node until the Users folder is visible. 4. Right-click the Users folder and select New ➤ User from the context menu. 5. In the New Object – User dialog, type SPProfileImport in both the Full Name and User Logon Name fields. 6. Click the Next button. 7. Uncheck the box labeled User Must Change Password at Next Logon. 8. Check the boxes labeled User Cannot Change Password and Password Never Expires. 9. Enter a password for the account and click the Next button. 10. Click the Finish button. 11. Right-click the Users folder and select New ➤ User from the context menu. 12. In the New Object – User dialog, enter some information for a new user account. The exact information does not matter, because you will disable this account later for testing purposes.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

13. In the Active Directory Users and Computers dialog, right-click the new user you created and select properties from the context menu. 14. On the Account tab of the Properties dialog, check the box labeled Account Is Disabled. 15. Click the OK button. 16. Right-click the Users folder and select New ➤ Group from the context menu. 17. In the New Object – Group window, enter Portal Profiles in the Group Name field. 18. Click the OK button. 19. In the Active Directory Users and Computers dialog, right-click the Portal Users group and select Properties from the context menu. 20. Click the Members tab and then the Add button. 21. In the Select Users, Contacts, or Computers window, add the users who will have profiles in SharePoint including the disabled account. 22. Click OK to close the dialog when you are finished. The simplest way to configure the profile import is to let SharePoint automatically detect the domain controller on the network. This simplifies the import configuration, but it doesn’t make it foolproof. In most organizations, Active Directory is full of disabled accounts, service accounts, and test accounts that we don’t want to import into the profile database. Therefore, you’ll need to create a custom LDAP query to properly configure the import to exclude such accounts. Creating a proper LDAP query from scratch can be a challenge so I like to use the command-line utility LDIFDE.EXE, which is part of the Windows operating system, to help me determine the correct query for importing accounts. LDIFDE.EXE creates, modifies, and deletes Active Directory objects. You can also use it to run LDAP queries and dump the results to a text file. In this way, you can see which users are returned from an LDAP query and make adjustments until you get the correct result set. Listing 4-1 shows sample output for a single user as it appears in LDIFDE.EXE. Listing 4-1. LDIFDE.EXE Sample Output dn: CN=Scot P. Hillier,CN=Users,DC=domain,DC=local changetype: add objectClass: top objectClass: person objectClass: organizationalPerson objectClass: user cn: Scot P. Hillier sn: Hillier givenName: Scot initials: P distinguishedName: CN=Scot P. Hillier,CN=Users,DC=domain,DC=local

113

114

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

instanceType: 4 whenCreated: 20051017174105.0Z whenChanged: 20051017174908.0Z displayName: Scot P. Hillier uSNCreated: 13920 memberOf: CN=Portal Profiles,CN=Users,DC=domain,DC=local uSNChanged: 13968 name: Scot P. Hillier objectGUID:: xC6/b7NXn0ak+PIEdCyh4Q== userAccountControl: 66048 badPwdCount: 0 codePage: 0 countryCode: 0 badPasswordTime: 0 lastLogoff: 0 lastLogon: 0 pwdLastSet: 127740444656093750 primaryGroupID: 513 objectSid:: AQUAAAAAAAUVAAAA+Tig7KBg3xJxhGmOUwQAAA== accountExpires: 9223372036854775807 logonCount: 0 sAMAccountName: ScotHillier sAMAccountType: 805306368 userPrincipalName: [email protected] objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=domain,DC=local mail: [email protected] In order to create the correct LDAP query for importing profiles, you should start by dumping all of the accounts from Active Directory into a text file. If you should happen to have thousands of accounts in your directory, start by dumping a single organizational unit or group. After dumping the accounts, examine the test file to locate the distinguished name (DN) that defines membership in the group you are targeting. Then use the DN to further refine the dump until you get what you want. You’ll also want to add a special clause to the query to exclude all disabled accounts. Follow these steps to create an LDAP query for importing profile information: 1. Log in to VSMOSS as a SharePoint administrator. 2. Select Start ➤ Run. 3. Type ldifde -f c:\users.txt -r “(&(objectCategory=Person)(objectClass=User))” into the Open field. 4. Click the OK button. 5. Open the file c:\users.txt in Notepad and verify that all of the accounts from Active Directory are returned.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

6. Search the text file for one of the usernames that you included in the Portal Profiles group. This person should have at least one memberOf entry that looks like the following code. Copy this entry for use in the next step: memberOf: CN=Portal Profiles,CN=Users,DC=domain,DC=local 7. Select Start ➤ Run. 8. Narrow the LDAP query to the Portal Profiles group by typing ldifde -f c:\users.txt -r “(&(objectCategory=Person)(objectClass=User)(memberOf= CN=Portal Profiles, CN=Users,DC=domain,DC=local))” into the Open field. 9. Open the file c:\users.txt in Notepad and verify that you are returning all of the members of the Portal Profiles group including the disabled account. 10. Select Start ➤ Run. 11. Exclude disabled accounts from the LDAP query typing ldifde -f c:\users.txt -r “(&(objectCategory=Person)(objectClass=User)(memberOf= CN=Portal Profiles, CN=Users,DC=domain,DC=local) (!(userAccountControl:1.2.840.113556.1.4. 803:=2)))” into the Open field. 12. Open the file c:\users.txt in Notepad and verify that you are returning only the enabled accounts from the Portal Profiles group. Once you have created a query that returns only the accounts you want in the profile database, you are ready to configure the import. Profiles are managed as part of the Shared Services infrastructure, which is configured through a separate web site. After the import is configured, you can run a full import to populate the database. Follow these steps to configure the profile import: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open the Central Administration web site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. From the Central Administration home page, click the Application Management tab. 4. On the Application Management page, click the link titled Create or Configure This Farm’s Shared Services. 5. On the Manage This Farm’s Shared Services page, select Open Shared Services Admin Site from the drop-down menu. 6. On the Shared Services Administration home page, click the link titled User Profiles and Properties. 7. On the User Profiles and Properties page, click the link titled Configure Profile Import. 8. On the Configure Profile Import page, select the Custom Source option. 9. Under the Full Import Schedule section check the box labeled Schedule Full Import.

115

116

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

10. Click the OK button. 11. On the Import Connections page, click the link titled Create New Connection. 12. On the Add Connection page, type domain.local in the Domain Name field. 13. Click the option labeled Specify a Domain Controller. 14. Type vspdc.domain.local into the Domain Controller Name field. 15. In the Search Base field, type DC=domain,DC=local. 16. In the User Filter field, type “(&(objectCategory=Person)(objectClass=User) (memberOf= CN=Portal Profiles,CN=Users,DC=domain,DC=local) (!(userAccountControl:1.2.840.113556.1.4.803:=2)))”. 17. In the Authentication Information section, select the option labeled Specify an Account. 18. Enter DOMAIN\SPProfileImport into the Account Name field. 19. Enter the password for the account you defined earlier. 20. Click the OK button. 21. Click the Home tab in Shared Services Administration. 22. On the Shared Services Administration home page, click the link titled User Profiles and Properties. 23. On the User Profiles and Properties page, click the link titled Start Full Import. 24. After the Import is complete, click the link titled View User Profiles and verify that the appropriate profiles have been created. The properties that make up the profile can be changed at any time from the User Profiles and Properties page. On this page, you can select to add a new property or view the existing ones. Properties may be explicitly tied to an Active Directory field or they can be filled in manually. Additionally, you can specify whether the end user has the ability to edit the field and control how it appears on his or her profile page.

Personalization with My Site Along with all of the information, documents, and links you can present in MOSS, end users are also provided with a personal site known as My Site. My Site is easily accessed by clicking the associated link on the bar directly above the search box. A My Site is created for a user the first time it is accessed. Because a My Site is essentially created by the user without administrative permissions, you must enable self-service site creation in Shared Services before sites can be created. When first accessed, MOSS takes a moment to format the initial site and then prompts you to confirm the location using the message box shown in Figure 4-5.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-5. Setting the default My Site

Follow these steps to enable self-service site creation: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open the Central Administration web site by selecting Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. From the Central Administration home page, click the Application Management tab. 4. On the Application Management page, click the link titled Self-Service Site Management. 5. On the Self-Service Site Management page, make sure that the web application associated with Shared Services is selected. 6. Click the On option and then click the OK button.

Using My Site My Site consists of two pages accessed through the My Home and My Profile tabs. The My Home page is intended as a personal workplace for the individual end user. The My Profile page, on the other hand, acts like a business card that can be accessed by other portal users. In fact, this is the page shown in Figure 4-4. When My Site is first created, it shows a list of tasks with associated links to help you configure the site. One of the first things you should do is update your profile information. Clicking the link titled Describe Yourself will open the Edit Details page where you can enter information about yourself. For each field that you edit, you can also specify the visibility of the information. This allows you to determine whether information is seen by everyone or just selected groups. You will notice that the profile items on My Site are a subset of the items available in the profile database. This is because the administrator determines which properties in the profile database can be edited by the end user directly and which ones will appear in the profile view of My Site. You can click the My Profile tab to see how your profile will appear to others. On this page, there is a drop-down list that gives you a preview of the page for various groups. On the My Home page, you will notice a reference to My Calendar. My Calendar is a web part that you can connect to an Exchange server so that your calendar will be visible on My Site. To display your calendar, you must modify the properties of the web part. This will require end users to know the exact name of the Exchange server. My Home also provides a web part called the Colleague Tracker for indicating your relationship to other users. The Colleague Tracker allows you to create a virtual social network

117

118

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

that places you within the formal and informal organizational structure. You can not only associate yourself with your manager, but you can also show your relationship to colleagues with similar interests. Once you have established these relationships, you can then decide how to display them to other users. Showing these relationships can help other users locate people within the organization or find a person with expert knowledge in a certain area. Clicking the link titled Identify the People You Know will take you to the My Colleagues page. Here you can choose to add new colleagues to your list. When you add colleagues, SharePoint tries to help by suggesting additions based on information such as group membership or shared managers. My Home can also be a useful place to aggregate information from many sites. To support this type of personalized view, My Home includes a rolled-up view of both SharePoint sites and tasks. This view shows all of the documents and tasks from a site where you are a member. Figure 4-6 shows an aggregated view based on the softball site you created earlier.

Figure 4-6. Aggregating documents and tasks

Customizing My Site End users have full control over the items that appear on My Site. At any time, a user can customize My Site by clicking the link titled Add or Remove Web Parts. In this way, end users can make My Site a personalized workspace that shows them the information, documents, and links that they most care about. In addition to modifying the web parts that appear on My Site, users may also add new lists and pages directly by clicking the Create link under the Site Actions menu. Although the administrator retains control over the appearance of the public view of My Site, end users can utilize the public view to share documents, sites, and links with other users. When documents and links are added to a list, the user may specify whether to show them on the public page. For example, the portal administrator may post a document describing the procedures to personalize My Site. This way, portal users can engage in self-service rather than sending all their questions directly to the portal administrator.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Publishing Links Administrators can add pages to My Site through the Shared Services administration pages. Clicking the link titled Personalization Links allows you to add a new link that will appear as a tab on My Site. Additionally, you can target the links to an audience so the tabs only appear for certain users.

Using Excel Services Excel Services is a new technology that ships as part of Shared Services and allows you to calculate and display Excel spreadsheets using MOSS without necessarily having a copy of Excel on the client machine. With Excel Services you can use spreadsheets to create dashboards within SharePoint or simply share a spreadsheet using the browser. Additionally, Excel Services has a calculation engine that supports calculating spreadsheets on the server in order to offload resource-intensive calculations. Excel Services consists of three components: the Excel Web Access web part, Excel Calculation Services, and Excel Web Services. The Excel Web Access web part is used to display a spreadsheet as HTML within the browser. Once you properly configure Excel Services, you can drop this web part on any page and use it to render a spreadsheet. The web part is also used when a spreadsheet is viewed full-screen in the browser by a user that does not have Excel 2007 installed. Excel Calculation Services performs server-side calculation, caching, and session management for spreadsheets. In the case where you have many users accessing complicated spreadsheets, Excel Calculation Services can be load balanced for improved performance. Excel Calculation Services is designed from the ground up to support calculations on millions of rows by scaling out as necessary. Excel Web Services provide a programmatic interface to Excel Services. Using these web services, you can develop custom applications that use the calculation engine. This allows your applications to offload resource-intensive calculations to the server.

Configuring Excel Services Performing the initial configuration of Excel Services is straightforward and is accomplished from the home page of the Shared Services Administration site. Under the Excel Service Settings section, click the link titled Edit Excel Services Settings. On the Excel Services Settings page, you will find options for managing resources and security. In many cases, the out-ofthe-box settings will work fine, and you should work with Excel Services before deciding to make changes here. While the basic settings are fine to get started, there is one configuration step you must perform before you can use Excel Services: you must designate at least one trusted file location. Trusted file locations are SharePoint sites, file folders, or web sites where you want to enable Excel Services. Spreadsheets can only be processed by Excel Services if they come from a trusted location. Follow these steps to create a trusted location: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open the home page of the MOSS intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/Default.aspx).

119

120

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

3. Click the Document Center tab. 4. On the Document Center page, select Create from the Site Actions drop-down menu. 5. On the Create page, click the Document Library list. 6. On the New page, type Spreadsheets into the Name field. 7. Select Microsoft Office Excel Spreadsheet from the Document Template list. 8. Click the Create button. 9. When the Spreadsheets library opens, copy the URL of the library (e.g., http:// vsmoss/sites/intranet/Docs/Spreadsheets). 10. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 11. From the home page of the Central Administration site, click the Application Management tab. 12. On the Application Management tab, click the link titled Create or Configure This Farm’s Shared Services. 13. On the Manage This Farm’s Shared Services page, click the link to open the Shared Services Administration site. 14. On the Home page of the Shared Services Administration site, click the Trusted File Locations link. 15. On the Excel Services Trusted File Locations page, click Add Trusted File Location. 16. Paste the address of the Spreadsheets library into the Address field. 17. Click the OK button. Once the trusted file location is defined, you can create spreadsheets for use with Excel Services. While Excel Services allows you to share spreadsheets, you cannot create a spreadsheet using Excel Services. Excel 2007 must still be used for authoring spreadsheets. After you create the spreadsheet in Excel 2007, you can then make it available through the trusted library. Follow these steps to create and share a spreadsheet: 1. Log in to VSCLIENT and select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office Excel 2007. 2. Select File ➤ New by clicking the Office button in the upper left corner of Excel 2007. 3. In the New Workbook dialog, select a workbook template that has some data in it already. I used the Sales Report template from Office Online. 4. Download the template if necessary and click the Create button. 5. Once the spreadsheet is visible in Excel, select File ➤ Publish ➤ Excel Services by clicking the Office icon in the upper left corner of Excel 2007.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

6. In the Save As dialog, paste the address of the trusted Spreadsheets library you created earlier along with an appropriate name for the spreadsheet (e.g., http://vsmoss/ sites/intranet/Docs/Spreadsheets/Sales report.xlsx). 7. Click the Save button. After a spreadsheet is published to Excel Services, it will open in the browser automatically. You can also return to the document library and open the spreadsheet in either the web browser or Excel 2007 using the drop-down menu associated with the document. You’ll also notice on that same menu an option to open a snapshot in Excel 2007. A snapshot is just a copy of the data in the spreadsheet without any of the underlying formulas. If you restrict a user’s permission on the spreadsheet to just viewing the item, they will only be able to open a snapshot. Although it is fairly simple to get started with Excel Services, not all of your existing spreadsheets will work. Excel Services does not, for example, support macros. Essentially, anything that cannot be rendered in HTML will have difficulty. The following lists some of the Excel features that are not supported by Excel Services: • ActiveX controls • Add-ins • Clip art and word art • Information Rights Management (IRM) • Linked spreadsheets • Query tables, SharePoint lists, web queries, and text queries • Smart documents • Smart Tags • Visual Basic for Applications (VBA)

Using Parameters in Excel Services Along with publishing spreadsheet data, you can also enable a level of interactivity through the use of parameters. Parameters allow you to specify cells within the published spreadsheet where a user can enter values. This allows a user to make use of the formulas in a spreadsheet without exposing it. This can be important when the formula is proprietary or you simply want to make a calculation available through the browser. Follow these steps to create a spreadsheet that has parameters: 1. Log in to VSCLIENT and select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office Excel 2007. 2. Enter Fahrenheit in cell A1. 3. Enter Celsius in cell B1. 4. In cell B2 enter the formula =(100/180)*(A2-32).

121

122

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

5. Right-click cell A2 and select Name a Range from the context menu. 6. In the New Name dialog, accept the name Fahrenheit by clicking the OK button. 7. Select File ➤ Publish ➤ Excel Services by clicking the Office icon in the upper left corner of Excel 2007. 8. In the Save As dialog, click the Excel Services Options button. 9. In the Show tab, select Sheets from the drop-down list. 10. Check the box next to Sheet1. 11. On the Parameters tab, click the Add button. 12. In the Add Parameters dialog, check the box next to the Fahrenheit parameter. 13. Click the OK button. 14. In the Excel Services Options dialog, click the OK button. 15. In the Save As dialog, paste the address of the trusted Spreadsheets library you created earlier along with an appropriate name for the spreadsheet (e.g., http://vsmoss/ sites/intranet/Docs/Spreadsheets/Temperature Calculator.xlsx). 16. Click the Save button. After you save the sheet, it will open in the browser. You should now be able to enter a new value for the Fahrenheit parameter and see the resulting Celsius calculation. Figure 4-7 shows a picture of the spreadsheet.

Figure 4-7. Using parameters with Excel Services

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Using Data Connections Excel spreadsheets are often used to view and manipulate data from external systems. This data can be imported into a spreadsheet through the use of a data connection. Data connections are not new to Excel 2007, but SharePoint now provides a better way to manage them in the form of a data connection library so that they are available across the enterprise. A data connection library is similar to any library you create in SharePoint, but it is intended to hold Office Data Connection (ODC) files that define connections to external data sources. These ODC files are created in Excel and can then be reused in different spreadsheets or even in InfoPath forms, which I discuss in Chapter 6. You can create and manage data connections by clicking the Data tab in Excel. To create a new data connection, click From Other Sources to start the data connection wizard. The wizard will walk you through the process of defining a connection, which you can then save as an ODC file to the data connection library. Follow these steps to create a data connection: 1. Log in to VSCLIENT and open the home page of the intranet site you created in Chapter 2 (e.g., http://vsmoss/sites/intranet/Pages/Default.aspx). 2. Click the Document Center tab. 3. On the Document Center page, select Create from the Site Actions drop-down menu. 4. On the Create page, click the Data Connection Library link. 5. On the New page, type Data Connections in the Name field. 6. Select None from the Document Template list. 7. Click the Create button. 8. In the File Explorer, navigate to My Documents\My Data Sources. 9. Double-click the file named +NewSQLServerConenction.odc. This will start Excel 2007. 10. If you receive a warning that data connections are blocked, click the Enable button. 11. When the data connection wizard starts, enter VSSQL\OFFICESERVERS in the Server Name field. 12. Click the Next button. 13. On the Select Database and Table screen, select WSS_Content from the drop-down list. 14. Select the Webs table from the list and click the Next button. 15. Name the new data source SharePointContent.odc and click the Finish button. 16. Return to the data connections library. 17. Click the Upload button on the toolbar. 18. On the Upload page, click the Browse button. 19. In the Choose File dialog, navigate to My Document/My Data Sources, select the SharePoint Content.odc file, and click the Open button.

123

124

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

20. On the Upload page, click the OK button. 21. On the Data Connections page, click the Check In button. 22. Select Approve/Reject from the drop-down list associated with the new data connection file. 23. On the Approve page, select Approved and click the OK button. You can now close the Excel spreadsheet. You do not need to save it because you just used it to create the new data connection.

Using Excel Web Services Once you have created and published a spreadsheet to Excel Services, you may access the cells and formulas through Excel Web Services. Excel Web Services is accessed through the server where the Shared Services reside. You can make use of the services in the development environment by setting a reference to them in Visual Studio at the following address: http:// vsmoss/_vti_bin/excelservice.asmx. Once you have a reference to Excel Web Services, you can call the OpenWorkbook method to access any spreadsheet published to Excel Services. This method takes the path to the workbook as an argument and returns a session identifier that you can use to perform operations on the workbook. The GetCell and SetCell methods allow you to read and write to the spreadsheet while the Calculate method calculates all the formulas in the workbook. Exercise 4.1 at the end of this chapter contains a complete exercise utilizing Excel Web Services.

Creating User-Defined Functions Along with using Excel Services in your own applications, you can conversely provide assemblies that Excel Services can use. These custom assemblies are known as user-defined functions (UDF) and are called from an Excel spreadsheet in much the same way as a built-in function. The only difference is that UDFs are only available to workbooks that are published through Excel Services. Using UDFs, you can create custom functions that perform calculations and even access other data stores. The results are then returned to the spreadsheet for display in a cell. UDFs are created as .NET assemblies that are decorated with special attributes. These attributes are found in the library Microsoft.Excel.Server.Udf. You can access this library from Visual Studio by setting a reference to the assembly C:\Program Files\Common Files\ Microsoft Shared\ web server extensions\12\ISAPI\Microsoft.Excel.Server.Udf.dll. Once you have the reference set, you can add a directive for the library using the following code: Using Microsoft.Office.excel.Server.Udf; When you create a UDF, you typically define a function that accepts arguments and returns a value for display in a cell. This is elementary programming with the exception that you must decorate the class with the UdfClass attribute and the method with the UdfMethod attribute. Listing 4-2 shows a simple class definition with a function for rolling a six-sided die.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Listing 4-2. A User-Defined Function using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Excel.Server.Udf; namespace UDFDice { [UdfClass] public class Dice { [UdfMethod] public Int32 Roll() { Random r = new Random(); return (Int32)((r.NextDouble() * 5) + 1); } } } Once you compile the assembly, you can save it to a file location or give it a strong name and place it in the Global Assembly Cache (GAC). Then you must make an entry in the userdefined functions list on the Shared Services Administration site that points to the new assembly. This is done by opening the list of user-defined assemblies using the link under the Excel Services Settings section. Once the new assembly is referenced in the list, you must specifically allow the use of user-defined functions from the trusted location page that you worked with earlier. When these configuration steps are complete, you can call the function from a spreadsheet cell. Just remember that the function will not work until you publish the spreadsheet to Excel Services.

Integrating the Business Data Catalog The BDC is one of the Shared Services that allows you to integrate back-end line-of-business systems with SharePoint. Using the BDC, you can pull data from other databases or services and have that information appear in lists, web parts, search results, user profiles, and your own custom applications. Significantly, this integration requires no formal coding; instead, you describe the data source using an XML metadata file, and then the BDC performs all of the operations necessary to use the data in SharePoint. Figure 4-8 shows a conceptual drawing of the BDC architecture.

125

126

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-8. The BDC architecture The heart of the BDC is the metadata database. The metadata database contains the XML used to describe the interface to a target data source. Creating this XML is the primary development task necessary to enable the BDC. Once created, the XML is uploaded using the Shared Services Administration site and is stored in the metadata database where it is available to every site in the SharePoint farm. In order to provide a standard interface to the metadata, the BDC abstracts the metadata through a set of objects. These objects are part of the MOSS assembly Microsoft. SharePoint.Portal.dll and are contained in the libraries Microsoft.Office.Server. ApplicationRegistry.MetadataModel and Microsoft.Office.Server.ApplicationRegistry. Runtime. These libraries are the primary interface used by MOSS to access the target data and execute the commands defined by the metadata. Having this layer of abstraction is what permits integration of back-end systems without using any code, because the object libraries simply use ADO.NET or web services to perform all operations defined by the metadata. The BDC infrastructure uses a data cache to hold metadata to minimize trips to the metadata database. This architecture improves BDC performance by making metadata available to SharePoint from the cache. Once per minute, the BDC infrastructure will check to see if any changes have occurred to the metadata and reload any objects that have changed.

Understanding Metadata Although the BDC is advertised as a “no-code” solution, creating the required XML metadata by hand may leave you longing to write code instead. As of this writing, there are several publicly available tools under development that purport to create BDC metadata, but most of these tools are still buggy and lack the features necessary to create a wide variety of BDC solutions. Therefore, I will show you how to create a metadata file for the BDC from scratch. Listing 4-3 shows a complete file that I will use throughout this discussion. The file is used to integrate the BDC with a simple SQL Server 2005 database containing a single table. The database is named CRM and contains a table called Names. The Names table is made up of a primary key integer and several text fields with information such as first name, last name,

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

and address. This example should give you all the fundamental knowledge you need to get started with the BDC.

■Note When creating metadata, open a new XML file in Visual Studio and set the SchemaLocation property to C:\Program Files\Microsoft Office Servers\12.0\Bin\BDCMetaData.xsd. This will activate IntelliSense for the metadata schema and make it easier to create the file.

Listing 4-3. A Complete BDC Metadata File

%



PassThrough SqlServer VSSQL CRM

127

128

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

SSPI -1







LastName Text

SELECT * FROM Names WHERE Lastname LIKE @LastName









CHAPTER 4 ■ SHAREPOINT SHARED SERVICES















129

130

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES





ID Text

SELECT * FROM Names WHERE ID=@ID











CHAPTER 4 ■ SHAREPOINT SHARED SERVICES















131

132

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES





Authoring the LobSystem Element The LobSystem element describes the external data source you want to access with the BDC. It is the outermost element in the file. Most of the attributes associated with this element are boilerplate, but the Name and Version attributes should be set by you to give the system a unique name and track the metadata version you are using. Listing 4-4 shows the LobSystem attribute with the extraneous parts removed and the key attributes bolded. Listing 4-4. The LobSystem Element

SELECT * FROM Names WHERE Lastname LIKE @LastName





ID

SELECT * FROM Names WHERE ID=@ID

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES



The Name attribute of the Method element should be unique and representative of the query to run. In my example, the first method named FindCustomers is used to return a set of customers based on a wildcard search. The second method returns a specific customer based on a primary key. The Title property is used to specify the field that should be used by default to represent the entity in some BDC displays. The RdbCommandText property is used to define the query to run. Notice the difference between the SQL statements in each method and how they return either a set of records or a specific record. This functionality is further defined by the FilterDescriptor element, which is set to either Wildcard or Comparison and then given a name so it can be referenced later by query parameters.

Authoring Parameters Parameter elements are used to define the values that are sent into the query and the fields that are returned. Both of the methods I define in the metadata have input and output parameters. The input parameter is either a partial last name to use in a wildcard search or an integer value used to return an exact customer based on the primary key. The return values, on the other hand, are identical for both methods because I always want the same fields returned. Listing 4-9 shows the two input parameters and the common output parameters for the methods. Listing 4-9. Using Parameter Elements









135

136

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Notice that each of the input parameters in the listing references the name of the FilterDescriptor defined earlier. This reference is how the BDC knows whether to apply the wildcard to the parameter before executing the query. Also notice that when the primary key field is used, it references the identifier created earlier. This tells the BDC that the parameter is a unique identifier. The return parameters are simply the data fields that will be returned from the query.

Uploading the Application Definition Once the metadata is complete, it may be uploaded to the BDC as a new application definition. Application definitions are uploaded from the Shared Services Administration site by clicking the Add Application link under the Business Data Catalog section. When the metadata is uploaded, the BDC will check it for errors and notify you if the XML is not correct. Once the application is uploaded, you may choose to view the definition where you should see any entities you have defined. Figure 4-9 shows the example application in Shared Services.

■Tip The example used here is targeted at SQL 2005 databases. If you wish to connect to web services or other types of databases, you should reference the examples in the MOSS SDK. For the most part, it is only a matter of using different elements in the application definition.

After viewing the application, you should click each entity you have defined. Clicking the entity will bring you to a page that shows the field names that will be returned, the filters you have available, and any defined actions. Field names will be used to create lists and views in SharePoint. Filters represent available wildcard search methods you defined. Actions are used to connect an item from a list to a detail view. Figure 4-10 shows the example Customer entity in Shared Services.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-9. Viewing an application definition

Figure 4-10. Viewing an entity

137

138

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

For each entity you define, you should configure the available actions. By default, the BDC defines an action called View Profile. Clicking this action will allow you to define what happens when it is invoked by an end user. On the Edit Action page, you can assign a parameter to use when displaying details about the entity. This is always the unique identifier you define in the metadata. In this example, I set the parameter to the ID field of the customer. Figure 4-11 shows the parameter setting in Shared Services.

Figure 4-11. Setting the action parameter

Using BDC Information Once the metadata is uploaded and configured, you are ready to use it in MOSS. MOSS ships with several web parts that know how to integrate with BDC information. The two basic parts are the Business Data List and the Business Data Item. The Business Data List web part displays the results of wildcard searches in a list form while the BDC Data Item web part displays an individual record based on the primary key. The BDC list also allows you to invoke the actions you define in the BDC so you can display a list of records and then click on one to display the details. These web parts bring to fruition the promise of integrating line-of-business systems with SharePoint. Figure 4-12 shows an example of these web parts displaying customer data.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Figure 4-12. Displaying BDC data with web parts

Follow these steps to use the Business Data List web part: 1. Open the home page of the MOSS intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/Default.aspx). 2. Select Edit Page from the Site Actions menu. 3. When the page enters edit mode, click the Add a Web Part link for any zone. 4. In the Add Web Parts dialog, check the box for the Business Data List and click the Add button. 5. When the Business Data List is added to the page, click the link titled Open the Tool Pane. 6. Click the Browser button next to the Type field at the top of the Tool Pane. 7. In the Business Data Type Picker dialog, select the ContactInfo entry and click the OK button. 8. Click the OK button in the tool pane. 9. In the Business Data List web part, click the Edit View link. 10. Select the fields you want to display and select the Title option for the field that represents the primary key for the data. This will allow you to create a detail action for the items in the list. 11. Click the OK button.

139

140

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

In addition to displaying BDC information in web parts, you can also search BDC information. In order to make the BDC information available, you must start by creating a new method in the metadata that the Search Service can use during a crawl. This method returns all of the primary keys, which are then used to return each entity one at a time. The returned entities become part of the index. Listing 4-10 shows an example of the new method, which is similar to the other methods I show in Listing 4-8. I have removed parts to make it easier to read. Listing 4-10. A Method to Support Indexing BDC Data

SELECT ID FROM Names Text





ID







Once the metadata is updated, you can proceed to create a new search content source and scope based on the metadata as I described in the section “Configuring Search.” Additionally, you must be sure to give the account that will crawl the BDC permission to access the data source. This can be done through the BDC Permissions link in Shared Services. If you have trouble with this, or any part of BDC configuration, be sure to look at the event log. The files often have good descriptions of BDC errors.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Exercise 4.1. Custom Solutions with Excel Services Excel Services allows you to publish spreadsheets that can be viewed in a browser. Once the spreadsheet is published, however, you can also access it programmatically through web services. In this exercise, you will create a mileage calculator spreadsheet to determine the reimbursement for mileage traveled in a personal car. After creating the sheet, you will make a Windows application that uses Excel Services to calculate the reimbursement on the server and return the value to the application.

Trusting a Document Library Before you can publish a spreadsheet to Excel Services, you must define trusted locations for documents. Trusted locations can come from SharePoint sites, other web sites, or file folders. In this exercise, you will create a document library to contain all of the published calculators for the company. Follow these steps to create the trusted library: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open the home page of the MOSS intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/Default.aspx). 3. Click the Document Center tab. 4. On the Document Center page, select Create from the Site Actions drop-down menu. 5. On the Create page, click the Document Library list. 6. On the New page, type Expense Calculators into the Name field. 7. Select Microsoft Office Excel Spreadsheet from the Document Template list. 8. Click the Create button. 9. When the Expense Calculators library opens, copy the URL of the library (e.g., http:// vsmoss/sites/intranet/Docs/Expense%20Calculators). 10. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 11. From the home page of the Central Administration site, click the Application Management tab. 12. On the Application Management tab, click the link titled Create or Configure This Farm’s Shared Services. 13. On the Manage This Farm’s Shared Services page, click the link to open the Shared Services Administration site. 14. On the home page of the Shared Services Administration site, click the Trusted File Locations link. 15. On the Excel Services Trusted File Locations page, click Add Trusted File Location.

141

142

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

16. Paste the address of the Expense Calculators library into the Address field. 17. Click the OK button.

Creating the Mileage Calculator Spreadsheet Once the trusted library is defined, you can create spreadsheets and publish them to Excel Services. In this section you will create a simple spreadsheet that allows you to define a reimbursement rate for each mile and a place to enter miles traveled. When you publish the spreadsheet, you will define a parameter so that the spreadsheet can be used directly from the browser to calculate reimbursements if desired. Follow these steps to create and publish the spreadsheet: 1. Start Excel 2007. 2. Enter Mileage in cell A1. 3. Enter Rate in cell B1. 4. Enter Reimbursement in cell C1. 5. Enter 0 in cell A2. 6. Enter .445 in cell B2. 7. In cell C2 enter the formula =(A2*B2). 8. Right-click cell A2 and select Name a Range from the context menu. 9. In the New Name dialog, accept the name Mileage by clicking the OK button. 10. Select File ➤ Publish ➤ Excel Services by clicking the Office icon in the upper left corner of Excel 2007. 11. In the Save As dialog, click the Excel Services Options button. 12. In the Show tab, select Sheets from the drop-down list. 13. Check the box next to Sheet1. 14. On the Parameters tab, click the Add button. 15. In the Add Parameters dialog, check the box next to the Mileage parameter. 16. Click the OK button. 17. In the Excel Services Options dialog, click the OK button. 18. In the Save As dialog, paste the address of the trusted Spreadsheets library you created earlier along with an appropriate name for the spreadsheet (e.g., http://vsmoss/ sites/intranet/Docs/Expense%20Calculators /Mileage Calculator.xlsx). 19. Click the Save button.

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Creating the New Project In this section, you will create a simple application that works with Excel Services. Although the published spreadsheet may be used directly, you can also call it from a web service and take advantage of the server-side calculation engine of Excel Services. This allows you to utilize complex or proprietary calculations in applications. For this example, you will create a Windows application. The application will allow you to enter a value for mileage traveled and it will return the current reimbursement rate and the value of the reimbursement. Because the calculation is all done on the server, the reimbursement rate may be changed at any time and the application does not have to be modified. Follow these steps to create the application: 1. Start Visual Studio 2005. 2. In Visual Studio 2005, select File ➤ New ➤ Project from the main menu. 3. In the New Project dialog, click the Visual C# node in the Project Types list. 4. In the Templates list, select Windows Application. 5. Type MileageCalculator in the Name field. 6. Click the OK button. 7. When the new project is created, drop a NumericUpDown control, two Label controls, and a Button control onto Form1. 8. Name the new controls mileage, rate, reimbursement, and submit, respectively. 9. Change the Text property of the button to Calculate. Your form should now appear as shown in Figure 4-13.

Figure 4-13. The Windows form user interface

Coding the Application Calling a spreadsheet in Excel Services is done through a web services interface that allows you to read and write cells as well as calculate all the formulas in the sheet. After setting a reference to the web service, you will have access to several properties and methods for working with the spreadsheet. In this exercise, all of the code will be run when a button is clicked.

143

144

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

Follow these steps to code the application: 1. In Visual Studio 2005, select Project ➤ Add Web Reference. 2. In the Add Web Reference dialog, type http://vsmoss/_vti_bin/excelservice.asmx in the URL field. 3. Click the Go button. 4. After the web service is successfully located, type ExcelWebServices in the Web Reference Name field. 5. Click the Add Reference button. 6. Select Form1 in the Solution Explorer and then click the View Code button. 7. Add the following statements to reference the required namespaces: using MileageCalculator.ExcelWebServices; using System.Web.Services.Protocols; 8. Add the code from Listing 4-11 to pass the mileage to the spreadsheet, calculate the reimbursement, and return the value. Listing 4-11. Reimbursement Calculator private void submit_Click(object sender, EventArgs e) { ExcelService calcSheet = new ExcelService(); Status[] outStatus; RangeCoordinates rangeCoordinates = new RangeCoordinates(); string sheetName = "Sheet1"; string targetWorkbookPath = "http://win2k3template/Docs/Expense%20Calculators/Mileage%20Calculator.xlsx"; calcSheet.Credentials = System.Net.CredentialCache.DefaultCredentials; try { string id = calcSheet.OpenWorkbook( targetWorkbookPath, "en-US", "en-US", out outStatus); object rateCell = calcSheet.GetCell( id, sheetName, 1, 1, true, out outStatus); calcSheet.SetCell(id, sheetName, 1, 0, mileage.Value); calcSheet.Calculate(id, sheetName, rangeCoordinates); object reimbursementCell = calcSheet.GetCell( id, sheetName, 1, 2, true, out outStatus);

CHAPTER 4 ■ SHAREPOINT SHARED SERVICES

rate.Text = rateCell.ToString(); reimbursement.Text = reimbursementCell.ToString(); calcSheet.CloseWorkbook(id); } catch (Exception x) { MessageBox.Show(x.Message); } } Once you have the application coded, you should be able to run it directly from Visual Studio. When the form appears, enter a value for the mileage traveled and click the button. The application should return the current reimbursement rate and the total reimbursement for the travel.

145

CHAPTER

5

SharePoint Content Development and Management A

lthough the default installation of WSS and MOSS are acceptable for general-purpose usage, you will undoubtedly want to customize the appearance and behavior of sites to match your organization’s branding and expectations. SharePoint supports customizing sites in several different ways. You can make many changes to the look and feel of a site directly through the site administration pages, or using the SharePoint Designer for more extensive control. Additionally, MOSS supports a publishing feature that enables professional content management capabilities for managing page creation, approval, and deployment. In this chapter, I cover all of the various ways to change the appearance, behavior, and content of sites.

Understanding Site Collection Templates Developing content in SharePoint begins by creating a site collection geared toward your needs. As you saw in Chapter 2, when you create a site collection, you must choose a template upon which to base the new site collection. The templates that appear on the Create Site Collection page are different depending on whether you are using MOSS or WSS. Generally, you’ll find that WSS ships with collaboration templates designed to support teams. MOSS, on the other hand, ships with templates for use in a wide variety of applications within an organization. The MOSS templates include not only team collaboration templates, but also enterprise templates for creating document management systems, records management systems, and Internet sites. Table 5-1 lists all of the available templates in both WSS and MOSS. Table 5-1. Site Collection Templates

Name

Category

MOSS/WSS

Description

Blank Site

Collaboration

MOSS/WSS

A blank site with a single page

Blog

Collaboration

MOSS/WSS

A site for creating a web log that allows posts and comments

Document Workspace

Collaboration

MOSS/WSS

A site for creating a document with input from multiple people

Team Site

Collaboration

MOSS/WSS

A general collaboration site for multiple people to work on a project Continued 147

148

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Table 5-1. Continued

Name

Category

MOSS/WSS

Description

Wiki Site

Collaboration

MOSS/WSS

A site that allows users to share knowledge by editing web pages directly

Basic Meeting Workspace

Meetings

MOSS/WSS

A site with the fundamental tools required to plan, organize, and execute a meeting

Blank Meeting Workspace

Meetings

MOSS/WSS

A blank meeting site that can be customized

Decision Meeting Workspace

Meetings

MOSS/WSS

A site for supporting and tracking decisions made during a meeting

Multipage Meeting Workspace

Meetings

MOSS/WSS

A site with multiple pages for organizing more complex meetings

Social Meeting Workspace

Meetings

MOSS/WSS

A site to support the planning and execution of social events

Document Center

Enterprise

MOSS only

A site that functions like a centralized document management system

Records Center

Enterprise

MOSS only

A site that can be used as a records management repository

Report Center

Enterprise

MOSS only

A site for creating and delivering dashboards, scorecards, and reports

Search Center

Enterprise

MOSS only

A site for creating an enterprise search capability

Search Center with Tabs

Enterprise

MOSS only

A site for creating an enterprise search capability that can be customized to add new sources

Site Directory

Enterprise

MOSS only

A site that can be used to list and categorize key sites

My Site Host

Enterprise

MOSS only

A template for hosting all of the personal sites in an organization

Collaboration Portal

Publishing

MOSS only

A site for creating a corporate intranet

Publishing Portal

Publishing

MOSS only

A template for creating an Internet site or a corporate portal with complete content management facilities

In this chapter, I cover content development for both WSS and MOSS sites. Therefore, you’ll need to create a new web application where you can work on content. Later, you’ll create a more complex Internet site, but for now you’ll start with a plain blank site. Follow these steps to create a blank site: 1. Log in to VSMOSS or VSWSS as a SharePoint administrator. 2. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. On the Application Management tab, under the SharePoint Web Application Management section, click the link titled Create or Extend a Web Application. 4. On the Create or Extend a Web Application page, click the link titled Create a New Web Application.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

5. On the Create a New Web Application page, select the option to Create a New IIS Web Site. 6. In the Description field, type Content. 7. In the Application Pool section, select Create a New Application Pool. 8. Enter Content_Pool as the pool name. 9. Select the Configurable option for the application pool security account. 10. In the User Name field, enter DOMAIN\SPContentPool. 11. In the Password field, enter the account password. 12. In the Reset Internet Information Services section, select the option to Restart IIS Automatically. 13. Click the OK button. 14. On the Application Created page, click the link titled Create Site Collection. 15. On the Create Site Collection page, enter Blank Site in the Title field. 16. Under the Primary Site Collection Administrator section, enter DOMAIN\Administrator in the User Name field. 17. Under the Template Selection section, click the Collaboration tab, and then select the Blank Site. 18. Click the OK button to create the new site collection. When the site collection is created, open it in a separate copy of the browser.

Adding and Editing Pages After you create a new site in WSS or MOSS, you will undoubtedly want to start adding pages and content to the site. While some of the MOSS templates have sophisticated publishing tools that I cover in the section titled “Using the Publishing Feature,” the basic templates, such as Team Site and Blank Site, use the Create page to add new pages. You can reach the Create page by selecting Create from the Site Actions menu. On the Create page, you have links that allow you to create either a Basic Page or a Web Part Page. A Basic Page is a page that contains text and graphics, while a Web Part Page contains special placeholders, called web part zones, where you can add web parts. Regardless of which type of page you create, SharePoint will ask you to select a document library where the page will be stored. In most cases, you will not have a suitable document library available, so I recommend that you create two of them before adding new pages. Follow these steps to create libraries: 1. From the home page of the blank site you created earlier, select Create from the Site Actions menu. 2. On the Create page, click the Document Library link.

149

150

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

3. On the New page, enter Basic Pages in the Name field. 4. Under the option Display This Document Library on the Quick Launch Bar, select No. 5. Select Basic Page from the Document Template list. 6. Click the Create button. 7. When the new library is complete, select Create from the Site Actions menu. 8. On the Create page, click the Document Library link. 9. On the New page, enter Web Part Pages in the Name field. 10. Under the option Display This Document Library on the Quick Launch Bar, select No. 11. Select Web Part Page from the Document Template list. 12. Click the Create button. Once the new document libraries are created, you can choose to add new pages to your site by either using the Create page or by going directly to the document library and selecting New. Adding content to the Basic Page is done through a rich-text editing interface that allows you to add text, images, and tables to the page. This is a pretty simple interface that can be used by any nontechnical content owner to quickly create or edit a page. Figure 5-1 shows the editor with shameless content from my web site.

Figure 5-1. Editing a Basic Page

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Using Web Parts When you create a Web Part Page, you can select from various layouts with zones for web parts. Adding content to the Web Part Page is done by clicking the Add a Web Part link that appears at the top of each zone. When you click this link, SharePoint displays a dialog that allows you to select one or more web parts for the zone. Adding multiple web parts to a zone simply stacks them vertically within the zone. You can also drag the web parts between zones once they’re on the page. Figure 5-2 shows the Add Web Parts dialog.

Figure 5-2. Adding web parts

If you click the link at the bottom of the Add Web Parts dialog, you will open the Web Parts Gallery pane, which allows access to all available web parts on the farm. There are three different galleries, which are essentially catalogs of web parts from which you can choose. The available galleries are Closed Web Parts, [site name] Gallery, and Server Gallery. The Closed Web Parts Gallery contains all of the web parts that are available specifically to the web page that is being modified. Closed web parts still execute as part of the page, but

151

152

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

their output is not rendered. If you close a web part, the web part disappears from the page and becomes available in the Closed Web Parts Gallery. Once it is in the gallery, it may be moved back to the page by dragging it from the gallery and onto the page. The [site name] Gallery is named after the site where the current page is located. If your site is named Board of Directors, the [site name] Gallery will be named Board of Directors Gallery. This gallery contains the bulk of the general-purpose web parts that may be used throughout the current site. In Chapter 10, you will add your own custom web parts to this gallery. The Server Gallery is a gallery intended for enterprise deployments of SharePoint. In these cases, the Server Gallery acts as an enterprise-level repository for web parts. Using this gallery entails a special deployment model for web parts called a web-part solution file that I also cover in Chapter 10. Regardless of where you get the web part, placing it on the page is always accomplished in the same manner. To move a web part onto the page, you click and drag the web part from the selected gallery into an available zone. Figure 5-3 shows the available galleries in SharePoint.

Figure 5-3. Web part galleries

If you created the blank site described in this chapter, you will currently see only ten web parts in the [site name] Gallery. This is because the Blank Site template only enables some of the basic web parts. Don’t be fooled by this short list; there are many web parts available to you in SharePoint, and this book will cover several of them in the chapters where they are most useful. Table 5-2 lists the web parts found in the Blank Site template and explains their functions.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Table 5-2. Blank Template Web Parts

Web Part

Description

Basic Pages and Web Part Pages

These are the document libraries for holding web pages. All document libraries that you create will appear in the [site name] Gallery.

Content Editor

This web part allows you to add rich text, HTML, or script to a site.

Form

This web part is used to create an HTML form that can use script to communicate with other web parts.

Image

This web part is used to place images on a page.

Page Viewer

This web part provides an IFRAME viewer to other web content.

Relevant Documents

This web part is used to display documents from the site that are important to the current user.

Site Users

This web part displays a list of the site members and their status.

User Tasks

This web part shows all of the tasks assigned to the current user.

XML

This web part is used to add XML data and transform it with XSL.

Connecting Web Parts Although web parts are useful for displaying information, links, and lists, so far we have only seen them acting as islands of information. The content presented by multiple web parts on a page may be related, but the web parts are unaware of the related information. With connected web parts, however, you can relate multiple web parts. Connecting web parts is done when a Web Part Page is in edit mode. You enter edit mode by selecting Edit Page from the Site Actions menu. Once in edit mode, you may use the dropdown menu associated with the web part. If the web part supports connecting with another web part on the page, you will see a Connections menu item. You may then select the web part with which to connect. When a connection is established, SharePoint will prompt you to select the data column on which to base the connection. This is like performing a crude outer join in a SQL statement; the web parts must share a common piece of data that allows a connection. As an example, I created a connection between two Contacts List web parts. The first list shows a view of available technology experts and their area of expertise. This web part is then connected to a second list that shows the contact information for the selected expert. I cover how to create your own connectable web parts in Chapter 10. Figure 5-4 shows the resulting master-detail relationship between the web parts.

153

154

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Figure 5-4. Connecting web parts

Modifying the Site Look and Feel Once you add some pages and content to a new site, you will want to change the appearance and navigation of the site. Although I discuss several ways to alter the look and feel of a site throughout this chapter, the easiest way to get started is with the built-in options found inside SharePoint itself. You can change many navigation and appearance elements within a site simply by making configuration choices in the site administration pages. You can also change colors and styles with built-in options or by modifying some existing files.

Customizing Site Navigation By default, both WSS and MOSS have a simple navigation system that uses tabs across the top to access sites along with a Quick Launch area on the left-hand side to access content elements within a site. Using the built-in configuration settings of WSS and MOSS, you can make some changes to the way this information is presented in the site collection. Although these changes are not radical, they can be helpful in many applications. During the site creation process, you can specify whether a subsite in the collection should appear as a tab in the parent site. You can also choose whether the tabs appear as navigation elements on the child site. After the subsite is created, you can subsequently click the Top Link Bar hyperlink under the Look and Feel section of the Site Settings to modify the tabs. You can use the Tree View link under the Look and Feel section of the Site Settings to enable a tree view navigation system as well as hide the Quick Launch navigation area. Additionally, you can click the Quick Launch link under the Look and Feel section of the Site Settings to change what information appears in the Quick Launch area and how it is ordered. Again, none of these changes are extreme, but they are simple to implement. Clicking the link titled Title, Description, and Icon will allow you to change these elements for a site. When using a new logo, you will typically create a new image library to store the logo and then reference that image when making the change. This is a simple way to provide some consistent branding to your sites.

Using Themes and Styles You can achieve some additional customization by selecting a new theme for the site collection. This is done by clicking the Site Theme link in the Look and Feel section. SharePoint

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

offers several themes that you can select with various color palettes. Ideally, you would want to be able to select a theme that closely matches your organization’s color scheme. Although, a complete match is unlikely, you can usually find something passable for internal sites. Later in this chapter, I discuss how you can create your own themes. If you don’t use one of the available themes to customize your site, SharePoint still makes use of some thematic elements simply to create the default look. In particular, SharePoint makes use of style sheets to control the layouts, fonts, and colors you see in a site. The main style sheet, CORE.CSS, controls the appearance of many elements in a site. Therefore, customizing CORE.CSS will have an immediate and global impact on the look and feel of all sites in the farm. Customizing CORE.CSS can be challenging, however, because there are a huge number of classes defined in this style sheet and no good reference to help you determine what elements to modify. Over the last couple of years, some tools have emerged to help developers identify the classes associated with elements in a web page, but the best one is the Internet Explorer Developer toolbar, which you can download from Microsoft. This tool loads into Internet Explorer and exposes a tremendous amount of information about the page being rendered in the browser. You can use this tool to identify the style classes associated with an element and modify that element in the style sheet. Keep in mind that modifying CORE.CSS will make changes to every site in your farm. So be certain that you intend to make global changes before proceeding. A better approach, however, is to leave the CORE.CSS file alone and override styles instead. SharePoint provides a mechanism for specifying alternate style sheets that will override the core styles. I discuss alternate style sheets in the section titled “Using an Alternate Style Sheet” later in the chapter. In cases where these changes do not provide enough control, you may want to make your own theme. You can do this from scratch or by customizing an existing theme. Then you can save the theme and make it available to all sites. SharePoint keeps all of the predefined themes in the folder \Program Files\Common Files\Microsoft Shared\web server extensions\12\ TEMPLATE\THEMES. Once created, the new theme is made available to SharePoint sites by making a new entry in the SPTHEME.XML file located in \Program Files\Common Files\ Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033.

Customizing with the SharePoint Designer Although Basic Pages and Web Part Pages offer you a quick way to get content into your site, you will likely find them too limiting. In my experience, organizations want much more control over the look and feel of the site. This is where the SharePoint Designer comes into play. The SharePoint Designer gives you a complete editing environment where you can significantly customize your pages. You can open a SharePoint site directly in the SharePoint Designer by selecting File ➤ Open Site. In the Open Site dialog, you simply provide the URL to the site and click the Open button. When you open the site, the SharePoint Designer displays a folder list view that shows all of the sites, libraries, and lists defined in the site. If you have previously created the Basic Pages and Web Part Pages libraries, you will see them in the folder list along with any pages you have already created. From the folder list, you can right-click a file and select Open from the context menu. When the page opens, you will see that many of the elements are exposed for editing. You’ll see, for example, that you could easily type directly into a Basic Page to edit its content.

155

156

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

However, not everything you see is available for editing. What you are allowed to edit is a combination of SharePoint Designer settings and SharePoint page structure that I will unravel throughout this chapter.

Understanding Contributor Mode As soon as you start to edit content in the SharePoint Designer, you’ll have to deal with Contributor Mode. Contributor Mode is a limited-function mode that allows administrators to control which editing commands are available based on the author’s membership in a Contributor Group. Contributor Mode is enabled by default for SharePoint sites and only administrators can change the settings. Contributor Mode is closely linked with SharePoint permission levels. For the SharePoint Permission levels Full Control, Design, and Contribute, the SharePoint Designer defines the groups Site Manager, Web Designers, and Content Authors, respectively. When you first open a site in the SharePoint Designer, your ability to edit pages will likely be restricted by the Contributor Settings for your group. If you select Task Panes ➤ Contributor from the main menu, you’ll be able to see your group membership, as shown in Figure 5-5.

Figure 5-5. Contributor Settings pane

If you are a site administrator for the site that is opened in the SharePoint Designer, you can make changes to the Contributor Settings. This is accomplished by selecting Site ➤ Contributor Settings, which opens the Contributor Settings dialog. You can also enable or disable Contributor Mode for the entire site from this dialog.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

If you disable Contributor Mode, anyone who is able to open a site in the SharePoint Designer will have the ability to make changes to any part of a page. This may be fine if you have a limited number of people making site customizations. Contributor Mode is really designed for teams of people who are all responsible for providing various content elements. In this situation, you may not want someone to have full access to the editing functions because they could accidentally change content that they should otherwise not have access to. If you choose to use Contributor Mode, you do not necessarily have to do anything in the SharePoint Designer. Because Contributor groups are linked with SharePoint permission levels, you would simply add new users to the SharePoint site and assign them an appropriate permission level. This level would dictate their editing capabilities in the SharePoint Designer as I indicated previously. If, however, someone opens a site and he does not have any permission levels that map to a Contributor Group, he is automatically given the restrictions associated with the Content Authors group. This is because the Content Authors group has the least functionality in the SharePoint Designer. This often results in the interesting situation in which you could be a SharePoint farm administrator with little ability to edit a site because you were never specifically assigned a permission level. As you’ll see in the section “Using the Publishing Feature,” much of the content that appears in a SharePoint page is contained in a content placeholder. Placeholders define text, image, and layout areas where content can reside on a page. When Contributor Mode is enabled, authors are restricted to editing the content in these placeholders only. This is how you can keep them from accidentally changing the underlying structure of a site. While it’s tempting to simply turn Contributor Mode off, it will save you a lot of headaches when others are editing content. I’ve seen many pages destroyed by business users who were editing content in the previous version of SharePoint using Microsoft FrontPage with no restrictions.

Adding a New Page When a site is open in the SharePoint Designer, you can add different elements including HTML, Active Server Pages, style sheets, lists, libraries, XML files, and many others. You can also customize existing elements that you made from the Create page in SharePoint. As a best practice, I generally prefer to add elements from within SharePoint and then customize them within the SharePoint Designer. This practice helps to ensure that the fundamental relationships between content elements are retained. However, there are times when adding content directly from the SharePoint Designer makes sense, such as when a large team of people is working on Internet-facing pages. It all depends on exactly what you are trying to accomplish. Adding a page to an existing web site is a simple matter of selecting File ➤ New from the main menu. If you hover over the New menu item, a submenu will fly out, offering you some basic choices. If you click the New menu item, the New dialog will open with a complete collection of elements you can add to the site. Once the new page is added, you may start designing it. Before you start creating sites that integrate directly with SharePoint Services, I’ll start by reviewing some of the Basic Page–creation tools in the SharePoint Designer. These tools will be useful later when you are working with more complicated pages. When starting a new page, many web designers will create a prototype page using a graphics program such as Adobe Photoshop. Then they cut the image apart to create the graphics for the new page. This is especially helpful if you have an existing web site and are trying to make the new page match that look and feel. You can get help with this effort by making use of a tracing image in the SharePoint Designer.

157

158

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Tracing images allow you to take a JPEG, GIF, PNG, or BMP file and use it like tracing paper to help with the layout and design of a page. In order to set a tracing image, you must have the page in design view, which is controlled by a set of buttons underneath the page. Once in design view, the tracing image is set by selecting View ➤ Tracing Image ➤ Configure from the SharePoint Designer menu. When you configure the tracing image, you select the file to act as the image, its position on the page, and its opacity. Figure 5-6 shows a tracing image of the Apress web site.

Figure 5-6. Setting a tracing image

Once you have a tracing image in place, you will want to construct the layout of the page to define the areas where content will be placed. The SharePoint Designer allows you to set up multiple complex regions for content using layout tables. Layout tables are similar to any HTML table, but they are specifically intended to help lay out content regions on the page. Inserting a layout table into a page is done by using the layout table task pane, which can be opened by selecting Table ➤ Layout Tables and Cells. Within the task pane, you can choose to create your own layout tables or use the predefined layouts in the pane. Generally, the predefined layouts are sufficient because several different kinds are available. Even if these are not exactly what you want, you can modify the layouts once they are applied to the page.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

To utilize layout tables and cells, take these steps: 1. Select Start ➤ Programs ➤ Microsoft Office ➤ Microsoft Office SharePoint Designer 2007 to open the SharePoint Designer. 2. From the main menu, select File ➤ Open Site. 3. In the Open Site dialog, type the address of the blank site you created earlier (e.g., http://vsmoss:[port]) and click Open. 4. When the site opens, make sure the folder list is visible by selecting Task Panes ➤ Folder List from the main menu. 5. Using the folder list, examine the sites, lists, and libraries defined in the site. 6. Add a new ASPX page to the site by selecting New ➤ ASPX from the main menu. 7. Open the Layout Tables and Cells task pane by selecting Table ➤ Layout Tables. 8. In the Layout Tables and Cells task pane, click a new layout from the Table Layout section with a top title row that spans the entire page and a navigation column that spans the left side of the page. 9. Click your mouse inside the top row. 10. In the Layout Tables and Cells task pane, click the Insert Layout Cell link. 11. In the Insert Layout Cell dialog, accept the default values and click OK to insert the new cell. 12. When the new cell appears, right-click it and select Cell Properties from the context menu. 13. In the Cell Properties dialog, change the Background Color drop-down list to Blue and click the OK button. 14. Click the sizing handle and make the cell fill the entire available area within the layout table. 15. Place additional cells in the layout so that the page has a blue title area and a blue navigation area. Once the initial layout is complete, adding text is a simple matter of typing directly into the cells. You can format the font style directly from the editor using the same approach as you would in Microsoft Word. For images, you may either place the image directly in a cell or make use of layers to position images. Layers are floating frames that can be positioned anywhere on the page. You can add a new layer from the Format menu. Once added, you can drag the layer around the page and position it exactly where you want it. Using the layouts and layers, you can rapidly put a page together over a tracing image.

Working with Data Sources Once you have an idea of how to use the basic layout tools, you will want to be able to add content more interesting than just text and graphics. The SharePoint Designer in conjunction

159

160

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

with WSS supports the ability to create XML data sources that you can use in your web pages. This capability allows you to connect directly with SQL databases, XML files, SharePoint lists, and other sources to display dynamic data sets of information in tabular formats. Using the SharePoint Designer, you can display this data without ever writing code. The key to using dynamic data sets in your web pages is to make use of the Data Source Library and the Data View web part. The Data Source Library acts as an agent for mapping access to any number of data sources that can provide XML data sets. The Data View web part is the component that displays those data sets on the page. When the Data View web part is displaying an XML data set, it has the ability to format the data set based on the eXtensible Stylesheet Language Transform (XSLT). This means that you can use the SharePoint Designer editor to format columns, colors, and styles for a data set. You can also use a conditional format to change the style of a data cell when it reaches certain parameters. In this way, you can call attention to outlying data in the set. Using XML data sets begins with the Data Source Library. You can access the Data Source Library by selecting Data View ➤ Insert Data View from the main menu in the SharePoint Designer. The library lists all of the available XML data sources. If you have an existing SharePoint site open in the SharePoint Designer, you’ll notice that all of the lists and libraries in the site are available for use as data sources. In addition to these sources, you’ll also see support for database connections, XML files, server-side scripts, web services, and the Business Data Catalog. Figure 5-7 shows an example of the Data Source Library.

Figure 5-7. The Data Source Library

When using the Data Source Library, you are not limited to the lists and libraries associated with the site that is currently open. You can either create new lists and libraries directly or utilize lists and libraries from other sites within the portal structure. If you click either the Create New SharePoint List or the Create New Document Library link, you will open a dialog that allows you to add a new list, library, or survey to the Data Source Library. If you instead

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

want to add an element from another site, you can click the Connect to Another Library link to add a new source. From this link, you can add a reference to another SharePoint site, which will import all of the data sources defined for that site. If the data source you want to use is not a SharePoint element already, you will have to spend some time setting up the source before it can be used. Most of the data sources are set up in a similar fashion that begins by clicking the link just below the data source type you want to use. To add a database connection, follow these steps: 1. Place your cursor in the main body of the page you created earlier. 2. From the SharePoint Designer main menu, select Data View ➤ Insert Data View to open the Data Source Library pane. 3. In the Data Source Library, expand the Database Connections node. 4. Click the Connect to a Database link just beneath the node to open the Data Source Properties dialog. 5. Click the General tab, and name the connection Site Map. 6. On the Source tab, click the Configure Database Connection button. 7. In the Configure Database Connection dialog, check the box labeled Use Custom Connection String and click the Edit button. 8. In the Connection String dialog, enter Integrated Security=SSPI ;Persist Security Info=False;Data Source=VSSQL;. 9. Click the OK button. 10. Click Next. 11. On the next step, select a database and table from the list (I used the Names database from the Business Data Catalog examples in Chapter 4). 12. Click Finish. 13. On the Source tab, click Fields. 14. In the Displayed Fields dialog, remove any fields you do not want displayed and click OK. 15. On the Source tab, click Sort. 16. In the Sort dialog, select Sort the Fields By and click OK. 17. In the Data Source Properties dialog, click OK to complete the definition of the new data source. When using a database connection as a data source, it is generally not a good idea to save the credentials directly in the database connection. Instead you can use Windows authentication to verify access credentials at the time the data is accessed in the web site. However, if you go down this path, you will have to set up credentials in the database for each user. A better mechanism for authentication is to use the Microsoft Single Sign-On

161

162

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

(SSO) service. This service allows you to set up a master set of credentials just for accessing such data sources. I cover the setup and usage of SSO in Chapter 11. Once the data source is defined, adding it to the page is a simple matter of dragging the source from the catalog to the page. Once you drop the data source onto the page, the SharePoint Designer adds the server-side code necessary to access the data source and display the data. Because the page now contains server-side code, you may be prompted to rename the page to contain an ASPX extension. The ASPX extension is required for the page to be recognized as containing server-side code.

Working with Data Views Once the data set is visible on the page, you can make changes to the presentation directly in the page. Changing font styles, font sizes, and column header names can be done using the same techniques as in a word processor. A drop-down menu also becomes available in the upper right corner of the table. This drop-down menu gives you the ability to sort and filter the data as well as change the presentation style. From this menu, you can also apply conditional formatting to call out values in the data set that need attention. Although data views can stand alone on a page like a report, they also have the ability to interact with other data sources. For example, you can have one data view that displays names and another data view that displays contact information. Selecting a name from the first data view causes the contact information to show in the second data view. This is the same concept of connecting web parts that you saw when you modified pages directly in SharePoint. You can connect two data views by selecting Web Part Connections from the drop-down menu associated with either of the views. The SharePoint Designer responds by running a wizard that helps you make the connection. The wizard walks you through the process of selecting the fields to connect and the behavior for each part. The wizard also allows you to select a connection with a web part that is on a different page.

Understanding the Impact of Customization The templates that you can select from when creating a new site collection all come from site definitions. A site definition is a collection of pages and content specified using an XML markup language called the Collaborative Application Markup Language (CAML). I discuss CAML in some detail in Chapter 11, but for now I focus on the relationship between site definitions and pages in SharePoint. SharePoint uses site definitions to efficiently manage pages by saving the site definition once and then using it many times. For example, all of the sites you create that use the standard Team Site template share a single set of page definitions. These page definitions are loaded into memory when the site is accessed and subsequently used to render the site content. The pages that are created in memory based on the template are referred to as uncustomized pages. Whenever a page is customized in the SharePoint Designer, it is saved to the SharePoint content database as a new unique page. Customized pages are separate from the site definition initially used to create them. This means that the customized site pages are no longer generated in memory from the initial template. While the SharePoint Designer makes it easy to customize pages, customizations can cause problems because they may not be properly updated whenever a service pack or security update is applied to the original site definition in SharePoint.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

For many developers, the only acceptable way to modify a SharePoint site is to modify the site definition itself. While this is always a valid technical approach, it is much more difficult to modify pages using XML markup than with the SharePoint Designer. Additionally, you cannot take advantage of features such as Contributor Mode to ensure that customizations are done correctly. In my opinion, you should create site definitions only when you truly need a new template that does not exist in SharePoint already or are planning on using the definition to create many sites. Content changes are best done either directly in the SharePoint Designer or by making use of the publishing features discussed in the section “Using the Publishing Feature.”

■Note For those familiar with previous versions of SharePoint, you may have heard customized pages referred to as unghosted pages. Rather than refer to pages as ghosted or unghosted, Microsoft now prefers customized and uncustomized. Furthermore, you may have also been aware that unghosted pages could cause performance problems in SharePoint sites. Microsoft now assures us that customizing pages in the SharePoint Designer will have no significant performance impact, because customized pages are now efficiently parsed.

Whenever you perform an operation in the SharePoint Designer that will customize a page and separate it from its site definition, you will receive a warning dialog. Additionally, the SharePoint Designer will mark the page with an information icon in the Folder List indicating that the page has been customized. Figure 5-8 shows the Folder List in the SharePoint Designer with a customized page highlighted. If you want, you can also discard the customizations and revert the page back to its original definition by right-clicking the page and selecting Revert to Page Template from the context menu. You can even discard the customizations for an entire site by clicking the link titled Rest to Site Definition located on the Site Settings page in SharePoint.

Figure 5-8. Identifying customized pages

163

164

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Along with icons in the Folder List, the SharePoint Designer also provides a set of reports you can use to identify special pages. For example, you can select Site ➤ Reports ➤ Shared Content ➤ Site Template Pages to get a listing of all pages that indicate whether they have been customized. You can also run reports to detect site problems or show site usage.

Saving Customized Templates Whenever you create a new site, SharePoint uses predefined templates to simplify the creation of the new elements for the site. You have already seen the list of templates in use several times. Although WSS and MOSS come with several templates already defined, you can create your own templates and then make them available to others for use. These new templates can be created directly in the browser and saved through the WSS or MOSS interface.

Creating Site Templates SharePoint defines a site collection as the top-level site and all of the sites beneath it in the hierarchy. You have already seen that permissions granted at the top of a site collection are inherited by sites lower in the collection. Using the same organizational structure, SharePoint maintains a Site Template Gallery for each site collection. A new site template can be created and added to the gallery by administrators. Site templates may be created outside of SharePoint using an authoring tool such as the SharePoint Designer, but the simplest way to create a template is to use an existing site within the portal framework. Creating a template from an existing site is done through the Site Settings page for the site you want to save. Simply select the link titled Save Site as Template from the Look and Feel section on the Site Settings page. Generally, you will save only the structure of a site as a template; however, SharePoint does allow you the option of saving content along with the structure. Site templates are always saved as files with an STP extension.

■Note It’s important to realize that site templates saved as STP files are always considered customized sites. They are never related to any site definition within SharePoint. This is essentially the same situation as if you had created every page in the template by hand in the SharePoint Designer; however, it’s much easier to create a template as an STP file than to customize an entire site.

Once you have created saved templates for a site collection, you can go back and manage the templates. Accessing the set of templates for a site collection is done through the Site Settings page associated with the top-level site. The Site Templates Gallery is a library of all the available templates for the site collection. You will not see any site definitions in this library, only template files with an STP extension. Once you have several templates available for the site collection, you can control their availability to subsites in the collection. Clicking the Site Templates link on the Site Settings page allows you to configure which templates are available to subsites in the collection.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Creating List Templates Just as you can create site templates from existing sites, SharePoint allows you to create list templates from existing lists. A list template consists of the site columns that you define for the list and any views you define. Just like site templates, you also have the option of saving the list content as part of the template. Saving a list as a template is done from the List Settings page, which can be accessed by selecting Settings ➤ List Settings from the toolbar of any list.

Using the Publishing Feature While previous versions of SharePoint can be used as public Internet sites, they were never really designed with that purpose in mind. Chief among the limitations of previous versions is a complete lack of content management capabilities. Specifically, previous versions have no way to create page templates for different content, do not significantly separate content development from content publishing, and have only a simple mechanism for approving content. The reason that previous versions of SharePoint have weak content management capabilities is probably because Microsoft Content Management Server (MCMS) already provides a structure for templating, authoring, and publishing web content; Microsoft saw SharePoint as primarily an intranet solution. That’s all changed now because the web content management (WCM) features included with MOSS are a direct replacement for MCMS. Microsoft has already announced that there will be no new versions of MCMS, which means that organizations with MCMS infrastructures must eventually migrate to MOSS. WCM consists of features that provide content publishing, page templates, document conversion from print to web, and multilanguage support. In this section, I focus specifically on the capabilities of the Office SharePoint Server Publishing Feature, which allows you to create and publish web content. I should point out before beginning a detailed discussion of WCM that content management is not limited to Internet sites. WCM is simply a set of features that provide the capability to implement content management within a site. You certainly could use it for an intranet or even a simple collaboration site. It is important to note, however, that WCM is strictly a MOSS feature. You will not find it in the list of available features for WSS.

Creating a Public Internet Site While many content management capabilities are certainly useful in team sites, the most likely scenario for content management involves the enterprise. Therefore, I will assume for the rest of the chapter that you are using MOSS. To support the discussion, I’ll use an Internet web site created on the VSMOSS server. Follow these steps to create an Internet site: 1. Log in to VSMOSS as a SharePoint administrator. 2. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. On the Application Management tab, under the SharePoint Web Application Management section, click the link titled Create or Extend a Web Application. 4. On the Create or Extend a Web Application page, click the link titled Create a New Web Application.

165

166

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

5. On the Create a New Web Application page, select the option to Create a New IIS Web Site. 6. In the Description field, type Internet. 7. In the Application Pool section, select Create a New Application Pool. 8. Enter Internet_Pool as the pool name. 9. Select the Configurable option for the application pool security account. 10. In the User Name field, enter DOMAIN\SPContentPool. 11. In the Password field, enter the account password. 12. In the Reset Internet Information Services section, select the option to Restart IIS Automatically. 13. Click the OK button. 14. On the Application Created page, click the link titled Create a New Site Collection. 15. On the Create Site Collection page, enter APress in the Title field. 16. Under the Template Selection section, click the Publishing tab, and then select the Publishing Portal template. 17. Under the Primary Site Collection Administrator section, enter DOMAIN\ Administrator in the User Name field. 18. Click the OK button to create the new site collection. When the site collection is created, open it in a separate copy of the browser. When creating a public Internet site, you may want to set it up so that you can author content on it from inside the firewall. One way to do this is to configure it so that it is accessible from two different zones. Typically the Default zone is accessible through Windows authentication while the Internet zone is accessible anonymously. With this configuration, you can use the Default zone for managing content and the Internet zone for presenting it. This is not the only possible authoring configuration; I discuss a more formal content deployment scenario in the section titled “Using Content Deployment.” Follow these steps to extend the web application into the Internet zone: 1. In the Central Administration site, click the Application Management tab. 2. Under the SharePoint Web Application Management section, click the link titled Create or Extend Web Application. 3. On the Create or Extend Web Application page, click the link titled Extend an Existing Web Application. 4. On the Extend Web Application to Another IIS Web Site page, drop down the Web Application selection list and click Change Web Application. 5. In the Select Web Application page, click the link for the Internet Web Application that you created. 6. Under the IIS Web Site section, choose to Create a New IIS Web Site.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

7. In the Description field type Public Internet, but leave the port number in parentheses as part of the name. 8. Under the Load Balanced URL section, select Internet from the Zone drop-down list. 9. Make note of the URL for the extended web application so you can access it later. 10. Click the OK button. Once the web application is extended, you will want to enable anonymous access to the new site collection. Enabling anonymous access requires that you first allow it for the site collection using Central Administration and then designate what portions of the Internet site will support anonymous access. In this way, you can create an Internet site that has both public and private areas. Follow these steps to enable anonymous access: 1. Click the Application Management tab in the Central Administration web site. 2. Under the Application Security section, click the Authentication Providers link. 3. On the Authentication Providers page, make sure that your new web application is shown in the drop-down. If not, use the drop-down to change the selection. 4. Click the Windows link for the Internet zone of your web application. 5. On the Edit Authentication page, check the box labeled Enable Anonymous Access and click the Save button. 6. Click the Application Management tab in the Central Administration web site. 7. Under the Application Security section, click the link titled Policy for Web Application. 8. On the Policy for Web Application page, make sure that your new web application is shown in the drop-down. If not, use the drop-down to change the selection. 9. Click the Add Users link. 10. On the Add Users page, make sure All Zones is selected and click the Next button. 11. Enter DOMAIN\Administrator in the Users box and check the Full Control permission to grant the administrator access to both the Default and Internet zones. 12. Click the Finish button. 13. Now open the home page of the public Internet site you extended on the Internet zone and click the link titled Enable Anonymous Access.

■Caution Be sure that you open the Internet site using the URL for the extended application. Remember, you want anonymous access to the Internet zone and Windows access to the Default zone. I find it useful to save a link in the Favorites list named for the zone (e.g., Apress Default Zone and Apress Internet Zone).

14. On the Change Anonymous Access Settings page, select the option labeled Entire Web Site and click the OK button.

167

168

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Once you have completed the previous steps you will be able to author content on the Default zone and access it anonymously on the Internet zone. While these steps are good for investigating MOSS, you will probably want to ensure the Internet zone is on port 80 in a production environment. Usually, I create the Default zone on a different port (e.g., 8080) and then extend the web application into port 80 as the Internet zone. Another real-world consideration is the fact that Internet sites are often isolated in the DMZ and may not be accessible from the Windows domain. In this case, I make use of the content deployment capabilities of MOSS to push content from a staging server to production. I discuss content deployment in the section titled “Using Content Deployment” later in the chapter.

Creating and Approving Pages Once you have a site created, you may begin adding content to it. Typically, you begin the process by adding new pages to the site. Adding a page requires the Manage Web Site right and is accomplished by selecting Create Page from the Site Actions menu. When you select to create a new page for an Internet site, MOSS displays a list of page layouts for the site. Page layouts are templates that define content structure for a page and are always associated with a content type. As I discussed in Chapter 3, a content type contains a document template, data columns, workflows, and other information that completely defines a document. The publishing feature of MOSS uses a single root content type for publishing called Page. All of the page layouts inherit from this base. Figure 5-9 shows the list of available page layouts for the Internet site.

Figure 5-9. Available page layouts

You can get a better understanding of the content types behind the page layouts by viewing their definitions in MOSS. Content types can be accessed from the Site Settings page by clicking the link titled Site Content Types. This link displays the Site Content Type Gallery, which lists all of the available content types for web pages, documents, and lists. The page layouts for the Internet site are located under the Page Layout Content Types section of the gallery. These content types define the document template and columns for the page layouts. This information determines how the page appears in MOSS and makes it available in the page layouts list. Figure 5-10 shows part of the content type definition for the Article Page layout.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Figure 5-10. Article Page content type

When you create a new page, it is initially displayed in edit mode. In the body of the page, SharePoint displays field controls, which are used to add content to the page. Field controls hold values for columns associated with the content type. If you create a new Article Page, for example, it has field controls for Title, Rollup Image, Page Image, Article Date, Byline, Image Caption, and Page Content. If you examine the complete content type definition for an Article Page, you’ll see that it has columns defined with the same names. Figure 5-11 shows an Article Page in edit mode. Each of the field controls in a page layout can support different types of content, including images, text, groups, audiences, links, HTML, and more. When the page is in edit mode, each field control offers a different interface to help you properly configure the content. For example, field controls tied to images present an interface that allows you to select an image, provide alternate text, and specify hyperlinking behavior. To complete a page, simply work inside each field control to provide the needed content. When working with a page in edit mode, SharePoint displays the page editing toolbar at the top. Once you’ve finished editing the page, you can use the page editing toolbar to allow other editors to view your work, save the page, or submit the page for approval. Figure 5-12 shows the page editing toolbar.

169

170

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Figure 5-11. Article Page in edit mode

Figure 5-12. The page editing toolbar

Clicking the button labeled Check In to Share Draft checks the new page in and allows other editors who have permission to review it. When a page is checked in, another editor may check out and alter the page by clicking the Edit Page button. MOSS automatically increments the minor version number of the page and displays it with a Draft status as each subsequent checkout, edit, check-in cycle is performed. When saved, the new page is stored in a document library named Pages that is fully accessible from within MOSS. Most of the pages you create for a site will have other content elements such as images. In MOSS, individual content elements must be approved before they can appear in a published page. Content such as images is typically approved separately within the library where it resides and then used within pages. Follow these steps to upload and approve an image: 1. Go to the home page of the Internet site you created earlier using the Default zone. 2. Select View All Site Content from the Site Actions menu. 3. On the All Site Content page, click the Images library. 4. In the Images Library, click Upload on the toolbar. 5. On the Upload Document: Images page, click the Browse button. 6. Using the Choose File dialog, locate an image to upload and then click the Open button.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

7. On the Upload Document: Images page, click the OK button. 8. On the Edit Item page, give your image a title and click the Check In button. 9. On the Document Library page, note that the image now appears with an Approval Status of Draft. 10. Using the drop-down menu associated with the file name, select Publish a Major Version. 11. On the Publish a Major Version page, click the OK button. 12. On the Document Library page, note that the image now appears with an Approval Status of Pending. 13. Using the drop-down menu associated with the file name, select Approve/Reject. 14. On the Approve/Reject page, select Approved and click the OK button. 15. On the Document Library page, note that the image now appears with an Approval Status of Approved. Once the page editing process is complete, you can click the Submit for Approval button. Submitting the page for approval starts a simple serial workflow process that allows you to route the page to a list of people one at a time. While the page is being routed for approval, you can also run a check of the content to make sure there aren’t any unapproved content items used on the page.

Using an Alternate Style Sheet Earlier in the chapter, I described how you could edit existing style sheets such as CORE.CSS to make changes to the appearance of sites. The drawback with this approach, of course, is that the changes made at this level are global. If you have the publishing feature installed, however, you can utilize an alternate style sheet that will override the styles found in CORE.CSS. Furthermore, each site collection can have its own alternate style sheet, which means that your changes do not have to be global. You can specify an alternate style sheet by clicking the Master Page link on the Site Settings page, which will take you to a page where you can enter a URL to the alternate style sheet.

Understanding Master Pages and Page Layouts Master pages and page layouts are the two main components used by SharePoint to control the navigation, branding, and content of a site. The purpose of a master page is to provide a consistent navigation and page layout structure that is independent of the content on the page. The purpose of a page layout is to provide the content that appears within the page. Together, master pages and page layouts dictate the look and feel of a SharePoint site.

Editing the Default Master Page Whenever you create a new site in SharePoint, a master page named default.master is created for the site and stored in the Master Page Gallery. This master page defines many of the

171

172

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

navigational and branding elements that appear around a page. These elements are sometimes referred to as the chrome of the page, and changing them in the master page has a wide-ranging impact on a site. Follow these steps to edit the master page: 1. Go to the home page of the Internet site you created earlier using the Default zone (e.g., http://vsmoss:[port]). 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 3. On the Site Settings page, click the Master Page and Page Layout Gallery link under the Galleries section. 4. In the Master Page Gallery, select Check Out from the drop-down menu associated with the default.master file. 5. Select Edit in Microsoft SharePoint Designer from the drop-down menu associated with the default.master file. 6. When the master page opens, right-click the image near the site name and select Properties from the context menu. 7. In the tag Properties window, change the ImageURL property to point to the approved image you uploaded earlier (e.g., /sites/apress/PublishingImages/Apress_Small.jpg).

■Note If you have an image taller than 25 pixels, it will likely be too large for a nice appearance. Therefore, you might want to edit an image and publish it again before using it. For this example, I created a small Apress logo from images on the web site.

8. Select File ➤ Save All from the main menu. 9. When you receive the notice that you are customizing a page in the site template, click the Yes button. 10. Close the SharePoint Designer. 11. Return to the Master Page Gallery and select Check In from the drop-down menu associated with the default.master file. 12. On the Check In page, click the OK button. 13. Select Publish a Major Version from the drop-down menu associated with the default.master file. 14. On the Publish Major Version page, click the OK button. 15. Select Approve/Reject from the drop-down menu associated with the default.master file.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

16. On the Approve/Reject page, select Approved and click the OK button. 17. The Master Gallery page should now have the new image similar to Figure 5-13.

Figure 5-13. A changed master page

While changing the default.master page has resulted in a new image appearing, if you navigate to other pages you might notice that the new image is not present. For example, simply select View All Site Content from the Site Actions menu and you will see that the old image is still in use. This is because not all of the pages in the site use the default.master page to generate their chrome. Many of the pages use what is called the application master page instead. The application master page is a global master page that is used across all site collections. It is located at \Program Files\Common Files\Microsoft Shared\web server extensions\12\ TEMPLATE\LAYOUTS. If you want, you can edit this page in Visual Studio or Notepad by opening it directly from the file system. The problem, however, is that these changes will affect every site collection in SharePoint. This means that you are left with a terrible choice when it comes to site branding. If you don’t edit the application master, some pages will not appear with a consistent look and feel. If you do edit the application master, every site will get the change and may cause inconsistencies as well. The problem is even worse than you might expect because SharePoint actually has several master pages that it uses beyond the default and application master. A search of the LAYOUTS directory for master pages on VSMOSS reveals more than 20 master pages. Some of these pages are associated with particular templates, while others are used for administration pages. In any case, you can see that SharePoint’s use of master pages is less than optimal. One way to solve the problems with multiple master files is to create a new LAYOUTS directory for each web application. To do this, you simply create a new directory under the TEMPLATE directory, for example LAYOUTS2, and then change the Local Path property in the Internet Information Server console for the virtual LAYOUTS directory to point to the new folder. Copy all of the contents from the original LAYOUTS directory to the new one and then you’ll have a separate application master file just for that web application.

■Caution When editing any file located in the LAYOUTS directory, do not use the SharePoint Designer. The SharePoint Designer is not intended to edit the pages and will corrupt files opened directly from the LAYOUTS directory. For best results, I edit these files in Visual Studio or Notepad instead. In any case, be sure to save a backup copy of the file before making any changes.

173

174

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Creating New Page Layouts In the section “Using the Publishing Feature,” I discuss creating new pages for a site and show the list of available page layouts. It is unlikely, however, that the available page layouts will work in most situations. Therefore, you’ll have to create your own page layouts for use on the site. Creating a page layout is accomplished in five steps: define site columns, define a content type, create a page layout, edit the page layout, and publish the page layout. As I mentioned already, page layout field controls are directly related to site columns. Therefore, you’ll have to create new site columns for each of the separate content elements you want in a page layout. If, for example, you are creating a product page, you might define site columns such as Product Name or Product Description. These columns can then be used later to hold specific product information. Creating new site columns is done from the Site Columns Gallery, which is accessible from the Site Settings page. From the Site Columns Gallery, you can click the Create button and define a new column. When you define a new site column you can select from any of the data types shown in Table 5-3. Table 5-3. Site Column Types

Data Type

MOSS/WSS

Description

Single Line of Text

MOSS/WSS

A single line of text

Multiple Lines of Text

MOSS/WSS

Many lines of text

Choice

MOSS/WSS

A predefined list of choices

Number

MOSS/WSS

A specified minimum, maximum, and number of decimal places

Currency

MOSS/WSS

Money in a specified currency format

Date/Time

MOSS/WSS

A date or date/time formatted value

Lookup

MOSS/WSS

A value obtained from a list on the site

Boolean

MOSS/WSS

A yes or no value appearing as a check box

People

MOSS/WSS

A person or group based on SharePoint membership

URL

MOSS/WSS

A hyperlink or an image link

Calculated

MOSS/WSS

A computed value based on other fields

HTML

MOSS only

HTML content specifically for content management

Image

MOSS only

A picture specifically for content management

Hyperlink

MOSS only

A link specifically for content management

Summary

MOSS only

A column providing summary links

Business Data

MOSS only

A column for use with the Business Data Catalog

Audience

MOSS only

A column that targets specific audiences

After defining the site columns, you must then define a new content type that uses these columns. Defining a new content type is done from the Site Content Type Gallery, which is accessible from the Site Settings page. From the Site Content Type Gallery, you can click the Create button and define a new content type. The key to making a content type that works correctly with the WCM feature is to inherit from the existing page content type. After that, simply add the site columns you created to the new content type.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Once the content type is created, you can go on to create the new page layout. Creating a new page layout is done from the Master Page and Page Layout Gallery, which is accessible from the Site Settings page. From the Master Page and Page Layout Gallery, you can select New ➤ Page Layout from the toolbar. When you create the new page layout, you’ll be asked to associate it with a content type. Here you would simply select the content type you created earlier. After the new page layout is created, you must specifically add field controls to the page so that content editors can use them to create new pages. Field controls are added using the SharePoint Designer, and you can open the page layout for editing in the SharePoint Designer by using the drop-down menu associated with the file. Alternately, you can open the entire site in the SharePoint Designer and locate the page layout in the Master Page Gallery located at catalogs\masterpage. Depending upon your exact role on the site, you may need to make changes to the Contributor Settings. In order to change the settings, select Site ➤ Contributor Settings, which will open a dialog. In the dialog, you can give groups the ability to edit certain content. Additionally, you can simply disable the settings to allow all content to be edited. In any case, if you have trouble making changes to the page layout, it is likely the result of restricted permissions. If you have appropriate permissions, you can double-click the new page layout and it will open for editing. By selecting Task Panes ➤ Toolbox, you can open a window that shows all of the different components that you can add to the page. The field controls appear in the SharePoint Controls section under the Content Fields node. Using the toolbox, you can right-click any of the content fields and select Insert from the context menu to add them to the page layout, as shown in Figure 5-14.

Figure 5-14. Adding field controls

Once the new page layout is completed, you must make it available to content editors. This is done by checking in the page layout, publishing it, and approving it. This process is largely the same as for any item in SharePoint. Once approved, the new page layout will be available on the site when a user selects Create Page from the Site Actions menu. If you are interested in a detailed examination of creating new page layouts, the Exercise at the end of the chapter will walk you through the entire process.

175

176

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Creating New Master Pages In addition to the default and application master pages, you may also associate page layouts with custom master pages. For example, many of the pages in the Publishing Portal template use the TopNavFlyouts master page. This master page was designed to be the foundation for all of the public content pages that appear on the site. Creating a custom master page gives you the most control over the look and feel of a site. If you are using SharePoint to create a public Internet site, you will definitely want to create a set of custom master pages. This is really the only way to achieve the level of design control needed for most Internet projects. Unfortunately, there is no way in SharePoint to start with a blank slate and design your site. This is because both SharePoint and the WCM feature assume a certain infrastructure is in place when processing master pages and page layouts. Furthermore, there is no “Blank WCM Site” template that gives you everything you need for your own custom master page. This is a terrible shortcoming in my opinion, but we can compensate by developing our own blank master page that meets just the minimum requirements of the SharePoint infrastructure. Listing 5-1 shows a complete master page, available in the MOSS SDK, that you can use as the basis for your own custom look and feel. Listing 5-1. A Minimal Master Page





CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT



















177

178

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT













The minimal master page consists of Imports and Register statements for referencing SharePoint assemblies that are required by the WSS or WCM infrastructure. The body of the master page contains server-side controls that interact with the WSS or WCM infrastructure. Each of these controls is responsible for generating part of the page within a SharePoint site. The following sections describe key tags in the master page in the order they appear.

WebPartPages:SPWebPartManager WebPartPages:SPWebPartManager is the server control that implements the web part infrastructure. You’ll find this control on every page in a SharePoint site. Without this control, web parts cannot be used on the page.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

asp:ContentPlaceHolder The server control asp:ContentPlaceHolder generates content for the page. In a typical page, there are several of these controls that are used to hold everything from text to user controls. Earlier when you created a page layout, you used the PlaceHolderMain placeholder to render the body of the page. It’s important to note that a master page must support all of the content holders referenced by a page layout. If a page layout has content holders defined in it that are not available in the master page, you will see errors on the page when it renders. The master page defined in Listing 5-1 is designed to be a starting point that contains the minimally required tags, but you will likely have to add additional content placeholders if you wish to replace an existing master page in a SharePoint site. Table 5-4 shows the placeholders from Listing 5-1 and describes their purpose. Table 5-4. Content Placeholders

Placeholder

Purpose

PlaceHolderSearchArea

Defines the search box

PlaceHolderTitleBreadcrumb

Defines the main breadcrumb on the page

PlaceHolderPageTitleInTitleArea

Defines the title at the top of the page

PlaceHolderLeftNavBar

Defines the area on the far left of the page

PlaceHolderPageImage

Defines the page icon in the upper left corner

PlaceHolderBodyLeftBorder

Defines the left border of the main page

PlaceHolderNavSpacer

Defines the width of the left navigation area

PlaceHolderTitleLeftBorder

Defines the left border of the title area

PlaceHolderTitleAreaSeparator

Defines shadows for the title area

PlaceHolderMiniConsole

Defines an area for page-level commands such as exiting edit mode

PlaceHolderCalendarNavigator

Defines a date picker for a calendar view

PlaceHolderLeftActions

Defines the bottom of the left navigation area

PlaceHolderPageDescription

Defines the page description area

PlaceHolderBodyAreaClass

Defines additional body styles

PlaceHolderTitleAreaClass

Defines additional title styles

While content placeholders are most obviously used for text and graphics, they can also be used to render controls. The best example of this capability is the SharePoint: DelegateControl. This control is often used in conjunction with placeholders to display user controls on a page. In fact, SharePoint uses this capability extensively to render things such as the search box. The following code from the default.master page shows how the search box is displayed using a combination of the PlaceHolderSearchArea placeholder and the DelegateControl:



179

180

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

The DelegateControl has a ControlId attribute that references the class name of a user control located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\ 12\TEMPLATE\CONTROL TEMPLATES. If you examine the contents of this directory, you will see that there are many user controls available. Unfortunately at this writing, there is very little documentation on these controls. The best way to learn about them is to examine the default.master page, review the control file itself, and experiment with test code.

SharePoint:CssLink The server control SharePoint:CssLink is responsible for generating the links between the page and the required style sheets. This link is created by using a link tag in the page. The following code shows an example of the output generated by the SharePoint:CssLink control:

PublishingWebControls:AuthoringContainer The server control PublishingWebControls:AuthoringContainer is a container for the controls PublishingSiteAction:SiteActionMenu and PublishingConsole:Console. The PublishingSiteAction:SiteActionMenu server control is an enhanced Site Actions menu that is enabled by the WCM feature. The PublishingConsole:Console is used to generate the toolbar for the publishing process. All of these controls are required by the WCM feature.

Enabling Site Variations If you are creating content that must be presented in different languages, you’ll want to enable site variations. Site variations allow you to centralize the management of multilingual content and then propagate it to other sites. Site variations essentially set up parallel site collections that are synchronized with a master collection. When a change is made to the master collection, the content is copied to all the variations. Setting up site variations is relatively straightforward for a publishing site. Follow these steps to set up site variations: 1. Go to the home page of the Internet site you created earlier using the Default zone. 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 3. On the Site Settings page, click the Variations link under the Site Collection Administration section. 4. On the Variation Settings page, type a forward slash into the Location field. 5. Click the OK button. 6. On the Site Settings page, click the Variation Labels link under the Site Collection Administration section. 7. On the Variation Labels page, click the New Label button. 8. On the Create Variation Label page, enter English (en-us) in the Label Name field.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

9. Enter English in the Display Name field. 10. Select English (United States) from the Locale drop-down list. 11. Select the option labeled Publishing Site and All Pages. 12. Check the box labeled Set This Variation to Be the Source Variation. 13. Select Publishing Site from the drop-down list labeled Select the Publishing Site Template You Want to Use. 14. Click the OK button. 15. On the Variation Labels page, click the New Label button. 16. On the Create Variation Label page, enter Italian (it-IT) in the Label Name field. 17. Enter Italian in the Display Name field. 18. Select Italian (Italy) from the Local drop-down list. 19. Select the option labeled Publishing Site and All Pages. 20. Click the OK button. 21. On the Variation Labels page, click the Create Hierarchies button. Once the hierarchy creation is complete, you will have a subsite created for each of the labels you defined. These subsite structures allow you to have identical structures with localized content. Now when you make changes to the source label, they’ll be propagated to the other labels you defined.

Using Content Deployment Content deployment is a capability used to move content from one SharePoint site collection to another. Using content deployment, you can move content between site collections in the same farm or across farms. This capability allows you to create staging servers where you can develop and test solutions before deploying them into production. Configuring content deployment is done through the Central Administration site. A content deployment section is located on the Operations tab and contains all of the functionality you need to set up paths and jobs. Paths form relationships between site collections so that one can act as a source and the other as a destination. Jobs define the actual content that will be deployed from the source to the destination. Before creating paths and jobs, however, you must enable content deployment on the farm. This is done by clicking the Content Deployment Settings link on the Operations tab of the Central Administration site. On the Content Deployment Settings page, you must select the option to accept incoming content deployment jobs. You can also specify the servers to handle the incoming and outgoing jobs as well as whether connections must be made using the HTTPS protocol. Once the farm is configured to allow content deployment, you can set up paths between site collections. This is accomplished by clicking the Content Deployment Paths and Jobs link. Here you can create a new path that defines a source and destination site collection.

181

182

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Once the path is created, you can set up a job to move the content. The job can be set up to deploy an entire site collection or just selected sites. You can also set up the job to run on a schedule or to execute manually later. Lastly, you can configure the job to send an e-mail each time it runs.

Exercise 5.1. Web Content Management In this exercise, you will create a new site that uses WCM to create a custom look and publish custom pages. The site will be an IT training site with custom page layouts to describe training courses offered internally to employees. I’ll keep this site very simple to emphasize the process you should follow to create a custom look and feel that can differ radically from the standard SharePoint appearance. You’ll then be able to use this same technique to create specific sites and page layouts for your own purposes.

Creating a New Site When creating your own custom sites, you can either choose to modify the master pages and page layouts that are provided out of the box in templates, or create your own from scratch. In this exercise, you’ll use a blank site and create new content that is not tied to an existing layout. The process of creating a new web application and site collection should be familiar to you by now. Follow these steps to create a new site: 1. Log in to VSMOSS as a SharePoint administrator. 2. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. On the Application Management tab, under the SharePoint Web Application Management section, click the link titled Create or Extend a Web Application. 4. On the Create or Extend a Web Application page, click the link titled Create a New Web Application. 5. On the Create a New Web Application page, select the option to Create a New IIS Web Site. 6. In the Description field, type Departmental and make note of the port number that the new web application will use. 7. In the Application Pool section, select Create a New Application Pool. 8. Enter Departmental_Pool as the pool name. 9. Select the Configurable option for the application pool security account. 10. In the User Name field, enter DOMAIN\SPContentPool. 11. In the Password field, enter the account password. 12. In the Reset Internet Information Services section, select the option to Restart IIS Automatically.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

13. Click the OK button. 14. On the Application Created page, click the link titled Create a New Site Collection. 15. On the Create Site Collection page, enter IT Training in the Title field. 16. Under the Primary Site Collection Administrator section, enter DOMAIN\Administrator in the User Name field. 17. Under the Template Selection section, click the Collaboration tab, and then select the Blank Site. 18. Click the OK button to create the new site collection. When the site collection is created, open it in a separate copy of the browser. You might also want to add a Favorites link in the browser so that you can get back to the site easily.

Activating and Configuring the Publishing Feature Although the Blank Site template is available in both WSS and MOSS, I want to use the publishing feature of MOSS to enable the management of web content. Therefore, you will enable the Office SharePoint Server Publishing Feature on the blank site. Once enabled, you will be able to create custom page layouts for the site. Follow these steps to activate the publishing feature: 1. From the home page of the IT training site, select Site Settings from the Site Actions menu. 2. On the Site Settings page, click the Site Collection Features list under the Site Collection Administration section. 3. On the Site Collection Features page, click the Activate button associated with the Office SharePoint Server Publishing Infrastructure Feature. 4. Return to the Site Settings page. 5. On the Site Settings page, click the Site Features link under the Site Administration section. 6. On the Site Features page, click the Activate button associated with the Office SharePoint Server Publishing Feature. 7. Save the code from Listing 5-2 as a file named training.master. Listing 5-2. training.master











CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT
















185

186

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT



ID="PlaceHolderTitleLeftBorder" ID="PlaceHolderTitleAreaSeparator" ID="PlaceHolderMiniConsole" id="PlaceHolderCalendarNavigator" id="PlaceHolderLeftActions" id="PlaceHolderPageDescription" id="PlaceHolderBodyAreaClass" id="PlaceHolderTitleAreaClass"



8. In the IT training site, select Site Settings ➤ Modify All Site Settings from the Site Actions menu.

■Note Take note that the Site Actions menu has changed now due to the activation of the publishing feature.

9. On the Site Settings page, click the link titled Master Page and Page Layout Gallery under the Galleries section. 10. In the Master Page Gallery, click the Upload button. 11. On the Upload Master Page page, click the Browse button to open the Choose File dialog. 12. In the Choose File dialog, locate the training.master file and click the Open button. 13. On the Upload Master Page page, click the OK button. 14. On the Master Page Gallery page, select Publishing Master Page from the Content Type drop-down list and click the Check In button. 15. In the Master Page Gallery, locate the training.master file and select Publish a Major Version from the drop-down menu.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

16. On the Publish Major Version page, click the OK button. 17. In the Master Page Gallery, locate the training.master file and select Approve/Reject from the drop-down menu. 18. On the Approve/Reject page, select Approved and click the OK button. 19. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 20. On the Site Settings Page, click the Site Master Page Settings link under the Look and Feel section. 21. On the Site Master Page Settings page, select the training.master file from the Site Master Page drop-down list and click the OK button.

Creating a New Welcome Page Now that the WCM features are available, you can use them to create a new page. A page layout already exists for creating a welcome page for the site. In this section, you will use the existing page layout to create a new welcome page for the training site. Follow these steps to create a new welcome page: 1. In the IT training site, select Create Page from the Site Actions menu. 2. On the Create Page, enter IT Training Home in the Title field. 3. Enter home in the URL Name field. 4. Select (Welcome Page) Welcome Page with Table of Contents from the Page Layout list. 5. Click the Create button. 6. When the new welcome page appears in edit mode, click the button labeled Check In to Save Draft.

■Note The page should be a fairly plain page indicating the influence of the training master page. You should also see that the Site Actions menu has changed position to the left side of the page.

7. From the new Welcome page, select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 8. On the Site Settings page, click the Welcome Page link under the Look and Feel section. 9. On the Site Welcome Page page, click the Browse button. 10. Locate the home.aspx page in the Pages library and click the OK button. 11. On the Site Welcome Page page, click the OK button. The home.aspx page should now be the default page for the site.

187

188

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Defining Site Columns Page layouts are a key facet of content management within MOSS and are used to create specific types of web pages that have placeholders for content. Once created, page layouts make it easy for content owners to create new pages for a site, publish them, and route them for approval. The individual content elements that appear in a page layout are derived from site columns. When you create a page layout, you can use any of the site columns already defined or define your own. In this exercise, you will define several custom site columns that are specific to the course description page layout you will make later. Follow these steps to create the custom site columns: 1. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 2. On the Site Settings page, click the Site Columns link under the Galleries section. 3. On the Site Column Gallery page, click the Create button. 4. On the New Site Column page, enter Course Name in the Column Name field. 5. Under the Group section, select the New Group option and type Course Page Layout in the text field. 6. Click the OK button. 7. Repeat steps 3 through 6 to create columns as defined in Table 5-5. Table 5-5. Custom Columns

Name

Type

Details

Course Description

Multiple lines of text

No support for rich text

Course Level

Choice

Choice values of 100, 200, 300

Course Outline

Publishing HTML



Defining the Content Type Page layouts have a direct relationship to a content type defined within the site. The content type is a collection of site columns, a page template, workflows, and other information that determines the appearance and behavior of a page layout. In this exercise, you will create a new content type that derives from the existing Page content type. Inheriting the Page content type allows the new page layout to function correctly within the MOSS content management feature. Follow these steps to create the new content type: 1. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 2. On the Site Settings page, click the Site Content Types link under the Galleries section. 3. On the Site Content Type Gallery page, click the Create button. 4. On the New Site Content Type page, enter Course Page in the Name field.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

5. Select Publishing Content Types from the list labeled Select Parent Content Type From. 6. Select Page from the list labeled Parent Content Type. 7. Select Custom Content Types from the list labeled Existing Group. 8. Click the OK button. 9. On the Site Content Type page, click the link titled Add from Existing Site Columns. 10. On the Add Columns to Site Content Type page, select Course Page Layout from the list labeled Select Columns From. 11. Move all of the columns from the Available Columns list to the Columns to Add list. 12. Click the OK button.

Creating the Page Layout Page layouts are stored in the Master Page and Page Layout Gallery. From this gallery, you can create a new page layout and associate it with a content type. This process makes the site columns that are defined for the content type available to the page layout as field controls that you can place on the page with the SharePoint Designer. Follow these steps to create the new page layout: 1. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 2. On the Site Settings page, click the Master Page and Page Layout Gallery link under the Galleries section. 3. In the Master Page Gallery, select New ➤ Page Layout from the toolbar. 4. On the New Page Layout page, select Custom Content Types from the list labeled Content Type Group. 5. Select Course Page from the list labeled Content Type Name. 6. Type CoursePage in the URL Name field. 7. Type Course Page in the Title field. 8. Give the page layout a description. 9. Click the OK button.

Editing the Page Layout Once you have created the new page layout, you must open it in the SharePoint Designer so that you can add the desired field controls. The site columns you define as part of the content type become available in the SharePoint Designer as field controls that you can place on the page layout. In this exercise, you’ll place field controls for the columns that define a course description page.

189

190

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Follow these steps to edit the page layout: 1. Open the SharePoint Designer by selecting Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office SharePoint Designer 2007. 2. In the SharePoint Designer, select File ➤ Open Site from the main menu. 3. In the Open Site dialog, type the training site (e.g., http://VSMOSS:20716/sites/itt). 4. Select Site ➤ Contributor Settings. 5. In the Contributor Settings dialog, click the Advanced button. 6. Click the Disable Contributor Settings button. 7. Click the OK button. 8. In the Folder list, expand the _catalogs folder. Then expand the master page folder.

■Note If the Folder List pane is not visible, select Task Panes ➤ Folder List from the main menu.

9. If the CoursePage.aspx page is not already checked out, right-click the CoursePage.aspx file and select Check Out from the context menu. 10. Double-click the CoursePage.aspx file to open it for editing in the SharePoint Designer. 11. In the toolbox, expand the SharePoint Controls section.

■Note If the Toolbox is not visible, select Task Panes ➤ Toolbox from the main menu.

12. In the SharePoint Controls section, expand the Content Fields node. You should now see the custom columns you added earlier. 13. Right-click the Course Name field in the Toolbox and select Insert from the context menu. 14. Repeat the step to insert all of the fields into the Page Layout. 15. After the fields are added, click File ➤ Save from the main menu. 16. Exit the SharePoint Designer.

■Tip You can use just about any element available in the SharePoint Designer to create your page layout including layout tables, web part zones, and data views. Don’t be shy about experimenting with the content; you can always undo your changes.

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Publishing the Page Layout Once the page layout is created, you must publish and approve it so that it becomes available for content authors. This process is essentially the same as publishing any item in MOSS. First the document is checked in, then it is published, and finally it is approved. Follow these steps to make the new page layout available for use: 1. Go to the home page of the training site. 2. Select Manage Content and Structure from the Site Actions menu. 3. On the Site Content and Structure page, select Open Link in New Window from the drop-down menu associated with the Master Page Gallery. 4. In the Master Page Gallery, select Check In from the drop-down menu associated with the CoursePage.aspx file. 5. On the Check In page, click the OK button. 6. In the Master Page Gallery, select Publish a Major Version from the drop-down menu associated with the CoursePage.aspx file. 7. On the Publish Major Version page, click the OK button. 8. In the Master Page Gallery, select Approve/Reject from the drop-down menu associated with the CoursePage.aspx file. 9. On the Approve/Reject page, select Approved and click the OK button.

Using the Page Layout Once the page layout is published and approved, content authors may use it to create new pages. This is done in the normal way by selecting the Create Page item from the Site Actions menu. After the page is created, the field controls may be edited. Follow these steps to create a new page: 1. Go to the home page of the training site. 2. Select Create Page from the Site Actions menu. 3. On the Create Page page, enter SharePoint Development in the Title field. 4. Select Course Page from the list of page layouts. 5. Click the Create button. 6. When the page opens in edit mode, enter information into the fields of the page layout to create a new course description. Figure 5-15 shows how the new page should look.

191

192

CHAPTER 5 ■ SHAREPOINT CONTENT DEVELOPMENT AND MANAGEMENT

Figure 5-15. A new custom page layout

CHAPTER

6

SharePoint Document, Form, and Records Management T

hroughout the book, I have used document libraries in various examples and worked with some of the functionality. However, we have not yet investigated documents, forms, records, and libraries in detail. In this chapter, we will take a detailed look at the functionality in SharePoint for managing documents, forms, and records. After reading this chapter, you should have a strong understanding of the complete document life cycle from creation through archival and some good ideas for customizing the capabilities to meet your own needs.

Working with Content Types, Lists, and Libraries Several times throughout the book, I have mentioned and used site content types. In the previous chapter, for example, you used them extensively to create page layouts for a site. By now, you probably think of a content type as a reusable document definition; however, content types can also define list items and folders. Furthermore, content types can be based on other content types to form an inheritance tree, and when the parent is updated the changes can be pushed down to the child. As you learn more, you’ll see that a content type is a lot like a programming class that defines the information structure for a SharePoint site. Both WSS and MOSS ship with a base set of content types that are listed in the Content Types Gallery, which is accessible from the Site Settings page. As you might expect, however, MOSS has more defined content types than WSS. This is because many MOSS features, such as the publishing feature discussed in the previous chapter, require additional content types such as the Page Layout. Table 6-1 lists the base content types that are common to both WSS and MOSS, their parent content type, a description, and whether the content type is visible in the Content Types Gallery. Content types that are not visible are typically for system use only. Table 6-1. Base Content Types

Content Type

Parent Content Type

Description

Visible

System



The root of the content type tree

No

Item

System

Represents any item in a list or library

Yes

Document

Item

Represents any type of document

Yes

Form

Document

Represents an InfoPath form

No Continued

193

194

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Table 6-1. Continued

Content Type

Parent Content Type

Description

Visible

Picture

Document

Represents an image file

Yes

UntypedDocument

Document

Represents any generic file type

Yes

MasterPage

Document

Represents a master page

Yes

WikiDocument

Document

Represents a page in a wiki

Yes

BasicPage

Document

Represents a basic web page

Yes

WebPartPage

BasicPage

Represents a web part page

Yes

LinkToDocument

Document

Represents a link to a document in a different location

Yes

DublinCoreName

Document

Represents the Dublin Core metadata set, which is an open standard for metadata (see http://www.dublincore.org for more information)

Yes

Event

Item

Represents an event item in a list

Yes

Issues

Item

Represents an issue item in a list

Yes

Announcement

Item

Represents an announcement item in a list

Yes

Link

Item

Represents a link item in a list

Yes

Contact

Item

Represents a contact item in a list

Yes

Message

Item

Represents a message item in a list

Task

Item

Represents a task item in a list

Yes

WorkflowTask

Task

Represents a task assigned by a workflow process

No

AdminTask

Task

Represents an administrative task assigned to an administrator

No

WorkflowHistory

Item

Represents a historical entry recording a workflow milestone

No

BlogPost

Item

Represents a blog post

Yes

BlogComment

Item

Represents a blog comment

Yes

FarEastContact

Item

Represents a personal or business contact in the Far East

Yes

Folder

Item

Represents a folder in a list

Yes

RootOfList

Folder

Represents the root folder of a list

Yes

Discussion

Folder

Represents a topic in a discussion list

Yes

When starting any new SharePoint project, it is important to decide what new content types you must create in order to support your information structure. While all content types ultimately inherit from the System content type, typically your content types will inherit from one of the lower-level content types listed in Table 6-1. You might, for example, define content types for common documents such as expense reports or vacation requests and base them on the Document content type. Designing content types can be a significant effort because they can contain definitions for many different elements. Content types can contain defined metadata fields, document

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

templates, workflows, and custom Document Information Panels (DIP). I cover metadata and templates in this section. I cover workflows in Chapter 7 and custom DIPs in Chapter 9. Before you define any new content type, it is a good idea to determine all of the elements that it will contain; however, nothing stops you from updating a content type after it is defined. For this chapter, I’ll create a content type to represent a software specification document and then modify it to contain additional elements. Follow these steps to create a new content type: 1. Log in to the home page of the intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/default.aspx). 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 3. On the Site Settings page, select Site Content Types from under the Galleries section. 4. On the Site Content Type Gallery page, click the Create button. 5. On the New Site Content Type page, enter Software Specification in the Name field. 6. Select Document Content Types from the drop-down list labeled Select Parent Content Type From. 7. Select Dublin Core Columns from the drop-down list labeled Parent Content Type. This will give you a nice set of document-centric columns. 8. Under the Group section, select the New Group option and enter Custom Software Documents in the text field. 9. Click the OK button.

Understanding Site and List Columns The metadata for a content type can consist of either site columns or list columns. Site columns are reusable columns that are defined at the site level and may be used by any list in a child site. List columns are defined at the list level and may only be used by the list where they are defined. When you create a new content type, it will inherit the site and list column definitions from its parent. You can also add any of the previously defined site columns that are available. Finally, you can define your own new columns and add them to the content type. As you can see, it is important to determine what metadata fields you will need to properly support your information structure before you begin creating content types. When you create a new column, you assign it a name and select a data type. SharePoint offers you many different types, from simple text and lists to full HTML. Depending on the type, you may also have to specify additional information to complete the column definition. When you create new columns, they may also be grouped together under a custom heading so that they are easier to find later. As an example, I’ll create some site columns to use with the software specification document. Follow these steps to define the site columns: 1. Log in to the home page of the intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/default.aspx). 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu.

195

196

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

3. On the Site Settings page, select Site Columns from under the Galleries section. 4. On the Site Column Gallery page, click the Create link. 5. On the New Site Column page, enter Application in the Column Name field and leave the column type as Single Line of Text. 6. Under the group section, select the New Group option and enter Software Specification Columns in the text field. This new group will contain the new site columns and make them easier to find. 7. Select the option to require that the column contain information. 8. Click the OK button. 9. On the Site Column Gallery page, click the Create link. 10. On the New Site Column page, enter Developer in the Column Name field. 11. Select the Person or Group type for this column definition. 12. Select the option to put the site column into the existing Software Specification Columns group. 13. Click the OK button. 14. On the Site Column Gallery page, drop the Show Group list and select Software Specification Columns. You should only see your new columns now. 15. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 16. On the Site Settings page, select Site Content Types from under the Galleries section. 17. On the Site Content Type Gallery page, drop the Show Group list and select Custom Software Documents. 18. Click the Software Specification content type link. 19. On the Site Content Type page, click the link titled Add from Existing Site Columns. 20. On the Add Columns to Site Content Type page, select Software Specification Columns from the drop-down list labeled Select Columns From. 21. Select all of the available columns and click the Add button. 22. Click the OK button.

Working with Views Site and list columns play a critical role in SharePoint. Not only are they used to classify information, but they can also be used to create views that sort and filter lists. Additionally, they can be indexed to speed the display of lists within the browser. Creating a view of a list is done in this version of SharePoint in much the same way as in the previous version. The existing

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

views are listed on the Customize page, which is accessible from the list by selecting Settings ➤ List Settings from the toolbar. From the Customize page, you may choose to edit an existing view or create your own new view. When you create a new view, you may choose the Standard View, Datasheet View, Calendar View, Gantt View, or Access View. Creating a Standard View of a list results in a columnar display of the list that may be sorted, filtered, and grouped. Creating a Datasheet View of a list results in a tabular display that allows editing of all data in a single web page and includes a fly-out task pane that provides quick links to editing tools. Calendar Views require that one column in the list be a date/time dimension so that a calendar can be created using the list data. Gantt Views of a list create a Gantt chart view, but they require a list to have columns that can be mapped to Title, Start Date, and Due Date fields. An Access View is used to link a SharePoint list with a Microsoft Access 2007 database, which allows you to use Access to create reports and views.

Using List Data in Microsoft Access SharePoint lists can be used in Microsoft Access 2007 in two key ways: list data can be imported into Access databases or lists can be linked to an Access database. Selecting Actions ➤ Open with Access from the toolbar of a list opens a dialog that allows you to select whether to export or link the list data. Additionally, you can create a new Access database or select an existing one to use as the target for the data. Linking a SharePoint list to an Access database is similar to creating a new Access View for a list. The difference is that creating an Access View will automatically prompt you to create a new view for the list, whereas simply linking the list just creates a new database and you have to create any new views manually. In both cases, the term view really refers to either a form or a report created in the Access database. After you create forms and reports in the new database, you may publish the database to a SharePoint library so the forms and reports can be viewed by end users. This is accomplished by clicking the Publish to SharePoint Site button inside of Microsoft Access. Figure 6-1 shows the button as it appears in the Document Action Panel of Access.

Figure 6-1. Publishing an Access database to SharePoint

Once published, users can open the Access database directly from the document library. Once opened, they may use the forms and reports as they would for any Access application. They may even take the entire database offline and synchronize their changes later. Figure 6-2 shows the SharePoint Lists group and the Work Offline button.

197

198

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Figure 6-2. Working offline with Microsoft Access

Using List Data in Microsoft Excel SharePoint lists are used in Excel spreadsheets by exporting the list. Selecting Actions ➤ Export to Spreadsheet creates a new workbook with a data connection to the list. Once the workbook is created, you are free to edit the data in the spreadsheet and save it anywhere you like. You should note, however, that the data connection operates in only one direction. This means that you can refresh your workbook data from the list by clicking the Refresh button in the Workbook Connections dialog. However, you cannot push the changes you made in the spreadsheet back to the SharePoint list. While this was possible under Excel 2003 and SharePoint 2003, it is not possible in the 2007 versions. This behavior is potentially dangerous because changes made to the spreadsheet data manually can easily be overwritten by refreshing the data connection. To avoid this, you may want to remove the data connection from the workbook.

Using New Content Types All document libraries and lists in SharePoint utilize content types. The content types help determine the columns that appear in the library, the types of new items you can create in a list, and the workflows associated with the list. When you are creating a list or a library, however, you are not given the opportunity to associate content types with it. Instead, you are either given a default content type (for lists) or asked to select a document template (for libraries). In order to change the content types associated with a list or a library, you must explicitly enable management of content types. Enabling content type management for any list or library is done from the Customize page. On the Customize page, click the Advanced Settings link where you can select the option to allow management of content types. Figure 6-3 shows the option.

Figure 6-3. Enabling content type management

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Once you enable content type management, you can add new content types to the list. When a new content type is added to the list, all of the columns defined in the content type are copied to the list. Note that lists and libraries never use site columns directly. Instead, the site columns associated with the content type are copied as list columns. Any changes made to a list column will not be reflected upward into the site column. In fact, you can never push changes up from any child content type or column to a parent. However, you can push changes down. Whenever you make a change to a site content type or site column, you can select an option to update all of the associated children. Adding content types to a list or a library is also done through the Customize page. Once content type management is enabled, you will see the default content type on this page. For document libraries, it will be the Document content type. For other lists, it will be the content type for the default list item such as Event or Task. On this page, you can add new content types from the gallery and change the order in which they appear on the New button in the list toolbar. Follow these steps to add a content type: 1. On the Customize page, click the link titled Add from Existing Site Content Types. 2. On the Add Content Types page, select Custom Software Documents from the dropdown list labeled Select Site Content Types From. 3. In the Available Site Content Types list, select Software Specification and click the Add button. 4. Click the OK button. Figure 6-4 shows the Customize page with the Software Specification content type added to a library.

Figure 6-4. Adding a new content type

Once you add a content type to a library, you will be able to make new documents based on that type. Therefore, you’ll want to define a document template that users will see when they create a new document of that type. Adding a document template to the content type is done by accessing the content type through the Content Types Gallery. When you are viewing the content type definition, click the Advanced Settings link and you will be able to upload a new document template to associate with the content type. Figure 6-5 shows the upload function.

Figure 6-5. Uploading a document template

199

200

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Configuring Document Library Enhancements Document libraries in SharePoint 2007 have some nice improvements over earlier versions. Some of these improvements, such as the recycle bin, I have mentioned previously. In this section, I review the new capabilities in more detail. These capabilities include new versioning settings, document policy settings, the recycle bin, item-level security, and item-level audience targeting.

Configuring Versioning Settings As with any document management system, you would expect SharePoint libraries to have check-in, checkout, and version control capabilities. In this version, however, these capabilities are improved. From the Customize page, you can configure these functions by clicking the Versioning Settings link. On the Versioning Settings page, you can turn on versioning for a list or a library. You can also specify whether to version only major versions or both major and minor versions. Creating minor versions allows you to have draft versions that are only visible to selected individuals. These options give you a rudimentary process for creating, reviewing, and approving documents without the use of a workflow. Figure 6-6 shows the versioning settings.

Figure 6-6. Versioning settings

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Configuring Policy Settings Document policies allow you to configure document labels, auditing, expiration dates, and bar codes for each content type used by the library. Document labels define text that will appear when the document is printed to help track its source and key information. Auditing allows you to track key documents events and changes along with the identity of the person who initiated the event. Expiration dates allow you to delete a document or initiate a workflow after a given period of time. Bar codes allow you to generate a bar code for the document for tracking. Take these steps to configure policies: 1. Browse to any document library you have created. 2. On the toolbar, select Settings ➤ Document Library Settings. 3. On the Customize page, click the link titled Information Management Policy Settings. 4. On the Information Policy Settings page, click the content type to manage. 5. Select the option to Define a Policy and click the OK button. 6. In the Administrative Description field, type A test of all policies. 7. In the Policy Statement field, type Important document must be tracked and preserved. 8. Check the Enable Labels box. 9. Check the box labeled Prompt Users to Insert a Label Before Saving or Printing. 10. In the Label Format field, enter {Title} is Important to label the document with its title and a message. 11. Check the Enable Auditing box. 12. Check all of the available auditing options. 13. Check the Enable Expiration box. 14. Enter 5 years in the time period field to set an expiration period. 15. Select the option to Perform This Action and select Delete from the drop-down list. 16. Check the Enable Bar Codes option. 17. Check the box labeled Prompt Users to Insert a Bar Code Before Saving or Printing. 18. Click the OK button. Now you can return to the document library and create a new document. Enter some text in the document and then save it. When you try to save it, you should be prompted to add a label to the document and a bar code. Additionally, you should see the policy statement appear within Word to let you know that policies have been defined for the document. Your policy should also be auditing your actions as you work with the document, and you can run a report.

201

202

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Follow these steps to run an audit report: 1. Go to the Site Settings page for the top-level site in the collection. 2. Click the Audit Log Reports link. 3. On the View Auditing Reports page, click the Content Modifications link. 4. In the File Download dialog, click the Open button. A new report should be generated for you in Excel.

Managing the Recycle Bin Adding a recycle bin for SharePoint libraries was perhaps the most requested enhancement from the previous version. That’s because there was no simple way to recover a deleted file in the previous version of SharePoint. Instead, administrators would have to completely recover a site from backup and retrieve the lost file by hand. With the recycle bin, users can recover their own files. The recycle bin is actually a two-stage bin. This means that even if a user deletes the file from the library and the recycle bin, it will still be available in an administrator recycle bin. The end user recycle bin is located at the site level. The administrator’s recycle bin is at the site collection level. At this level, administrators have a special view that shows the items that were deleted from other bins. Administrators can set the time that a deleted file will remain in the recycle bin and the storage quota of the second stage bin so that old files do not take up space unnecessarily. This allows you to set a policy for users that deleted files can’t be recovered after a given period. Follow these steps to configure the recycle bin: 1. Log in to the Central Administration web site. 2. Click the Application Management tab. 3. Under the SharePoint Web Application Management section, click the link titled Web Application General Settings. 4. On the Web Application General Settings page, set the time period for automatic deletion of items in the recycle bin and the quota for the second-stage bin. 5. Click the OK button.

Managing Item-Level Security and Audiences Along with the recycle bin, item-level security was another high-priority request from SharePoint users. In the previous version of SharePoint, security could only be set at the library level. In this version, you may use the drop-down menu for an item and select Manage Permissions to set the security just for that item. Along with permissions, you can also manage the visibility of an item through audiences. In order to associate a document with an audience, you must first enable audiences for the library as a whole, which is done from the Customize page by clicking the Audience Targeting Settings link. Once audiences are enabled for the library, each individual item will have a Target Audiences property that you can set.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Configuring Column Indexing Indexing a column is intended to improve the performance when displaying a view. You can index any column in the list directly from the Customize page by clicking the Indexed Column link. However, you should note that indexing a column will not remove the soft 2,000-item limit for a view. Indexing only increases the speed at which those items are displayed. Therefore, while a list or library may contain a virtually unlimited number of items, you should only create views that return 2,000 items or less.

■Note Quite often a large part of a SharePoint 2007 project involves the migration of documents and content from previous versions of SharePoint or other document management systems such as Documentum and Livelink. Moving tens or hundreds of thousands of documents into SharePoint is impossible without some kind of automated tool set. My favorite tool for this job is the Tzunami Deployer. For more information, visit http://www.tzunami.com.

Working with InfoPath and Form Libraries In Chapter 3, I introduced you to the concept of a form library. Form libraries are special libraries designed to store Microsoft InfoPath forms. These forms can be used for any business function that is forms-based, from reserving a conference room to requesting travel. InfoPath 2007 has several improvements that make it an even better fit with this version of SharePoint. These enhancements include support for template parts that let you create reusable sections, template importing for converting Word and Excel documents into forms, and a managed code development environment. Additionally, if you deploy MOSS, you no longer need Microsoft InfoPath on your desktop because MOSS contains a forms server for delivering highly functional InfoPath forms as HTML. Because there is a lot to cover in this section, I will assume that you already have some familiarity with InfoPath so that I can focus just on new capabilities. However, I have included Exercise 6.1 at the end of the chapter so you can see in detail how an InfoPath application works within SharePoint.

Creating Template Parts Creating a template part is a new capability of InfoPath 2007 that lets you build reusable sections for forms. With this capability, you can create a library of template parts for use in form design. This makes it easier to create new forms using the template parts as a starting point. As a best practice, you should start by creating a content type to represent template parts within SharePoint. After you create a content type, you can create a library to store them. Follow these steps to create a content type: 1. Log in to VSCLIENT as a SharePoint administrator. 2. Log in to the home page of the intranet site you created in Chapter 2 (e.g., http:// vsmoss/sites/intranet/Pages/default.aspx). 3. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu.

203

204

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

4. On the Site Settings page, select Site Content Types from under the Galleries section. 5. On the Site Content Type Gallery page, click the Create button. 6. On the New Site Content Type page, enter Template Part in the Name field. 7. Select Document Content Types from the drop-down list labeled Select Parent Content Type From. 8. Select Form from the drop-down list labeled Parent Content Type. 9. Under the Group section, select the Existing Group option and select Document Content Types. 10. Click the OK button. 11. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office InfoPath 2007. 12. In the Getting Started dialog, click Design a Form Template. 13. In the Design a Form Template dialog, select the Template Part option. 14. Select Blank from the List View labeled Based On. 15. Click the OK button. 16. Select File ➤ Save from the main menu. 17. Save the blank template part to your desktop as BlankPart.xtp. You are going to use this as the template for the content type you created earlier. 18. Return to the home page of the intranet site. 19. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 20. On the Site Settings page, select Site Content Types from under the Galleries section. 21. Click the link for the Template Part content type. 22. On the Site Content Type page, click the Advanced Settings link. 23. On the Advanced Settings page, select the option to Upload a New Document Template. 24. Click the Browse button. 25. In the Choose File dialog, select the BlankPart.xtp file and click the Open button. 26. On the Site Content Type page, click the OK button. Once you have created a new content type with a blank template part, you can use it in a library. Creating a template parts library is a good idea because it allows template parts to be accessed by form designers throughout the enterprise. This approach saves a lot of time and ensures consistency across all forms.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Follow these steps to create a template parts library: 1. Click the Document Center tab. 2. Click the link titled View All Site Content in the Quick Launch area of the Document Center. 3. On the All Site Content page, click the Create link. 4. On the Create page, click the Form Library link. 5. On the New page, type Template Parts in the Name field. 6. Click the Create button. 7. In the Template Parts library, select Settings ➤ Form Library Settings from the toolbar. 8. On the Customize page, click the Advanced Settings link. 9. On the Form Library Advanced Settings page, select the Yes option to allow management of content types. 10. Click the OK button. 11. On the Customize page, click the link titled Add From Existing Content Types. 12. On the Add Content Types page, select the Template Part content type from the list labeled Available Site Content Types and click the Add button. 13. Click the OK button. After you have created a library to store template parts, you can create new template parts from Microsoft InfoPath. Using this approach, you can build up a library of reusable parts. As an example, I’ll build a reusable part that contains basic customer information. Follow these steps to create a template part: 1. Log in to VSCLIENT. 2. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office InfoPath 2007. 3. In the Getting Started dialog, click Design a Form Template. 4. In the Design a Form Template dialog, select the Template Part option. 5. Select Blank from the List View labeled Based On. 6. Click the OK button. 7. In the Design Tasks pane, click the Layout link. 8. Drag the Table with Title layout from the Layout Pane to the form surface. 9. Click in the cell labeled Click to Add a Title and enter Customer Information. 10. Click in the cell labeled Click to add Form Content. 11. Select Table ➤ Insert ➤ Layout Table from the menu.

205

206

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

12. In the Insert Table dialog, set the number of columns to 2 and the number of rows to 3. 13. Click the OK button. 14. In the Layout pane, click the Design Tasks link. 15. In the Design Tasks pane, click the Controls link. 16. Drag Text Box controls to each of the three cells in the right-hand column of the layout table. 17. In the left-hand column, type Name in the first row. 18. Type Address in the second row. 19. Type City, State, Zip in the third row. 20. Select File ➤ Save from the main menu. 21. In the Save As dialog, enter CustomerInformation.xtp and save it to the Template Parts library you created earlier. 22. Select File ➤ Design a Form Template from the main menu to start designing a new form. 23. In the Design a Form Template dialog, select blank from the List View labeled Based On and click the OK button. 24. In the Design Tasks pane, click the Controls link. 25. In the Controls Pane, click the link titled Add or Remove Custom Controls. 26. In the Add or Remove Custom Controls dialog, click the Add button. 27. In the Add Custom Control Wizard, select Template Part and click the Next button. 28. On the next screen, click the Browse button. 29. In the Browse dialog, browse to the Template Parts library you created earlier. 30. Select the CustomerInformation Template Part and click the Open button. 31. In the Add Custom Control Wizard, click the Finish button. 32. When the template part is added, close the wizard. 33. In the Add or Remove Custom Controls dialog, click the OK button to close it. 34. Locate the CustomerInformation Template Part in the Controls Pane and drag it onto the new blank form. Figure 6-7 shows the final template part.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Figure 6-7. Creating a template part

While creating template parts is a good way to build up a library of components for form development, they do have limitations. Template parts do not have all of the functionality of an InfoPath form, and that can be a bit frustrating. For example, you can’t write any script or managed code behind a template part. The following is a complete list of functionality not available to template parts: • Template parts cannot use ActiveX controls. • Template parts cannot use background images. • Template parts cannot use color schemes. • Template parts cannot use data connections for submitting data, but receiving data is supported. • Template parts cannot use Information Rights Management (IRM) restrictions. • Template parts cannot use script and managed code. I cover managed code development later in this section. • Template parts cannot be published. • Template parts cannot be exported. • Template parts cannot have multiple views, read-only views, default views, or print views. • Template parts cannot have digital signatures, custom task panes, security levels, or custom save/open behaviors.

Importing Word and Excel Documents Many organizations have moved away from paper-based forms and made a significant investment in electronic forms. These electronic forms may be Word documents, Excel spreadsheets, Adobe forms, or other formats. Because of this investment, it has not been a simple matter for them to implement InfoPath forms. InfoPath 2007, however, includes a template import feature specifically designed to migrate electronic forms to InfoPath.

207

208

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Out of the box, InfoPath 2007’s import feature can handle Word and Excel forms. For other form types, InfoPath provides a set of interfaces for creating your own importer. Creating your own importer is beyond the scope of this book; interested readers should check out the InfoPath 2007 SDK. Follow these steps to import a Word document: 1. Log in to VSCLIENT. 2. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office Word 2007. 3. Click the Office Button in the upper left-hand corner of Word and select New from the menu. 4. In the New Document dialog, select Forms from the Templates list under the Microsoft Office Online category. 5. When the forms categories appear, click Business. 6. Select any of the available business forms. I selected Petty Cash Reimbursement Request. 7. Click the Download button. 8. When the new form appears, click the disk icon on the top toolbar in Word to save the file. 9. In the Save As dialog, navigate to your desktop. 10. Enter FormTemplate.docx in the File Name field and click the Save button. 11. If Word displays a compatibility warning regarding the new file format, simply click the OK button. I cover the new Office file formats in detail in Chapter 9. 12. Exit Word. 13. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office InfoPath 2007. 14. In the Getting Started dialog, click the link titled Import a Form. 15. In the Import Wizard, select InfoPath Importer for Word Documents and click the Next button. 16. On the next screen, click the Browse button. 17. In the Import form dialog, navigate to your desktop. 18. Select the FormTemplate.docx file and click the Open button. 19. In the Import Wizard, click the Finish button. After the form is imported, the Import Wizard will notify you if there were any issues converting the form. When it discovers issues, the wizard will refer you to the Design Checker to investigate the issues. The Design Checker is a new feature of InfoPath 2007 that assists you in not only importing forms but also making forms that are compatible for different deployment scenarios. I discuss using the Design Checker for deployment scenarios a little later in this section, but for now you can review any issues with the import using the

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Design Checker, which will appear after you close the Import Wizard. Figure 6-8 shows the Design Checker in my environment after the import.

Figure 6-8. The Design Checker

Using Data Connection Libraries InfoPath forms often use data connections to databases, web services, and other sources to retrieve information such as lookup lists. In the past, these connections were always defined as part of the InfoPath form. In InfoPath 2007, however, you can use a SharePoint data connection library to store connection information that may be used across the entire organization. These are the same data connection libraries that I discuss in Chapter 4 in relation to Excel Services, except the file format is different. Excel Services utilizes Office Data Connection (ODC) files, whereas InfoPath utilizes Universal Data Connection (UDC) files. Selecting Tools ➤ Data Connections brings up the Data Connections dialog. This dialog lists all the available data connections you can use. To add a new one, simply click the Add button to start the data connection wizard. Using this wizard, you create, receive, and submit connections within the form. After they are created, you can then convert these connections into UDC files for future use. If you created the data connection library in Chapter 4, you can follow these steps to create a UDC file in InfoPath: 1. Log in to VSCLIENT. 2. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft InfoPath 2007. 3. In the Getting Started dialog, click the Design a Form Template link.

209

210

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

4. In the Design a Form template dialog, select the Blank form and click the OK button. 5. Select Tools ➤ Data Connections from the main menu. 6. In the Data Connections dialog, click the Add button. 7. In the data connection wizard, select to Create a New Connection to Receive Data and click the Next button. 8. On the next screen, select to Receive Data from a SharePoint Library or List and click the Next button. 9. On the next screen, enter the address for your Document Center (e.g., http://vsmoss/ sites/intranet/docs) and click the Next button. 10. On the next screen, select the Documents library and click the Next button. 11. On the next screen, select just the Title field and click the Next button. 12. On the next screen, click the Next button. 13. On the last screen, click the Finish button. 14. In the Data Connections dialog, click the Convert button to convert the data connection to a UDC file. 15. In the Convert Data Connections dialog, click the Browse button. 16. In the Browse dialog, navigate to the data connection library you created in Chapter 4 (e.g., http://vsmoss/sites/intranet/docs/Data%20Connections) and click the Save button. 17. In the Convert Data Connections dialog, click the OK button. 18. In the Data Connections dialog, click the Close button. The new UDC file is now saved to the data connection library.

Developing with Visual Studio Tools for Applications Over the past nine years or so, Microsoft has supported Office developers with a built-in development environment known as Visual Basic for Applications (VBA). VBA was intended to be a simplified development environment for creating macro functionality within Office products. Typically, developers would detect events such as document creation and then exercise the Word or Excel object model to provide customized functionality such as data imports. While VBA applications worked fine for a number of applications, VBA was created when the component object model (COM) standard was the prevailing technology for Microsoft development. As we all know COM has been steadily replaced by the .NET standard for development, but Microsoft Office continues to lag behind. Unfortunately for Word and Excel, this will remain the case in Office 2007; however, InfoPath has a new development environment known as Visual Studio Tools for Applications (VSTA) that finally brings managed code development to the Office suite.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

■Note For those familiar with managed code development in Office using Visual Studio Tools for Office (VSTO), VSTA is not a replacement. VSTA is really intended to become the next generation of macro development environments within Office products. I cover VSTO development in Chapter 9. (As an interesting sidebar, how exactly do you pronounce VSTA? It can’t possibly be “Vista”!)

VSTA is not installed by default when you install Microsoft Office 2007; it is an advanced installation option. To install VSTA, launch the Office 2007 installation disk and select to Add or Remove Features. You’ll then be able to locate the VSTA installation under the Microsoft InfoPath options. Figure 6-9 shows the VSTA installation location.

Figure 6-9. Installing VSTA

Once you have VSTA installed, you’ll want to set your programming language in InfoPath to use C#. This is done by selecting Tools ➤ Options from the main menu. In the Options dialog, click the Design tab. On this tab, you will see language selection lists. Once the language is set, you can access the programming environment by selecting Tools ➤ Programming ➤ Microsoft Visual Studio Tools for Applications. Additionally, the Programming menu lists several key event handlers that you can add for the form or any control just by selecting them. Simply select the form or control in the designer and then choose the event you want to add from the Programming menu. This gives you a simple mechanism for generating the correct function signatures. Writing VSTA code in InfoPath is a familiar experience for anyone who has used Visual Studio before. You can set references to .NET assemblies and utilize any of the classes

211

212

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

contained in the .NET Framework. However, there are a couple of areas where development is unique to InfoPath. These areas concern accessing elements in the InfoPath form and managing trust levels.

Accessing Form Elements Whenever you write VSTA code, you will almost always want to manipulate the field values in the form. Field values are accessed through the XPathNavigator class, which is used to reference the form’s data source. The following code shows how to reference the form’s data with the XPathNavigator class: XPathNavigator data = this.MainDataSource.CreateNavigator(); Once you have a reference to the form’s data source, you can use XPath to access any individual element on the form. This is accomplished by using the SelectSingleNode method of the XPathNavigator. The SelectSingleNode method takes as an argument the XPath that references the target element. Figuring out the correct XPath string necessary to access a given element can be tricky. Fortunately, you can retrieve the XPath for an element directly from the Data Source pane in InfoPath. Figure 6-10 shows the Copy XPath menu item in the Data Source pane.

Figure 6-10. Retrieving the XPath for an element

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Once you have the XPath for a target element, you can paste it in to the code and use it to retrieve the target element as an XPathNavigator object. Using this object, you can read the element through the Value property or set its value through the SetValue method. Listing 6-1 shows a simple example of setting the username element in a form to the username of the person filling out the form.

■Note Accessing the WindowsIdentity object requires that the InfoPath form operate with full trust. I discuss managing trust in the next section.

Listing 6-1. Setting Element Values in VSTA using using using using using

Microsoft.Office.InfoPath; System; System.Xml; System.Xml.XPath; System.Security.Principal;

namespace Travel { public partial class FormCode { public void InternalStartup() { EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading); } public void FormEvents_Loading(object sender, LoadingEventArgs e) { //Get a reference to the User Name element XPathNavigator data = this.MainDataSource.CreateNavigator(); XPathNavigator element = data.SelectSingleNode( "/my:travelRequest/my:username", this.NamespaceManager); //Show user name WindowsIdentity identity = WindowsIdentity.GetCurrent(); element.SetValue(identity.Name); } } }

213

214

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

■Tip While the previous code is a simple example to use here, InfoPath 2007 now has a new userName() function to retrieve the current username.

The best thing about VSTA is that all of the code is part of the InfoPath form. This means that you do not have to deal with separate assemblies that must be distributed to clients. You also do not have to configure client-side code access security (CAS) settings as was necessary in previous versions of InfoPath. You do, however, have to manage the trust level of the form.

Managing Form Trust InfoPath forms can operate at three different trust levels: Restricted, Domain, and Full Trust. Restricted forms are not allowed to access any data that resides outside the form itself. Domain forms can access data that comes from within the same domain as the form. Full Trust forms have no restrictions on the operations that they can perform. By default, InfoPath is set to automatically select the appropriate security level for your forms. This typically means that forms operate with Domain trust. Domain trust is appropriate for most of the operations you will perform in a form. Some forms, however, may need an increased trust level to function correctly. Such is the case for the code in Listing 6-1, which tries to use the WindowsIdentity class to access information about the current user. If you want the form to operate with a different trust level, you must set it manually. You can change the trust level of a form by selecting Tools ➤ Form Options from the main menu. This will open the Form Options dialog. Selecting Security and Trust from the category list displays the Security Level information shown in Figure 6-11. In order to change the form’s trust level, you must not only select the Full Trust security level, but you must also sign the form template with a digital certificate. If you have an appropriate digital certificate available, you simply check the box labeled Sign This Form Template, click the Select Certificate button, and pick a certificate. If you do not have a certificate available, you can make one by clicking the Create Certificate button. If you deploy a form that performs operations that require full trust and you do not properly modify the form’s trust level, you will receive typical security error messages from the .NET Framework. If, on the other hand, you sign the form with a certificate you created yourself, the end user will receive a message indicating that the certificate is not from a trusted source. In this case, the user can choose to trust the form, but you had better make this clear to end users before they receive the message shown in Figure 6-12. After you finish creating your forms, you will want to publish them using the Publishing Wizard so they can be used by others. In Chapter 3, I showed you how to create a form library in SharePoint and publish a form to it. Beyond simply publishing a form, however, you can also use the Publishing Wizard to deploy your form and associate it with a new content type. You can then use the content type in multiple libraries throughout a site.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Figure 6-11. Accessing security information

Figure 6-12. InfoPath security warning

Follow these steps to create a new content type: 1. Log in to VSCLIENT as a SharePoint administrator. 2. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office InfoPath 2007. 3. In the Getting Started dialog, double-click Sample – Expense Report. 4. In the Design Tasks pane, click the link titled Publish Form Template. 5. In the Save As dialog, select an appropriate place to save the form and click the Save button.

215

216

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

6. In the Publishing Wizard, select to publish the form to a SharePoint server and click the Next button. 7. In the next screen, enter the address of the SharePoint server, http://vsmoss, and click the Next button. 8. In the next screen, uncheck the box labeled Enabled This Form to Be Filled Out by Using a Browser. 9. Select the option labeled Site Content Type and click the Next button. 10. On the Next screen, select Create a New Content Type and click the Next button. 11. On the next screen, name the new content type Expense Report and click the Next button. 12. On the next screen, click the Browse button. 13. In the Browse dialog, locate the Form Server Templates folder at http://vsmoss. This is a special folder for storing form templates. I discuss it in more detail later in this section. 14. Name the new form ExpenseReport.xsn and click the Save button. 15. In the wizard, click the Next button. 16. On the next screen, click the Next button. 17. On the next screen, click the Publish button.

Understanding InfoPath Forms Services While InfoPath is a good tool for creating forms, almost the instant it was released, customers began to request a way to fill out forms without having the InfoPath client installed. There are many scenarios, such as personnel on the road, or clients without access to InfoPath, where a zero-footprint form is useful. Microsoft’s response to this need was to create InfoPath Forms Services. InfoPath Forms Services allows you to take InfoPath forms and render them as HTML in a browser. InfoPath Forms Services is technically a separate product from SharePoint, however, MOSS ships with it. The server is set up automatically for you during the MOSS installation process. Before you can begin using forms in the browser, you must make sure that InfoPath Forms Services is enabled at the farm and site level. You can access the configuration settings for InfoPath Forms Services from the Central Administration site. On the Application tab, you will find a section dedicated to InfoPath Forms Services. Here you can click the link titled Configure InfoPath Forms Services. This link will open a configuration page where you can enable services for the farm. After you have enabled services for the farm, you must activate the Office SharePoint Server Enterprise Site Collection Features for each site collection where you want to use InfoPath Forms Services. Additionally, you must activate the Office SharePoint Server Enterprise Site Features for each site where you want to use InfoPath Forms Services. Note that

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

there are features at both the site collection and the site level that must be activated for InfoPath Forms Services to work correctly.

Designing for InfoPath Forms Services Most of what you know about creating forms in InfoPath also applies to forms that target InfoPath Forms Services. However, there are many InfoPath features that can’t be duplicated in a browser, such as master-detail views. Therefore, when you create a form for use with InfoPath Forms Services, it will always be limited to a subset of features that are available to InfoPath as a whole. As of this writing there is not a definitive list of lost InfoPath functionality; however, you can use the Design Checker to help ensure compatibility. The Design Checker is available as a link in the Design Tasks pane in InfoPath. Clicking this link opens the Design Checker task pane, which shows errors and messages for the current form. Before you can get any meaningful information, however, you must change the compatibility settings for the form to indicate that you are targeting InfoPath Forms Services. Clicking the link titled Change Compatibility Settings opens the Form Options dialog where you can check a box to indicate the form should be browser-enabled. You should also provide the path to VSMOSS so that InfoPath Forms Services can verify compatibility. Figure 6-13 shows the browser compatibility options.

Figure 6-13. Changing browser compatibility

Once you have changed the compatibility settings, the Design Checker will begin to display errors and messages regarding your form. Each error or message will show not only in the Design Checker task pane, but also in the form or dialog box where the issue can be addressed.

217

218

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Furthermore, the Design Checker provides hyperlinks that will take you to each issue so that you can fix them. Figure 6-14 shows the Design Checker with an error message in the task pane and the same error flagged on the form.

Figure 6-14. The Design Checker

After you have created a browser-compatible form, you will be able to publish the form to a form library in SharePoint. Here again, you can publish the form directly to a library or as a content type. If you publish the form directly to a library, it will be available immediately. If you publish the form as a content type, you’ll need to create a library and associate the content type with the library so it can be used. After you have created a form library with your new form available, you can create a new form using the toolbar and fill it out. However, you’ll notice that the form does not initially open in the browser as you would expect. This is because the library has an option you can set to specify the preferred client for the form. The default is to always open the form in InfoPath if it is available. This setting is accessible from the Customize page for the form library by clicking the Advanced Settings link. On the Advanced Settings page, you can change the Browser-Enabled Documents setting for the library to always display the document as a web page. Because the setting never mentions forms, it’s easy to miss. Figure 6-15 shows the correct configuration to display forms in the browser by default.

Figure 6-15. Displaying forms in the browser by default

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Deploying Centrally Managed Forms When forms require full trust, they may not be published directly from InfoPath to a form library. Instead, fully trusted forms must first be uploaded into a central management store where they can be reviewed by a SharePoint farm administrator. Once reviewed, these forms are deployed from a central store to selected web applications where they can be made available to libraries or act as templates for content types. In order to deploy a fully trusted form, you must first use the Publishing Wizard to prepare the form. As part of preparing the form, InfoPath publishes it to a network location of your choosing so that it can be accessed by the SharePoint administrator. Figure 6-16 shows the Publishing Wizard set to prepare a form for administrator approval.

Figure 6-16. Preparing a fully trusted form for approval

Once the form is prepared, it may be uploaded to the central repository. This is accomplished through the Central Administration web site. On the Application Management tab, under the InfoPath Forms Services section, click the link titled Manage Form Templates. This will display the forms stored in the central repository and allow you to upload new forms. During the upload process, you can even have the form validated for errors before it is added to the repository. After the form is added to the central repository, you may use the drop-down menu associated with the form to make it available to a site collection on the farm. Selecting Activate to a Site Collection from the menu will bring up a page where you can select the site collection where the form will be deployed. Clicking the OK button deploys the form into a library named FormServer Templates. This library is not visible from within SharePoint, but you can see it if you open the site in the SharePoint Designer. The point, however, is that once it’s deployed, you can reference it as a template for a content type within the site collection.

219

220

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Using the Document Conversions Service The Document Conversions Service in MOSS allows you to convert between different types of documents within a library. For example, you can easily convert from a Word document to a web page using the out-of-the-box capabilities. Initially, this service is disabled on the farm because it is potentially an expensive operation, depending upon what documents are being converted. Therefore, you’ll have to do a little configuration to get it running. Follow these steps to configure the Document Conversions Service: 1. Log in to the Central Administration site as a farm administrator. 2. In the Central Administration site, click the Operations tab. 3. On the Operations tab, click the link titled Services on Server under the Topology and Services section. 4. On the Services on Server page, click the Start link next to the Document Conversions Load Balancer Service. 5. On the Services on Server page, click the Start link next to the Document Conversions Launcher Service. 6. On the Launcher Service Settings page, select the Load Balancer server as VSMOSS. 7. Click the OK button. 8. Click the Application Management tab. 9. Click the link titled Document Conversions under the External Service Connections section. 10. On the Configure Document Conversions page, make sure that the web application reflects the intranet site collection you created in Chapter 2. If not, use the drop-down menu to change the web application. 11. Select the Yes option under Enable Document Conversion for This Site. 12. Note the available document conversions that ship with MOSS are listed on the page, then click the OK button. Once the Document Conversions Service is up and running, it’s a simple matter to convert documents. Navigate to any document library you created earlier in the book that contains Word documents. You should now find that a conversion option is available from the drop-down menu associated with the document. When you select this menu item, you will be taken to a page where you can specify the name for the converted file, where it will be located, and who to notify. It’s important to note that the target site must have the publishing feature I discuss in Chapter 5 activated in order to receive the new document. Figure 6-17 shows the new menu item for converting a Word document.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Figure 6-17. Converting a document

Understanding Records Management The records management capabilities in MOSS allow you to create a repository to retain business documents that are necessary for regulatory compliance, business continuity, or historical interest. You can associate a records repository with a web application so that documents may be moved into the repository either manually or automatically as part of a workflow process. Access to the records repository may be closely controlled to ensure that key records are not altered or deleted. Additionally, you may establish policies for the records that ensure they are retained for a defined period of time. You begin the process of creating a repository by creating a new site collection based on the Records Center template. After the repository is created, you can configure a connection between it and any web application through the Central Administration site. On the Application Management tab, click the Records Center link under the External Service Connection section. This link will open a configuration page where you can define the connection. The repository will utilize the OfficialFile web service to copy documents from production libraries to the Records Center. Therefore, the connection entry must properly reference the web service for the system to work. Generally, you need to provide the address of the root of the Records Center followed by the reference to the web service. An example is displayed on the configuration page to help you out, and Exercise 6.2 at the end of this chapter is a complete walk-through using the Records Center template. Once the connection is properly configured, you should see a new menu item associated with documents in libraries that allows you to send them to the repository. When the repository site is created, it has a single document library named Unclassified Records and two lists named Record Routing and Holds. If you send a document to the repository at this point, the record will always end up in the Unclassified Records library. If you want to sort the records into different libraries, you must add additional libraries to the site and

221

222

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

make appropriate entries in the Record Routing list. The Record Routing list contains entries that map content types to libraries. The Location field references the name of the target library in the repository and the Aliases field contains a delimited set of content type names. Figure 6-18 shows a sample New Item screen for the Record Routing list in the Records Center. This entry maps the content types Expenses, Proposals, and Forecasts to the Sales Records library in the Records Center. You will use this screen in detail in Exercise 6.2 at the end of this chapter.

Figure 6-18. Routing records in the Records Center

The Holds list is used to place records on hold so that they cannot be deleted or changed. In order to place a record on hold, you must first add a hold to the Holds list. The hold can be named anything such as “Discovery” or “Audit.” Once they are created, you can then place a record on hold by selecting Manage Holds from the drop-down menu associated with the record. If anyone tries to delete or change the record while it’s on hold, they will receive an error message.

Exercise 6.1. InfoPath and SharePoint While InfoPath is technically a separate product from SharePoint, it plays a critical supporting role. Many of the pages you see in SharePoint—such as content type metadata—are actually InfoPath forms hosted by SharePoint. Furthermore, InfoPath forms can be used to create complete applications that run within SharePoint. In this exercise, you will create an InfoPath application for submitting and tracking customer issues.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Prerequisites Before you begin this exercise, you should have read through the InfoPath information in this chapter. Additionally, you should have created the Template Parts library from the “Creating Template Parts” section earlier in this chapter and built the sample template part for entering customer information. This exercise will make use of this template part to create a form for customer issues.

Creating a Customer Issues Site For this exercise, you will create a new site for tracking customer issues. This site will have a form library that will contain the form for tracking issues. Therefore, you’ll need to create this site before building the form. Follow these steps to create the new site: 1. Log in to VSMOSS as a SharePoint administrator. 2. Open the home page of the intranet site you created in Chapter 2 (e.g., http://vsmoss/ sites/intranet/Pages/Default.aspx). 3. Click the Sites tab to open the Site Directory. 4. In the Site Directory, click the Create Site link. 5. On the New SharePoint Site page, enter Customer Issues in the Title field. 6. Enter CustomerIssues in the URL Name field. 7. Select Blank Site from the template list. 8. Click the Create button. The form that you’ll create will contain a list that will allow you to categorize the customer issue. This list will be maintained in the SharePoint site so that it can be edited when necessary. You will subsequently utilize the list in your form by using a data connection. Follow these steps to create the new list: 1. In the Customer Issues site, click the Lists link in the Quick Launch area. 2. On the All Site Content page, click the Create link. 3. On the Create page, click Custom List. 4. On the New page, enter Issue Categories in the Name field. 5. Click the Create button. 6. On the Issue Categories page, click the New button. 7. On the New Item page, enter Product Defect in the Title field and click the OK button. 8. Repeat steps 6 and 7 to add the following categories to the list: Missing Parts, Wrong Item, and Damaged Item.

223

224

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Creating the Customer Issues Form The Customer Issues form will utilize several of the new features of InfoPath and SharePoint. You will use template parts to help create the form, the Issue Categories list as a data source, a form library for saving the forms, and a simple workflow to route the issue for review. Once the forms are saved, you’ll use library views to analyze the data. Follow these steps to create the InfoPath form: 1. Log in to VSCLIENT as a SharePoint administrator. 2. Select Start ➤ All Programs ➤ Microsoft Office ➤ Microsoft Office InfoPath. 3. In the Getting Started dialog, click the link titled Design a Form Template. 4. In the Design a Form template dialog, select the Blank template and click the OK button. 5. In the Design Tasks pane, click the Controls link. 6. In the Controls pane, locate the CustomerInformation template part that you created earlier in this chapter. 7. Drag the CustomerInformation template part from the Controls pane to the blank form.

Creating the Data Connection The CustomerInformation template part acts as the header for the new form. The body of the form will have the description of the problem and allow the user to select a category. The category will be driven by the Issue Categories list you created earlier. Follow these steps to create the data connection: 1. Select Tools ➤ Data Connections from the main menu. 2. In the Data Connections dialog, click the Add button. 3. In the data connection wizard, select to create a new data connection to receive data. 4. Click the Next button. 5. On the Select Data Source screen, select to receive data from a SharePoint List and click the Next button. 6. On the SharePoint Site details screen, enter the complete URL to the home page of the Customer Issues site you created earlier (e.g., http://vsmoss/intranet/sites/ SiteDirectory/CustomerIssues) and click the Next button. 7. Select the Issue Categories list and click the Next button. 8. Select just the Title field from the available fields and click the Next button. 9. Check the box to Store a Copy of the Data in the Form Template and click the Next button.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

10. Click the Finish button. 11. In the Data Connection dialog, click the Close button. Note that you could choose to convert the data connection at this point and save it into a data connection library as I discuss in the section titled “Using Data Connection Libraries.”

Creating the Form Body Once the data connection is created, you can use it to populate a list in the Customer Issues form. The category list along with a text area will make up the body of the form. The form can then be published to the Customer Issues site for use. Follow these steps to complete the form: 1. In the Controls pane, click the Design Tasks link. 2. In the Design Tasks pane, click the Layout link. 3. In the Layout pane, drag the Table with Title layout onto the form and drop it. 4. In the heading area labeled Click to Add a title, enter Issue Details. 5. Click inside the cell labeled Click to Add Form Content. 6. Select Table ➤ Insert ➤ Layout Table from the main menu. 7. Enter 2 columns and 2 rows in the Insert Table dialog and click the OK button. 8. In the Layout pane, click the Design Tasks link. 9. In the Design Tasks pane, click the Controls link. 10. Drag a Drop-Down List Box control to the upper right cell in the Issue Details table. 11. Right-click the Drop-Down List Box and select Drop-Down List Box Properties from the context menu. 12. In the List Box Entries section, select the option to Look Up Values from an External Data Source. 13. Click the Select XPath button. 14. In the Select a Field or Group dialog, expand the field nodes and select the Title field. 15. Click the OK button. 16. In the Drop-Down List Box Properties dialog, click the OK button. 17. Drag a Rich Text Box control from the Controls pane to the lower right-hand cell in the Issue Details table. 18. Type the text Category in the upper left-hand cell of the Issue Details table. 19. Type the text Description in the lower left-hand cell of the Issue Details table. 20. Right-click each control on the form and open the Properties dialogs one by one. For each control, change the field name to the value shown in Table 6-2. Figure 6-19 shows the final form.

225

226

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Table 6-2. Field Names

Control Label

Field Name

Name

Name

Address

Address

City, State, Zip

CityStateZip

Category

Category

Description

Description

Figure 6-19. The Customer Issues form

Publishing the Form Once the form is completed you are ready to publish it to the site. In our scenario, you want the form to be accessible over the web. Therefore, you will publish the form so that it can be delivered via InfoPath Form Services. This means that you must run the Design Checker and publish the form to be delivered across the web. Follow these steps to publish the form: 1. In the Controls pane, click the Design Tasks link. 2. In the Design Tasks pane, click the Design Checker link. 3. In the Design Checker pane, click the Change Compatibility Settings link. 4. In the Form Options dialog, check the box labeled Design a Form Template That Can Be Opened in a Browser or InfoPath. 5. Enter http://vsmoss in the InfoPath Services URL field.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

6. Click the OK button. After the Design Checker runs, you should have a single error telling you that the selected rich-text formatting options are not supported. 7. Right-click the Rich Text Box on the form and select Rich Text Box Properties from the context menu. 8. In the Rich Text Box Properties dialog, click the Display tab. 9. Uncheck the box labeled Embedded Images and click the OK button. 10. In the Design Checker pane, click the Refresh button. The error should now be resolved. 11. Select File ➤ Save from the main menu. 12. In the Save As dialog, enter CustomerIssue.xsn and click the Save button. It is not important where you save the form at this point because it will ultimately be published to the Customer Issues site. 13. Select File ➤ Publish from the main menu. 14. In the Publishing Wizard, select to publish the form to a SharePoint Server and click the Next button. 15. On the next screen, enter the complete URL to the home page of the Customer Issues site (e.g., http://vsmoss/sites/intranet/SiteDirectory/CustomerIssues) and click the Next button. 16. On the next screen, be sure that the box is checked to enable the form to be filled out with a browser and select the option to publish the form to a document library. 17. Click the Next button. 18. On the next screen, select to create a new document library and click the Next button. 19. On the next screen, enter Customer Issue Forms in the Name field and click the Next button. 20. On the next screen, click the Add button to select fields that will be displayed as columns in the document library. 21. In the Select a Field or Group dialog, select the Name field and click the OK button. 22. Repeat the previous step to add the Category field. When the fields are added, click the Next button. 23. Click the Publish button.

Configuring the Form Library Once the form is published, it is available for use. However, you want to configure the new library so that it delivers the form through the browser by default. Additionally, you are going to use a built-in workflow to route the form for review.

227

228

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Follow these steps to configure the library: 1. Open the Customer Issues site in the browser. 2. Click the new Customer Issues forms library link in the Quick Launch area. 3. In the Customer Issues forms library, select Settings ➤ Form Library Settings from the toolbar. 4. On the Customize page, click the Advanced Settings link. 5. On the Advanced Settings page, select the option labeled Display as Web Page to force the form to open in a browser by default. 6. Click the OK button. 7. On the Customize page, click the Workflow Settings link. 8. On the Add a Workflow page, select the Approval workflow from the Workflow Template list. 9. Enter Approve Resolution in the Name field. 10. Click the Next button. 11. On the Customize Workflow page, accept the default settings by clicking the OK button.

Using the New Form Once the new form is published and the library is properly configured, you are ready to use the form. You should now be able to fill out the form with customer information and details about the problem. The category list should also be populated from the SharePoint list you created earlier. Additionally, you should be able to route the form for approval when the issue is resolved. Follow these steps to fill out a form: 1. Navigate to the Customer Issues library. 2. Click the New button on the toolbar. 3. When the form opens in the browser, enter some data for the customer information. 4. Enter a problem description and select a category from the drop-down list. 5. Click the Save link. 6. When prompted, give the file a name and click the Save link. 7. Return to the Customer Issues forms library and verify that your new form is saved. You may have to refresh the browser if the form is not listed in the library. 8. Note that the Name and Category fields are visible. These fields can be used to sort and filter the view. 9. Using the drop-down list associated with your new form, select Workflows.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

10. On the Workflows page, click the Approve Resolution workflow link. 11. On the Start page, enter the account you are using for the approver and click the Start button. 12. Return to the Customer Issues forms library and verify that the form now shows an In Progress status for the workflow. 13. Select Edit in Microsoft InfoPath from the drop-down menu associated with the new form. 14. When the form opens in InfoPath, you should be notified that you have a new task to complete. Click the Edit This Task button in the Document Action Panel. 15. In the task dialog, click the Approve button. 16. Select File ➤ Save from the main menu and close InfoPath. The form should now show an Approved status in the library.

Exercise 6.2. Document and Records Management Combining document and records management within MOSS allows organizations to control the entire life cycle of a document. Team sites and document workspaces can be used to create and collaborate around documents. Created documents can be approved using built-in workflows or custom workflows, which I cover in Chapter 7. Documents that must be archived can then be saved as records in a repository. In this exercise, you will create new content types for important financial records and a records repository to store them in. After you finish this exercise, you should be able to plan out your own document and records management system.

Prerequisites Before getting started with this exercise, it’s important to note that you must have MOSS available to complete it. Records management is a MOSS capability and is implemented through a special web service and site template. WSS alone simply doesn’t have the functionality. Another thing you’ll want to do before you get started is to download some document templates from the Microsoft Office site. In this exercise, you will create both an Invoice and Purchase Order content type so you’ll need templates for them. I simply went to http:// office.microsoft.com and searched for templates that I could use. Then I saved the templates for later.

Defining Site Columns All document and records management revolves around the definition of content types. Therefore, you will create several for this exercise. Content types begin with the definition of site columns that can be used for metadata. In this section, you will create some site columns that can be used later in a content type definition. Follow these steps to create the site columns: 1. Log in to the home page of the intranet site you created in Chapter 2. 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu.

229

230

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

3. On the Site Settings page, select Site Columns from under the Galleries section. 4. On the Site Column Gallery page, click the Create link. 5. On the New Site Column page, enter Client Name in the Column Name field. 6. Under the group section, select the New Group option and enter Custom Financial Columns in the text field. 7. Select the option to require that the column contain information. 8. Click the OK button. 9. On the Site Column Gallery page, click the Create link. 10. On the New Site Column page, enter Department Name in the Column Name field. 11. Select the Choice option for the field type. 12. Under the group section, select the Existing Group option and choose Custom Financial Columns from the drop-down list. 13. Select the option to require that the column contain information. 14. Add the following choices to the list: Administration, Information Services, Facilities, Operations, Sales, and Marketing. 15. Click the OK button. 16. On the Site Column Gallery page, click the Create link. 17. On the New Site Column page, enter Amount in the Column Name field. 18. Select the Currency option for the field type. 19. Under the Group section, select the Existing Group option and choose Custom Financial Columns from the drop-down list. 20. Select the option to require that the column contain information. 21. Click the OK button.

Defining Site Content Types Content types bring together site columns, templates, and workflows to define a document. In this section, you will use the site columns defined earlier to help create several content types. You will also associate the templates you downloaded at the beginning of the exercise with these content types. Follow these steps to create the content types: 1. Return to the intranet home page. 2. Select Site Settings ➤ Modify All Site Settings from the Site Actions menu. 3. On the Site Settings page, select Site Content Types from under the Galleries section. 4. On the Site Content Type Gallery page, click the Create button.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

5. On the New Site Content Type page, enter Financial Document in the Name field. 6. Select Document Content Types from the drop-down list labeled Select Parent Content Type From. 7. Select Document from the drop-down list labeled Parent Content Type. 8. Under the Group section, select the New Group option and enter Custom Financial Documents in the text field. 9. Click the OK button. 10. On the Site Content Type page, under the Columns section, click the link titled Add from Existing Site Columns. 11. On the Add Columns to Site Content Type page, select Custom Financial Columns from the drop-down list labeled Select Columns From. 12. Select all of the available columns and click the Add button. 13. Click the OK button. 14. Return to the Site Content Type Gallery page and click the Create button. 15. On the New Site Content Type page, enter Invoice in the Name field. 16. Select Custom Financial Documents from the drop-down list labeled Select Parent Content Type From. 17. Select Financial Document from the drop-down list labeled Parent Content Type. 18. Under the Group section, select Custom Financial Documents from the Existing Group list. 19. Click the OK button. 20. On the Site Content Type page, click the Advanced Settings link. 21. On the Advanced Settings page, select the option to Upload a New Document Template and click the Browse button. 22. Upload the Invoice template you downloaded earlier. 23. Click the OK button. 24. Return to the Site Content Type Gallery page and click the Create button. 25. On the New Site Content Type page, enter Purchase Order in the Name field. 26. Select Custom Financial Documents from the drop-down list labeled Select Parent Content Type From. 27. Select Financial Document from the drop-down list labeled Parent Content Type. 28. Under the Group section, select Custom Financial Documents from the Existing Group list.

231

232

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

29. Click the OK button. 30. On the Site Content Type page, click the Advanced Settings link. 31. On the Advanced Settings page, select the option to Upload a New Document Template and click the Browse button. 32. Upload the Purchase Order template you saved earlier. 33. Click the OK button.

Creating the Document Library Once the content types are created, they may be associated with a document library. In this exercise, you’ll create a document library for the financial documents and configure it to use the content types you defined. Once configured, you can use the library to create new financial documents. Follow these steps to create the new document library: 1. Click the Document Center tab on the intranet site. 2. Select Create from the Site Actions menu. 3. On the Create page, click Document Library. 4. On the New page, enter Financial Documents in the Name field. 5. Select Microsoft Office Word Document as the document template. 6. Click the Create button. 7. In the Financial Documents library, select Settings ➤ Document Library Settings from the toolbar. 8. On the Customize Financial Documents page, click the Advanced Settings link. 9. On the Advanced Settings page, select the option to Allow Management of Content Types. 10. Click the OK button. 11. On the Customize Financial Documents page, under the Content Types section, click the link titled Add from Existing Site Content Types. 12. On the Add Content Types page, select Custom Financial Documents from the dropdown list labeled Select Site Content Types From. 13. Select the Invoice and Purchase Order Content Types and click the Add button. 14. Click the OK button. 15. On the Customize Financial Documents page, under the Content Types section, click the Document Content Type. 16. On the List Content Type page, click the link titled Delete This Content Type. 17. Click the Document Center tab.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Creating the Records Repository The records repository is where important documents will be archived. The repository is created using the Records Center template. Once created, you can associate the repository with a site collection so that documents may be sent to the repository directly from a document library. Follow these steps to create the records repository: 1. Log in to VSMOSS as a SharePoint administrator. 2. Select Start ➤ Administrative Tools ➤ SharePoint 3.0 Central Administration. 3. On the Application Management tab, under the SharePoint Site Management section, click the link titled Create a Site Collection. 4. On the Create Site Collection page, ensure that the Web Application drop-down is referencing the web application where your intranet site is located. If not, drop the list and select the correct web application. 5. Enter Records Repository in the Title field. 6. Enter records in the Web Site Address field. 7. Under the Template Selection section, click the Enterprise tab, and then select the Records Center template. 8. Under the Primary Site Collection Administrator section, enter DOMAIN\ Administrator in the User Name field. 9. Click the OK button to create the new site collection. When the site collection is created, open it in a separate copy of the browser. 10. Return to the Application Management tab in the Central Administration web site and click the Records Center link under the External Service Connections section. 11. On the Configure Connection to Records Center page, select the option to Connect to a Records Center. 12. In the URL field, type the address of the records repository site followed by a reference to the Official File web service (e.g., http://vsmoss/sites/records/_vti_bin/ officialfile.asmx). 13. Type Records Repository in the Display Name field. 14. Click the OK button.

Configuring the Records Repository There are several configuration tasks that must be performed when a new records repository is created. Specifically, you must configure the repository to recognize content types and route them to the correct archive within the site. Additionally, you should set up retention policies so documents are automatically processed after they expire.

233

234

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

Follow these steps to configure the records repository: 1. Navigate to the home page of the records repository site. 2. Select Create from the Site Actions menu. 3. On the Create page, click the Document Library link. 4. On the New page, enter Financial Records in the Name field. 5. Select Microsoft Office Word Document from the Document Template drop-down list. 6. Click the Create button. 7. In the Quick Launch area, click the Records Routing link. 8. In the Records Routing list, click the New button. 9. On the Records Routing: New Item page, enter Financial Documents in the Title field. 10. Enter Financial Records in the Location field. 11. Enter Invoice/Purchase Order in the Aliases field. 12. Click the OK button. 13. In the Quick Launch area, click the Financial Records link. 14. In the Financial Records library, click Settings ➤ Document Library Settings on the toolbar. 15. On the Customize Financial Records page, click the link titled Information Management Policy Settings. 16. On the Information Management Policy Settings page, select the option to Define a Policy and click the OK button. 17. On the Edit Policy page, check the box labeled Enable Expiration. 18. Select the option labeled A Time Period Based on the Item’s Properties. 19. Enter 5 years for the expiration. 20. Select Delete in the Perform This Action drop-down list. 21. Click the OK button.

Archiving a Document Once the repository is configured, you may begin sending documents to it. Documents can be sent to the repository directly from an enabled document library. In this section, you’ll make a new document and send it to the repository. Follow these steps to archive a document: 1. Click the Document Center tab on the intranet site. 2. In the Quick Launch area, click the Financial Documents link.

CHAPTER 6 ■ SHAREPOINT DOCUMENT, FORM, AND RECORDS MANAGEMENT

3. In the Financial Documents library, drop the New menu and verify that both the Invoice and Purchase Order content types are listed. 4. Select the Invoice content type. 5. When the document opens in Word, fill in the properties. 6. Select File ➤ Save Form and save the document back to the Financial Documents library. 7. Close Word and return to the Financial Documents library. 8. Using the drop-down menu associated with the document, select Send To ➤ Records Repository. 9. After the document has been sent to the repository, open the home page of the records repository site. 10. Click the Financial Records library link and verify that the document was correctly archived.

Creating a Hold Category Once documents are in the repository, they may be put on hold. Holds help ensure that a document is not altered or destroyed during an important time period such as audit or discovery. In this section, you will place an archived document on hold for a tax audit. Follow these steps to set up a hold: 1. In the Quick Launch area of the Records Repository site, click the Holds link. 2. In the Holds list, click the New button on the toolbar. 3. On the Holds: New Item page, enter Tax Audit in the Title field. 4. Click the OK button. 5. In the Quick Launch area of the Records Repository site, click the Financial Records link. 6. Locate the archived document, and using the drop-down list, select Manage Holds. 7. On the Item Hold Status page, select the Add to Hold option and choose Tax Audit from the Holds list. 8. Click the Save button. 9. Locate the archived document and using the drop-down list, select Delete. 10. Verify that you receive an error message indicating that the document cannot be deleted while on hold.

235

CHAPTER

7

SharePoint Custom Features and Workflows F

eatures are the backbone of SharePoint development because every custom development project can—and really should—be deployed as a feature. Features give tremendous control over SharePoint configurations and capabilities at the administrator level. This means that developers can create features and then turn them over to SharePoint administrators without having to get involved repeatedly in small configuration changes. Workflow is a specialized feature that deserves extra attention because of the power it brings to SharePoint. Workflows allow you to start a series of operations manually or automatically in response to activity in a list. Workflows can be used for simple approval processes or complex system integration. In this chapter I cover all of the different ways to create features from simple hyperlink additions on a page to full-blown customized workflows.

Building Custom Features In Chapter 3, I introduced the concept of features and defined it as a way to package capabilities that could be deployed to any site. Throughout the book, you have activated various features of SharePoint to enable new functionality within sites. Activating some features, such as publishing, causes major changes in the way that a site behaves. Other features, such as the slide library, add a single atomic piece of functionality. This capability to affect large or small changes makes the idea of creating custom features compelling, and you should think of features as the best practice for deploying any customization from a single web part to complete solutions.

Understanding the Feature Architecture A SharePoint farm has a straightforward way to keep track of the available features. Each feature on the farm is given a folder in the path C:\Program File\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES, and the name of the folder is considered to be the name of the feature. The feature folder must contain a file named Feature.xml, which defines the basic information about a feature. Listing 7-1 shows the Feature.xml file for the data connection library feature.

237

238

CHAPTER 7 ■ SHAREPOINT CUSTOM FEATURES AND WORKFLOWS

Listing 7-1. A Sample Feature.xml File







445

446

CHAPTER 11 ■ PROGRAMMING SHAREPOINT SERVICES


























479

480

CHAPTER 12 ■ SHAREPOINT OPERATIONS AND ADMINISTRATION



asp:DataGrid runat="server" ID="gridLog" Width="100%" class="ms-descriptionText" GridLines="Horizontal" />


Adding Required Script The last part of the page involves writing the code to parse the logs and display them in a grid. This code is reasonably straightforward. It simply opens the selected log file, separates it into columns, and loads a custom DataTable with the information. The DataTable is then bound to a DataGrid for display. Add the code from Listing 12-5 to finish the page.

■Note Be sure the connection string in the following code is correct for your environment.

Listing 12-5. Processing the Logs

Creating the Feature File Once the log viewing page is written, you must create a feature to add a new section to the Central Administration site that contains a link to the new page. This feature will be created just as you created other features in Chapter 7. First, you must create a Feature.xml file, then you must create a manifest file to implement the new link. Add a new XML file named Feature.xml to your project and add the code from Listing 12-6. Listing 12-6. The Feature File





Creating the Manifest File The manifest file describes the new section and link to be added to the Central Administration web site. The new section is created through a CustomActionGroup element. The link is created with a CustomAction element. Add a new XML file named Elements.xml to your project and add the code from Listing 12-7.

483

484

CHAPTER 12 ■ SHAREPOINT OPERATIONS AND ADMINISTRATION

Listing 12-7. The Manifest File





Deploying the Feature Deploying the feature is accomplished by creating a new folder under the Features directory and copying the Feature.xml and Elements.xml files into the folder. You must also copy the ULSLogViewer.aspx file into the ADMIN directory. Once the files are copied, you can install the feature and then access it from the Operations tab of the Central Administration site. To make deployment easier, Listing 12-8 shows a batch file you can use to accomplish the required steps. Figure 12-12 shows the resulting page in the Central Administration web site. Listing 12-8. The Batch Installation File @SET TEMPLATEDIR= "c:\program files\common files\microsoft shared\web server extensions\12\Template" @SET ADMINDIR= "c:\program files\common files\microsoft shared\web server extensions\12\Template" @SET STSADM= "c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"

MKDIR %TEMPLATEDIR%\FEATURES\LogViewer XCOPY Feature.xml %TEMPLATEDIR%\FEATURES\LogViewer XCOPY Elements.xml %TEMPLATEDIR%\FEATURES\LogViewer XCOPY ULSLogViewer.aspx %TEMPLATEDIR%\Admin %STSADM% -o installfeature -filename LogViewer\Feature.xml IISRESET ECHO "Installation Complete" PAUSE

CHAPTER 12 ■ SHAREPOINT OPERATIONS AND ADMINISTRATION

Figure 12-12. The ULS log viewer

485

Index ■Special Characters $Resource file, 416 +xml suffix, 335 delimiters, 424

■A Access, using list data in, 197 access and authentication planning forms authentication, 33 NT LAN Manager (NTLM) and Kerberos, 32–33 overview, 31–32 access maps, 91 access strategy, 8 Access View, 197 access zone, 84 Acrobat Reader, Adobe, 107 Action elements, 271 action form, 273 action pages, custom, 243–247 actions adding to menus and toolbars, 240–243 overview, 136 Actions element, 271 ACTIONS file, 270, 271 ActivationDependencies element, 239 Active Directory, 28, 44, 52, 59, 111 Active Directory Account Creation (ADAC) mode, 90 Active Directory group, 109 ActiveDirectoryMembershipProvider, 84, 89, 97 ActiveOnDefault attribute, Feature element, 238 activities, custom coding, 267–269 overview, 266–267 using custom SharePoint Designer, 270–271 ActivityDesigner class, 269 ad hoc teams, 10 ADAC (Active Directory Account Creation) mode, 90 Add a Web Part link, 151

Add and Customize Pages site permission, 66 Add Application link, Business Data Catalog section, 136 Add Items list permission, 65 Add New Item dialog, 343, 422 Add or Remove Web Parts link, My Site, 118 Add Web Parts dialog, 151 add-ins, Office 2007 adding buttons to tab, 344–346 loading Ribbon Support, 344 overview, 343–344 Add/Remove Private Web Parts personal permission, 67 ADMIN directory, 474, 483 administration. See operations and administration Administration web service, 428 administrators, 202 administrators group, designating, 52 admin.master file, 474 AdminTask content type, 194 Adobe Acrobat Reader, 107 Advanced Permissions, Users and Permissions section, 68 Advanced Settings link, 198–199, 218 Adventure class, 401, 403, 409 AdventureWorks data warehouse, 312, 313 AdventureWorks database, 348, 400 AfterProperties, 256 alerts, 81–82 Alerts web service, 428 aliases, creating, 92–93 Aliases field, Record Routing, 221 Allow Writers to View Cached Content setting, cache profile, 461 AllowPartiallyTrustedCallers attribute, 375 AllUsersWebPart element, 420 alternate access mappings, 90–91, 100 AlternateCSS attribute, Project Element, 416 AlternateHeader attribute, Project Element, 416 AlwaysForceInstall attribute, Feature element, 238 Analysis Services, 46 487

488

■INDEX

Announcement content type, 194 announcements list, 77 anonymous access, configuring, 70 Anonymous Access Settings page, 70 answer file, 40 antivirus protection, configuring, 468 Application definitions, 438 Application event log, 291 Application Management tab, Central Administration site, 70, 470 application master page, 173 Application Server role, adding, 46, 48, 55, 93–94 application.master file, 422 Apply Style Sheets site permission, 66 Apply Themes and Borders site permission, 66 ApplyChanges method, 397 Approval workflow, 258, 264 Approve Items list permission, 66 archiving documents, 234–235 Article Page layout, 168 ASCX files, 247 asp:ContentPlaceHolder server control, 179–180 ASP.NET, 48 ASP.NET 2.0, 24 ASP.NET controls, 367 ASPNET_REGSQL.EXE utility, 85 ASPX extension, 162 ASPX pages, 359, 422, 474 assemblies, 351 Assembly attribute, 256, 381 assembly location, 352 AssemblyDelaySign attribute, 374 AssemblyInfo file, 374 AssemblyInfo.cs file, 404 AssemblyKeyFile attribute, 374 [assembly:System.Security.AllowPartially TrustedCallers( )] attribute, 404 association form, 273 AssociationUrl attribute, 293 Asynchronous JavaScript, 384 asynchronous processing, 31 Audience data type, 174 Audience Targeting Settings link, Customize page, 202 audiences, 83, 103, 109–110 auditing, 201 authentication. See also access and authentication planning

authentication options extending web applications, 84 overview, 83–84 using Active Directory Account Creation (ADAC) mode, 90 using Forms authentication ActiveDirectoryMembershipProvider, 89 LDAPMembershipProvider, 89 overview, 84–85 SqlMembershipProvider, 85–89 using web single sign-on, 90 authentication providers, 49 authentication system, 16 Authentication web service, 428 AuthenticationMode property, 133 AutoActivateInCentralAdmin attribute, Feature element, 238

■B backup and restore creating target folder, 451–453 overview, 451 performing backup, 453 performing restore, 454 bar codes, 201 BaseType property, 426 Basic Meeting Workspace template, 148 basic page, 80 Basic Page, Create page, 149 Basic Page-creation tools, SharePoint Designer, 157 Basic Pages web part, blank template, 153 BasicPage content type, 194 Batch element, 434 batch file, 363 BDC. See Business Data Catalog BDC Permissions link, Shared Services, 140 BeforeProperties, 256 /bin directory, 373 binary large objects (BLOB), 25, 459 Blank Meeting Workspace template, 148 blank site, creating, 148 Blank Site template, 147, 152 Blank WCM Site template, 176 BLOB (binary large objects), 25, 459 BlobCache element, 462 Blog template, 147 BlogComment content type, 194 BlogPost content type, 194 Body item, AfterProperties, 256

■INDEX

business solutions analysis and design considerations documenting business vision, 15 documenting policies, practices, and regulations, 16–17 managing change, 18–19 overview, 15 project and design documents, 18 grouping information workers departmental teams level, 3–4 divisional groups level, 4 enterprise level, 4 extended enterprise level, 4 individuals level, 3 overview, 3 information worker challenges access challenge, 7–8 collaboration challenge, 6–7 information challenge, 6 management challenge, 8 overview, 4 process challenge, 6 regulatory challenge, 9 system challenge, 5 overview, 1 segmenting information workers executives group, 3 overview, 2 professionals group, 2–3 transactors group, 2 SharePoint marketplace, 1–2 understanding business scenarios complying with regulations, 14 increasing divisional and enterprise level productivity, 11 increasing individual level productivity, 9 increasing team level productivity, 10 integrating with partners and customers, 13 overview, 9 supporting remote workers, 12

■C Cacheability setting, cache profile, 461 caching elements, 459 caching options, configuring cache profiles, 460–461 object and disk caching, 462–463 output caching, 461–462 overview, 459

Find it faster at http://superindex.apress.com/

Boolean data type, 174 Boolean type, 396 Boolean value, 366 Browse Directories site permission, 66 Browse User Information site permission, 66 browser-compatible form, 218 Browser-Enabled Documents setting, 218 built-in configuration settings, 154 built-in workflows, 258–259 Business Data Catalog (BDC), 30 metadata authoring entities, 133–134 authoring LobSystem element, 132 authoring LobSystemInstance element, 132–133 authoring methods, 134–135 authoring parameters, 135–136 overview, 126–131 overview, 125–126 uploading application definition, 136, 138 using BDC information, 138–140 Business Data Catalog (BDC), Shared Services Provider (SSP), 103 Business Data data type, 174 Business Data Item web part, MOSS, 138 Business Data List web part, MOSS, 138–139 business intelligence (BI) solutions dashboards adding data connection, 317–318 browsing cube in Excel, 316–317 building, 319–320 building and deploying cube, 313–316 creating report, 318–319 installing AdventureWorks data warehouse, 312 overview, 312 data source options overview, 300 using cubes as data sources, 303–307 using SharePoint lists as data sources, 300–301 using spreadsheets as data sources, 302 integrating SQL Reporting Services overview, 308–309 SQL Server 2005 Service Pack 2 (SP2), 311–312 web parts, 310–311 overview, 295 report center overview, 295–296 reports, 297–299 scorecards, 296–297

489

490

■INDEX

CAD (computer-aided design) system, 2 CAL (client access licenses), 30 Calculate method, 124 Calculated data type, 174 calculation engine, Excel Services, 119 Calendar Views, 197 calendars, 78 callback method, web parts, 409 CAML (Collaborative Application Markup Language), 25, 162, 412 CAML fragment, 430 Cancel property, 256 CAS. See code access security cells, 302 Central Administration, 70, 167 Central Administration pages, 62 Central Administration site, 79, 88, 91, 103, 181, 219, 407, 453, 455, 472 Certificate Services, installing adding Application Server Role, 93–94 adding Certificate Services, 94 overview, 93 certificates creating, 96 installing, 96–97 installing Certificate Services adding Application Server Role, 93–94 adding Certificate Services, 94 overview, 93 requesting new certificate, 94–95 challenge-response protocol, NTLM, 32 Change Compatibility Settings link, 217 change permissions, 464 Check for Changes setting, cache profile, 461 Check In to Share Draft button, 170 Check Workflow button, 265 child controls, web parts, 402–403 child KPIs, 297 Choice data type, 174 chrome, 25, 172 Class attribute, Receivers element, 256 cleaning up unused sites, 470–472 Cleanse Document item, 364 cleansing data, 304 Click event, 372 Click method, 396 client access licenses (CAL), 30 ClientScript property, 385 ClientScriptManager object, 384 client-side processing, 31 client-side script, web parts, 384–386

client-side scripting, 31 Closed Web Parts Gallery, 151 CLR (Common Language Runtime), 377 code access security (CAS), 376 configuration files, 376–377 customizing policy files, 377–380 marking web parts as safe, 380–381 overview, 376 settings, 214 Code activity, 263 CodeDownload feature, 241, 243 CodeToRunElevated class, 424, 425 Collaboration Portal, 148, 295 Collaborative Application Markup Language (CAML), 25, 162, 412 Colleague Tracker, My Home page, 117 Collect Feedback workflow, 258 Collect Signatures workflow, 258 column indexing, document library, 203 columns defining site columns, 188 list columns, 195–196 site columns, 195–196 COM (component object model), 210 command-line application, 353 command-line utility, 473 comments.xml file, 358 Common Language Runtime (CLR), 377 Communications category, 74 Compensate activity, 263 CompleteTask activity, 286 completetask1_methodinvoking, 291 component object model (COM), 210 computer-aided design (CAD) system, 2 ConditionedActivity Group activity, 263 Configuration element, 413, 415 configuration files, and code access security, 376–377 Configurations section, 444–446 Configure InfoPath Forms Services link, 216 Configure Search Settings page, 105 Connect to Another Library link, 161 connectable web parts exercise adding callback method, 409 adding filter property, 409 building and deploying web part, 410 creating contact list, 410 modifying SQL statement, 409–410 overview, 408 connection life cycle, web parts, 396 Connection property, 401

■INDEX

Content management, 72 content posting, 17 content type, 74, 203 Content Type Items, 334 content type management, 199 content types, 198–199, 229, 332, 334 Content Types Gallery, 193, 199, 247 [Content_Types].xml file, 335 ContentType attribute, 335 Context object, 423 Context property, 423 Contributor Group, 157 Contributor Mode, 156–157, 163 Contributor Settings, 156, 175 ControlId attribute, 180 Controls collection, 367 Controls section, Content Fields node, 175 Controls.Add method, 367 Copy web service, 428 Copy XPath, 291 Copy XPath menu item, 212 CORE.CSS style sheet, 155, 171 correlation tokens, 263 Course Description custom columns, 188 Course Level custom columns, 188 Course Outline custom columns, 188 crawl rules, 106 crawl schedule, 106 Create Alerts list permission, 66 Create Groups site permission, 66 Create link, Site Actions menu, 118 Create New Document Library link, 160 Create New SharePoint List, 160 Create or Extend Web Application, Web Application Management section, 84 Create page, 80 Create Page item, 191 Create page, Site Actions menu, 149, 168, 175 Create Site Collection page, 147 Create Site link, 72 Create Subsites site permission, 66 CreateChildControls method, 367, 371, 397, 402 CreateEditorParts method, 398 CreateTask activity, 264, 283–284 createTask1_MethodInvoking, 291 Creator attribute, Feature element, 238 credential database, Visual Studio, 86 credentials, 5 Credentials value, 133

Find it faster at http://superindex.apress.com/

ConnectionProvider attribute, 387, 392, 394 Connections button, Data ribbon, 307 connectionString entries, 89 connectionStrings section, 87 consumer web part, building, 394–396 Contact content type, 194 contact list, 77 contacts list, 77, 410 content access account, 106 Content Authors group, 157 content creation, 17 Content Database, 24 Content Deployment Paths link, 181 Content Deployment Settings link, Operations tab, 181 content development and management adding and editing pages connecting web parts, 153 overview, 149–150 using web parts, 151–153 customization impact of, 162–164 modifying site look and feel, 154–155 saving customized templates, 164–165 with SharePoint Designer, 155–162 enabling site variations, 180–181 master pages creating, 176–180 editing default master page, 171–173 overview, 147 page layout creation, 174–175 site collection templates, 147–149 using content deployment, 181–182 using Publishing Feature creating and approving pages, 168–171 creating public Internet site, 165–168 overview, 165 using alternate style sheet, 171 Web Content Management (WCM) activating and configuring Publishing Feature, 183–187 creating new site, 182–183 creating new welcome page, 187 creating page layout, 189 defining content type, 188–189 defining site columns, 188 editing page layout, 189–190 overview, 182 publishing page layout, 191 using page layout, 191 Content Editor web part, 110, 153

491

492

■INDEX

CRM (customer relationship management), 8, 30, 303 Cube wizard, 315 cubes, using as data sources, 303–307 Culture attribute, 381 culture information, 253 Currency data type, 174 custom action pages, 243–247 Custom category, 74 custom features, building adding actions to menus and toolbars, 240–243 adding new files to site, 248–249 feature architecture, 237–239 feature receivers coding, 250–252 creating Feature.xml and manifest files, 252–253 overview, 249–250 overview, 237 receiving Site, List, and Item Events coding event receiver, 255–256 creating manifest file, 256 overview, 253–255 using custom action pages, 243–247 using tokens to retrieve information, 247 custom lists, 79 custom page layouts, 183 Custom task panes, 347 CustomAction element, 241, 483 CustomActionGroup element, 483 CUSTOM.ACTIONS file, 270 Customer Issues form, 224–225 Customer Issues site, 223 customer relationship management (CRM), 8, 30, 303 customer service representatives, 2 CustomerInformation template, 224 customers, integrating with, 13 Customize page, 197–198 customized pages, 25, 162 customizing policy files, 377–380 site definitions, 416–420 CustomJSUrl attribute, Project Element, 416 CustomMasterUrl property, 250 CustomTaskPane object, 349 customUI element, 345 CustomUI.xsd schema, 345

■D DAP (Document Action Panel), 26, 197, 259, 321 dashboards, 119, 295 adding data connection, 317–318 browsing cube in Excel, 316–317 building adding KPI, 319–320 adding report, 319 overview, 319 building and deploying cube creating cube, 315–316 creating new data source, 313 creating new data source view, 314–315 overview, 313 creating report, 318–319 installing AdventureWorks data warehouse, 312 overview, 312 data connection libraries, 123, 209–210, 318 data connection wizard, 123, 209 data connections, 123–124, 198 Data Connections dialog, 209 Data Source Library, 160 Data Source pane, 212 data sources overview, 300 using cubes as, 303–307 using SharePoint lists as, 300–301 using spreadsheets as, 302 Data Sources folder, 307 data structures, 303 Data tab, Excel, 123 data types, 195 Data View web part, 160 data warehouses, 303–306, 312 database server, creating adding Application Server role, 46 configuring SQL Server 2005 surface areas, 47–48 installing SQL Server 2005, 46–47 overview, 46 DatabaseAccessProvider property, 133 DataGrid, 480 Datasheet View, 197 DataTable, 479 Date/Time data type, 174 DCOM errors, 45 Decision Meeting Workspace template, 148 default content type, 198 default form template, 76

■INDEX

skipping domain, 39 Virtual Machine Additions, 39 Windows Server Post-Setup Security Updates page, 39 installing Microsoft Office SharePoint Server (MOSS) adding Application Server role, 55 adding to list of trusted sites, 57–58 configuring components, 59 configuring Kerberos authentication, 58–59 configuring outgoing e-mail, 62 installing .NET Framework 2.0, 55–56 installing .NET Framework 3.0, 56 installing software, 56 overview, 55 setting up Shared Services Provider, 61–62 starting required services, 60–61 installing Virtual Server 2005, 37–38 installing Windows SharePoint Services (WSS) adding Application Server role, 48 configuring components, 51–53 creating new Web Application and site collection, 53–54 installing .NET Framework 2.0, 48 installing .NET Framework 3.0, 49 installing software, 49–51 overview, 48 overview, 35–36 prerequisites, 36 device emulator, 329 DHTML (dynamic HTML), 384 Diagnostic Logging link, 455 dimensions, 305 DIPs (Document Information Panels), 26, 195, 321, 324, 326–327 directory management service (DMS), 79 DisableWebDesignFeatures attribute, Project Element, 416 disaster recovery/business continuity plan, 17 discussion boards, 77 Discussion content type, 194 disk caching, 462–463 DisplayCategory attribute, Configuration element, 415 Dispose event, 372 Disposition Approval workflow, 258 distinguished name (DN), 114

Find it faster at http://superindex.apress.com/

default InfoPath form, 76 Default zone, 84, 90, 92, 166 Default.aspx file, 412, 418 default.master page, 179, 250, 412, 418, 422 DefaultResourceFile attribute, Feature element, 238 Delay activity, 263 DelegateControl attribute, 180 DelegateControl placeholder, 179 delegation, 33 Delete Items list permission, 66 Delete Versions list permission, 66 DEPLOY.CAB file, 40 deployment architectures large farm configuration, 35 medium farm configuration, 35 overview, 34 single-server configuration, 34 small farm configuration, 35 DeploymentTarget attribute, 382 Describe Yourself link, My Site, 117 Description attribute, 238, 242, 415 Design Checker, 208, 217, 226 design documents, 18 Design tab, Options dialog, 211 Design Tasks pane, InfoPath, 217 DesignerType, 271 development environment creation creating database server adding Application Server role, 46 configuring SQL Server 2005 surface areas, 47–48 installing SQL Server 2005, 46–47 overview, 46 creating domain controller adding users and groups to domain, 44–45 cloning base VPC, 42 configuring domain controller, 42–43 configuring Remote Desktop for Administration (RDA), 45–46 overview, 41 setting up POP3 service, 43–44 creating test client, 64 creating virtual PC (VPC) image creating answer file, 40–41 formatting partition, 39 getting started, 38–39 naming server, 39 overview, 38 prepping operating system, 41

493

494

■INDEX

divisional level productivity, increasing, 11 DMS (directory management service), 79 DN (distinguished name), 114 Document Action Panel (DAP), 26, 197, 259, 321 Document Center site, MOSS, 72 Document Center template, 148 Document content type, 193–194, 199 document conversions service, 220 Document Information Panels (DIPs), 26, 195, 321, 324, 326–327 document labels, 201 document libraries, 22, 74–75, 150, 351, 463 creating, 232 enhancements configuring column indexing, 203 configuring policy settings, 201–202 configuring versioning settings, 200 managing item-level security and audiences, 202 managing recycle bin, 202 overview, 200 document management. See records management Document Management Information panel, 321–323 document policies, 201 document templates, 198, 417–418 Document Updates pane, 328 document workspaces, 147, 229, 322, 428 documentation, 18 business vision, 15 policies, practices, and regulations, 16–17 project and design documents, 18 Documents tab, Document Management Information panel, 321 DocumentTemplates element, 417 Documentum document management system, 203 document.xml file, 335, 355 domain controller configuring, 42–43 creating adding users and groups to domain, 44–45 cloning base virtual PC (VPC), 42 configuring domain controller, 42–43 configuring Remote Desktop for Administration (RDA), 45–46 overview, 41 setting up POP3 service, 43–44

Domain forms, 214 Domain Name Service, 92 Domain trust, 214 draft versions, 200 drop-down lists, 74 drop-down menu, 162 DublinCoreName content type, 194 Duration setting, cache profile, 461 dynamic HTML (DHTML), 384 dynamic tokens, 250

■E ECM (Enterprise Content Management), 28–29 Edit Action page, 138 Edit Details page, My Site, 117 Edit Excel Services Settings link, Excel Service Settings section, 119 Edit Items list permission, 65 edit mode, Web Part Page, 153 Edit Page button, 170 Edit Page, Site Actions menu, 153 Edit Personal User Information site permission, 67 Edit View page, 330 editor part, 396 EditorPart class, 397 EditorPartCollection method, 399 ElementFile element, 239, 292 ElementManifests element, 239, 292 Elements.xml file, 241, 362, 483–484 e-mail, outgoing, configuring, 53, 62 e-mail-enabled lists, configuring, 79–80 EmailReceived event, 254 employee performance review workflow building project, 291 coding project coding completetask1_methodinvoking, 291 coding createTask1_MethodInvoking, 291 coding loop, 291 coding onworkflowactivated1_invoked, 291 overview, 287–290 creating workflow project, 281 deploying workflow, 291–294 developing project CompleteTask activity, 286 CreateTask activity, 283–284

■INDEX

creating new project, 143 overview, 141 trusting document library, 141–142 overview, 119 Settings section, 125 using data connections, 123–124 using Excel Web Services, 124 using parameters in, 121–122 Excel Web Access web part, 119 Excel Web Services, 119, 124 ExceptionHandler activity, 263 expiration dates, 201 ExtendedProperties collection, 291 extending web applications, 84 extending web applications, outside of firewalls enabling Secure Sockets Layer (SSL), 91 overview, 90 working with alternate access mappings, 90–91 eXtensible Stylesheet Language Transform (XSLT), 160 extract, transform, and load (ETL), 304 Extranet zone, 92

■F fact table, 305 FarEastContact content type, 194 Feature element, 238 feature receivers coding, 250–252 creating Feature.xml and manifest files, 252–253 overview, 249–250 FeatureActivated method, Microsoft.SharePoint.SPFeature Receiver class, 250 FeatureDeactivating method, Microsoft.SharePoint.SPFeature Receiver class, 250 FeatureInstalled method, Microsoft.SharePoint.SPFeature Receiver class, 250 features, 82–83 FEATURES directory, 293 FeatureUninstalling method, Microsoft.SharePoint.SPFeature Receiver class, 250 Feature.xml file, 237, 240, 241, 244, 252–253, 256, 265, 291, 361, 483–484 Field elements, 432, 434

Find it faster at http://superindex.apress.com/

overview, 282–283 While activity, 285 InfoPath workflow forms adding item schema, 279–281 creating workflow action form, 277–279 creating workflow association form, 273–275 creating workflow initiation form, 276–277 overview, 273 overview, 273 publishing forms, 281–282 using workflow, 294 enabled attribute, 462 Enabled Check/Uncheck setting, cache profile, 461 end-user training, 18 EnsureChildControls method, 372 enterprise collaboration software, 1 Enterprise Content Management (ECM), 28–29 Enterprise Content Management Starter Kit, 260 Enterprise edition, MOSS, 30 enterprise level productivity, increasing, 11 enterprise resource planning (ERP), 8 Entity element, 134 EntryType property, 269 Enumerate Permissions site permission, 66 ERP (enterprise resource planning), 8 ErrorMessage property, 256 EstimatedInstanceCount attribute, 134 ETL (extract, transform, and load), 304 Event content type, 194 event systems, 22 Event Throttling section, 455 EventDriven activity, 263 Excel browsing cube in, 316–317 importing Excel documents, 207–209 spreadsheets, 119 using list data in, 198 Excel Calculation Services, 119 Excel Services, 29, 103, 209 configuring, 119–121 creating user-defined functions, 124–125 custom solutions with coding application, 143–145 creating mileage calculator spreadsheet, 142

495

496

■INDEX

field names, 136 field values, 212 FieldAdded event, 254 FieldAdding event, 254 FieldBind elements, 271 FieldDeleted event, 254 FieldDeleting event, 254 FieldUpdated event, 254 FieldUpdating event, 254 File element, 248, 418, 420 File Explorer, 334 file servers, 7 FileRef attribute, 432 files, adding to site, 248–249 filter property, web parts, 409 FilterDescriptor element, 135–136 filters, 136 Financial Documents library, 327 FindCustomers method, 135 firewalls, 12 extending web applications outside of enabling Secure Sockets Layer (SSL), 91 overview, 90 working with alternate access mappings, 90–91 Folder content type, 194 Folder List, SharePoint Designer, 163 Form content type, 193 form digest token, 423 form libraries. See InfoPath and form libraries Form Options dialog, 214, 217 Form web part, blank template, 153 formal teams, 10 forms, 32 in InfoPath, 76 publishing, 281–282 Forms authentication ActiveDirectoryMembershipProvider, 89 configuring, 97–99 LDAPMembershipProvider, 89 overview, 84–85 SqlMembershipProvider, 85–89 Forms web service, 428 FormServer Templates library, 219 formula box (fx), 301 Full Control permission level, 68 Full Trust forms, 214

■G GAC (Global Assembly Cache), 125, 252, 358, 373, 377, 421 Gantt Views, 197 Generate Handlers, 264 GetAllSubWebCollection method, 429 GetCell method, 124 GetContextSite method, 423 GetContextWeb method, 425 GetCredentialEntryUrl method, 441 GetCredentials method, 441 GetList method, 431 GetListCollection method, 430 GetListItems method, 432–433 GetSubwebsForCurrentUser method, 426 GetValue method, Activity class, 269 ghosted pages, 163 Global Assembly Cache (GAC), 125, 252, 358, 373, 377, 421 global competition, 4 global master page, 173 global task list, 7 GlobalAssemblyCache, 382 globalization, 4 Globals.ThisAddIn.Application object, 346 Groove Networks, 27 group element, 346 GroupId attribute, CustomAction element, 241 groups, 44–45, 67 GUID, 382 GUID unique identifier, 238

■H helloButton_Click callback method, 346 Hidden attribute Configuration element, 415 Feature element, 238 Hierarchy Managers group, 68 history reports, 259 hold category, 235 Hold list, 221 holds, 235 HTML data type, 174 HtmlTextWriter class, 368 HttpHandler, web.config file, 24 HttpModule, web.config file, 24 human middleware, 3 human search engines, 6 human workflow, 257

■INDEX

Hyperlink data type, 174 hyperlinks, 470

■I

Find it faster at http://superindex.apress.com/

Id attribute, 242, 345, 414, 432 ID attribute, Configuration element, 415 Id attribute, Feature element, 239, 241 Identifier element, 134 idMso attribute, 345 IfElse activity, 263 IFilters, 106 IIS (Internet Information Services) Manager, 48 Image data type, 174 Image web part, blank template, 153 ImageURL attribute, Configuration element, 415 ImageUrl attribute, Feature element, 239 ImageUrlAltText attribute, Feature element, 239 Imaging web service, 428 impersonation, 32 Import Wizard, 208 importing Excel and Word documents, 207–209 Imports statement, 178 Indexed Column link, 203 individual level productivity, increasing, 9 InfoPath configuring form library, 227–228 creating Customer Issues form creating data connection, 224–225 creating form body, 225 overview, 224 creating Customer Issues site, 223 overview, 222 prerequisites, 223 publishing form, 226–227 using new form, 228–229 InfoPath 2007, 207, 209 InfoPath and form libraries creating template parts, 203–207 developing with Visual Studio Tools for Applications (VSTA) accessing form elements, 212–214 managing form trust, 214–216 overview, 210–212 importing Word and Excel documents, 207–209

InfoPath Forms Services deploying centrally managed forms, 219 designing for, 217–218 overview, 216–217 overview, 203 using data connection libraries, 209–210 InfoPath Form Services, 226 InfoPath forms, 264, 273, 326 InfoPath Forms Services, 217 InfoPath workflow forms adding item schema, 279–281 creating workflow action form, 277–279 creating workflow association form, 273–275 creating workflow initiation form, 276–277 overview, 273 Information Management Policy Usage Reports, 458–459 Information Rights Management (IRM) restrictions, 207 information workers challenges access challenge, 7–8 collaboration challenge, 6–7 information challenge, 6 management challenge, 8 overview, 4 process challenge, 6 regulatory challenge, 9 system challenge, 5 grouping departmental teams level, 3–4 divisional groups level, 4 enterprise level, 4 extended enterprise level, 4 individuals level, 3 overview, 3 segmenting executives group, 3 overview, 2 professionals group, 2–3 transactors group, 2 initialization form, 282 Initiation buttons, 265 initiation form, 273 InitiationData property, workflowProperties object, 291 InputFormControl user control, 476 InputFormSection user control, 476 Insert button, 348

497

498

■INDEX

Insert tab, 343 installation considerations access and authentication planning forms authentication, 33 NT LAN Manager (NTLM) and Kerberos, 32–33 overview, 31–32 deployment architectures large farm configuration, 35 medium farm configuration, 35 overview, 34 single-server configuration, 34 small farm configuration, 35 limitations, 33 overview, 30 storage capacity planning, 31 user capacity planning, 30–31 Install.bat file, 362–363 installing AdventureWorks Database, 400 Certificate Services adding Application Server Role, 93–94 adding Certificate Services, 94 overview, 93 certificates, 96–97 Microsoft Office SharePoint Server (MOSS) adding Application Server role, 55 adding to list of trusted sites, 57–58 configuring components, 59 configuring Kerberos authentication, 58–59 configuring outgoing e-mail, 62 installing .NET Framework 2.0, 55–56 installing .NET Framework 3.0, 56 installing software, 56 overview, 55 setting up Shared Services Provider, 61–62 starting required services, 60–61 .NET Framework 2.0, 48, 55–56 .NET Framework 3.0, 49, 56 RMS server, 465–466 SQL Server 2005, 46–47 Virtual Server 2005, 37–38 instant messaging system, 7 InstantiationUrl attribute, 293 Integrated Windows Authentication, 32 Internet Information Server, 446 Internet Information Services (IIS) Manager, 48

Internet service providers (ISPs), 90 Internet zone, 92 intranets, 4 InvokeWebService activity, 263 InvokeWorkflow activity, 263 element, 380 IRM (Information Rights Management) restrictions, 207 IsClientScriptBlockRegistered method, 385 IsClientScriptIncludeRegistered method, 385 ISO file, 36 ISPs (Internet service providers), 90 Issue Categories list, 224 Issues content type, 194 issues tracking lists, 78 Item content type, 193 Item event, receiving coding event receiver, 255–256 creating manifest file, 256 overview, 253–255 ItemAdded event, 254 ItemAdding event, 254 ItemAttachmentAdded event, 254 ItemAttachmentAdding event, 254 ItemAttachmentDeleted event, 254 ItemAttachmentDeleting event, 254 ItemCheckedIn event, 254 ItemCheckedOut event, 254 ItemCheckingOut event, 254 ItemDeleted event, 254 ItemDeleting event, 254 ItemFileConverted event, 254 ItemFileMove event, 254 ItemFileMoving event, 254 ItemId token, 247 item-level security and audiences, document library, 202 ItemUncheckedOut event, 254 ItemUncheckingOut event, 254 ItemUpdated event, 254 ItemUpdating event, 254 ItemUrl token, 247 IWAM Reg Admin Service component, 45 IWebPartField interface, 389, 409 IWebPartParameters interface, 389, 392 IWebPartRow interface, 389 IWebPartTable interface, 389

■INDEX

■J Jobs link, 181 JPEG extension, 334

■K

■L label attribute, 345 large farm configuration, 35 LastErrorCode property, 441 LastName property, 392, 409 layers, 159 layout of pages. See page layout layout tables, 158 LAYOUTS directory, 173, 247, 362, 422 LAYOUTS folder, 474 LDAP (Lightweight Directory Access Protocol), 84 LDAP query, 113 LDAPMembershipProvider, 84, 89 LDIFDE.EXE command-line utility, 113 libraries, 23, 332 Libraries category, 74 licensing requirements, for MOSS, 30 life cycle, web parts, 369–373 Lightweight Directory Access Protocol (LDAP), 84 LIKE clause, 134 limitations, 33 Limited Access permission level, 68 line-of-business system, 2 Link content type, 194 link list items, 77 link tag, 180 links list items, 77 LinkToDocument content type, 194 List attribute, Module element, 248 list columns, 195–196

Find it faster at http://superindex.apress.com/

KDC (key distribution center), 32 Kerberos, 32–33, 36, 50, 51, 57, 58–59, 83 key distribution center (KDC), 32 key performance indicators (KPIs), 3, 29, 295, 307, 312, 319–320 keywords, 109 knowledge economy, 2 KPI Goal Threshold, 296 KPI Value field, 296 KPI Warning Threshold, 296 KPIs (key performance indicators), 3, 29, 295, 307, 312, 319–320

list data, web services, 429–434 List elements, 430, 432 List event, receiving coding event receiver, 255–256 creating manifest file, 256 overview, 253–255 list permissions, 65 list templates, 165, 417–418 ListDir attribute, Project Element, 416 Listen activity, 263 ListId token, 247 listName parameter, 433 lists e-mail-enabled, configuring, 79–80 overview, 73–74 using announcements list, 77 using calendars, 78 using contacts list, 77 using custom lists, 79 using discussion boards, 77 using document libraries, 74–75 using form libraries, 76–77 using issues tracking lists, 78 using links list items, 77 using picture libraries, 77 using project tasks items, 78 using surveys, 78 using tasks items, 78 Windows SharePoint Services (WSS), 23 Lists element, 418 Lists web service, 428, 430 ListTemplates element, 417 Livelink document management system, 203 LoadViewState method, 371 LobSystem element, 132 LobSystemInstance element, 132–133 LobSystemInstances element, 132 Local Intranet zone, 50 Local Path field, 87 location attribute, BlobCache elements, 462 Location attribute, CustomAction element, 241 Location attribute, ElementFile element, 239 Location field, Record Routing, 222 Locks, implementing, 472 LOG extension, 455 log files, 455

499

500

■INDEX

log viewer feature, creating (exercise) creating feature file, 483 creating manifest file, 483–484 creating ULSLogViewer page adding required references, 474–475 adding required script, 480–483 coding main placeholder, 476–479 coding placeholders, 475–476 overview, 474 deploying feature, 484 overview, 474 LoginName property, 426 LogMessage method, 355 LogName property, 269, 271 look and feel of sites, modifying, 154–155 Lookup data type, 174 lookup lists, 209 loops, coding, 291

■M machine configurations, 37 machine.config file, 376 Manage Alerts site permission, 66 Manage Content and Structure, MOSS home page, 72 Manage Form Templates, InfoPath Forms Services section, 219 Manage Lists list permission, 65 Manage Permissions site permission, 66 Manage Personal Views personal permission, 67 Manage Server Settings link, 438 Manage Settings for Enterprise Application Definitions, 439 Manage Settings for Single Sign-On, Operations tab, 438 Manage This Farm’s Shared Services page, 103 Manage Web Application Features, Application Management tab, 83 Manage Web Site, 66, 168 Manage Your Server applet, 42 manifest files, 252–253, 265, 405 manifest.xml file, 382 mapped network drives, 7 Master Page catalog, 253 Master Page Gallery, 175, 189 Master Page link, 171

master pages creating asp, 179–180 overview, 176–178 PublishingWebControls, 180 SharePoint, 180 WebPartPages, 178 editing default master page, 171–173 MasterPage content type, 194 MasterUrl property, 250 ~masterurl/custom.default token, 250 ~masterurl/default.master token, 250 max-age attribute, BlobCache elements, 462 maxSize attribute, BlobCache elements, 462 MCMS (Microsoft Content Management Server), 28, 165 measures, 305 medium farm configuration, 35 Meetings web service, 428 members, 264 Members tab, Document Management Information panel, 321 membership entries, 89 menus, adding actions to, 240–243 Message content type, 194 Message property, 269, 271 Message Queuing, 465 metadata, Business Data Catalog (BDC) authoring entities, 133–134 authoring LobSystem element, 132 authoring LobSystemInstance element, 132–133 authoring methods, 134–135 authoring parameters, 135–136 overview, 126–131 Method elements, 434 Microsoft Access, using list data in, 197 Microsoft Certificate Services, 93, 96 Microsoft Content Management Server (MCMS), 28, 165 Microsoft Customer Experience Improvement Program, 455 Microsoft Excel. See Excel Microsoft Exchange, 43 Microsoft Office 2007, 211 Document Information Panel (DIP) and Document Action Panel (DAP), 26 overview, 25–26

■INDEX

configuring outgoing e-mail, 62 installing .NET Framework 2.0, 55–56 installing .NET Framework 3.0, 56 installing software, 56 overview, 55 setting up Shared Services Provider, 61–62 starting required services, 60–61 overview, 27 portal features, 28 Shared Services Provider (SSP), 30 versions, 30 Microsoft Office System technical library, 30 Microsoft Outlook, 3, 8, 23, 26, 327 Microsoft Picture Manager, 77 Microsoft Reporting Services, 29, 310 Microsoft Single Sign-On (SSO) service, 161 Microsoft subscription downloads, 36 Microsoft Virtual Server 2005, 36, 37–38 Microsoft Visual Studio 2005 Extensions, 260 Microsoft Visual Studio Tools for Applications, 211 Microsoft Word documents, 207–209, 339 Microsoft.Excel.Server.Udf library, 124 Microsoft.Office.Server.ApplicationRegistry. MetadataModel object, MOSS assembly, 126 Microsoft.Office.Server.ApplicationRegistry. Runtimeobject, MOSS assembly, 126 Microsoft.Office.Workflow.Feature, 265 Microsoft.SharePoint namespace, 365 Microsoft.SharePoint.dll assembly, 421 Microsoft.SharePoint.Portal.dll object, MOSS assembly, 126 Microsoft.SharePoint.Portal.SingleSignon namespace, 440 Microsoft.SharePoint.Security namespace, 377 Microsoft.SharePoint.SPFeatureReceiver class, 250 Microsoft.SharePoint.WebControls. FeaturemenuTemplate object, 241 Microsoft.SharePoint.WebPartPages. WebPart, 365 mileage calculator spreadsheet, 142 mobile devices, 329–332 Mobile section, 330 ModificationUrl attribute, 293 Module element, 248

Find it faster at http://superindex.apress.com/

suites, 27 working offline, while mobile, or with peers, 26–27 Microsoft Office and SharePoint developing with VSTO creating development environment, 341–343 creating Office 2007 add-ins, 343–346 creating Office 2007 task panes, 347–350 deploying VSTO 2005 SE solutions, 350–353 overview, 341 going offline, 327–329 managing document information creating custom document information panels (DIPs), 326–327 overview, 321 using Research Library, 323–324 utilizing Document Management Information panel, 321–323 working with Quick Parts, 324–325 mobile device support, 329–332 overview, 321 using Office Open file formats activating and using feature, 363–364 coding WordCleaner.Worker, 355–359 coding Worker.aspx page, 360–361 creating Elements.xml file, 362 creating Feature.xml file, 361 creating Install.bat file, 362–363 creating Worker.aspx page, 359–360 overview, 353 starting project, 354 using Office Open XML file formats document packages, 333–336 overview, 332–333 System.IO.Packaging, 336–340 Microsoft Office Primary Interop Assemblies (PIA), 341 Microsoft Office SharePoint Server (MOSS), 1, 94, 168, 193, 203, 258 business intelligence, 29–30 Enterprise Content Management (ECM), 28–29 installing, 456 adding Application Server role, 55 adding to list of trusted sites, 57–58 configuring components, 59 configuring Kerberos authentication, 58–59

501

502

■INDEX

Modules element, 418 Modules section, 446 MOSS. See Microsoft Office SharePoint Server MOSS Central Administration site, 59 MOSS Search Service, 60 MOSS SSO service, 33 MSOSEC.DLL assembly, 352 MSOSEC.XML file, 352 Multipage Meeting Workspace template, 148 Multiple Lines of Text data type, 174 My Calendar, My Home page, 117 My Colleagues page, Identify the People You Know link, 118 My Home tab, My Site, 117 My Profile tab, My Site, 117 My Site customizing, 118 overview, 116–117 publishing links, 119 using, 117–118 My Site Host template, 148 MyAddInsTab.cs file, 344 MyAddInsTab.xml file, 345

■N Name attribute File element, 249 LobSystem element, 132 Method element, 135 Module element, 248 Receivers element, 256 Template element, 414 Name property, 426 Names table, 126 Namespace attribute, 381 namespace information, 253 NavBarLink element, 417 NavBarPage element, 420 NavBars element, 417 navigating web sites, 154–155, 417 .NET assemblies, 24, 124, 211 .NET Framework, 212, 343 .NET Framework 2.0, 24, 48, 55–56 .NET Framework 3.0, 49, 56 Netscape browser, 5 New Project dialog, 342 NewButton feature, 473 News site, 72 no-code solution, 126 notComplete method, 291

notifications, 471 NT LAN Manager (NTLM), 32–33, 83 NTFS file format, 39 NTLM (NT LAN Manager), 32–33, 83 Number data type, 174

■O o parameter, 473 object caching, 462–463 ODC (Office Data Connection) files, 123, 209, 298, 307, 316 Office. See Microsoft Office Office Data Connection (ODC) files, 123, 209, 298, 307, 316 Office Developer Portal, 342 Office Forms Server, 29 Office Open file formats activating and using feature, 363–364 coding WordCleaner.Worker compiling assembly, 358–359 deleting comments part, 358 opening package, 355–356 overview, 355 removing changes and comments, 356–357 coding Worker.aspx page, 360–361 creating Elements.xml file, 362 creating Feature.xml file, 361 creating Install.bat file, 362–363 creating Worker.aspx page, 359–360 overview, 353 starting project, 354 Office SharePoint Server. See Microsoft Office SharePoint Server Office SharePoint Server Enterprise Site Collection Features, 216 Office SharePoint Server Publishing Feature, 165 Office SharePoint Standard Feature, 109 Official File web service, 429 OfficialFile web service, 221 ONET.XML file, 412, 416, 444 OnInit method, WebPart class, 371 OnLoad, 346 onLoad attribute, 345 OnLoad event, 372 OnLoad method, 372 OnPreRender method, 372 OnTaskChanged activity, 284 OnUnload event, 372 Open Items list permission, 66

■INDEX

■P Package class, 337 package file format, 334

PackagePart class, 337, 338 packagePath argument, 355 PackageRelationship class, 337 Packaging namespace, 337 page editing toolbar, 169 page layout creating, 174–175, 189 editing, 189–190 publishing, 191 Page Layout Content Types, 168 Page Layout Gallery, 175, 189 Page Viewer web part, blank template, 153 Parallel activity, 263 Parameter element, 271 parameters, using in Excel Services, 121–122 Parameters element, 271 Part Item, 334 PartName attribute, 335 partners, integrating with, 13 PassThrough value, 133 path attribute, BlobCache elements, 462 PDF (portable document format) files, 106 PDF files, 107 People data type, 174 People scope, 111 People web service, 428 Perform ACL Check setting, cache profile, 461 performance degradation, 33 performance management, 8 permission levels, 67–68, 156 Permissions page, 70 Permissions web service, 428 personal identification number (PIN), 16 personal permissions, 65 personal sites, Shared Services Provider (SSP), 103 Personalizable attribute, 366 Personalization Links, 119 PersonalizationScope.Shared, 366 PersonalizationScope.User, 366 PIA (Microsoft Office Primary Interop Assemblies), 341 Picture content type, 194 picture libraries, 77 Picture Manager, 77 piloting, 19 PIN (personal identification number), 16 PivotTable, 316, 318

Find it faster at http://superindex.apress.com/

Open method, Package class, 337 Open Shared Services Admin Site, 104 Open Site dialog, 155 Open site permission, 67 Open XML file formats, 339, 353, 355 OpenWorkbook method, 124 operations and administration backup and restore creating target folder, 451–453 overview, 451 performing backup, 453 performing restore, 454 cleaning up unused sites, 470–472 configuring caching options cache profiles, 460–461 object and disk caching, 462–463 output caching, 461–462 overview, 459 implementing Quotas and Locks, 472 log viewer feature, creating creating feature file, 483 creating manifest file, 483–484 creating ULSLogViewer page, 474–483 deploying feature, 484 overview, 474 logging, 455 overview, 451 quiescing farms, 469 reports working with Information Management Policy Usage Reports, 458–459 working with portal usage reporting, 456–457 using command-line utility, 473 Windows Rights Management (RMS) configuring antivirus protection, 468 configuring in SharePoint farm, 467 installing RMS server, 465–466 overview, 463–464 preparing for installation, 464–465 using with documents, 467–468 Options link, Status tab, 322 outgoing e-mail, configuring, 53, 62 Outlook, 3, 8, 23, 26, 327, 328 output cache, 461 Override Check Out list permission, 65 overview, 65, 237

503

504

■INDEX

PlaceHolderBodyAreaClass placeholder, 179 PlaceHolderBodyLeftBorder placeholder, 179 PlaceHolderCalendarNavigator placeholder, 179 PlaceHolderLeftActions placeholder, 179 PlaceHolderLeftNavBar placeholder, 179 PlaceHolderMain placeholder, 179, 418, 424 PlaceHolderMiniConsole placeholder, 179 PlaceHolderNavSpacer placeholder, 179 PlaceHolderPageDescription placeholder, 179 PlaceHolderPageImage placeholder, 179 PlaceHolderPageTitleInTitleArea placeholder, 179 placeholders, 247 PlaceHolderSearchArea placeholder, 179 PlaceHolderTitleAreaClass placeholder, 179 PlaceHolderTitleAreaSeparator placeholder, 179 PlaceHolderTitleBreadcrumb placeholder, 179 PlaceHolderTitleLeftBorder placeholder, 179 policies, documentation, 16–17 policy files, customizing, 377–380 Policy for Web Application, 71 policy settings, document library, 201–202 policy statement, 201 POP3 service, setting up, 43–44 Populate Gallery button, 384 portable document format (PDF) files, 106 portal features, MOSS, 28 Portal Server, 73 portal usage reporting, 456–457 portal users, 17, 111 PowerPoint, 353 presence information, 321 primary keys, 305 productivity divisional and enterprise level, 11 individual level, 9 team level, 10 profile imports, 455 profiles, 111 programming SharePoint Services overview, 411 SharePoint object model accessing lists and list items, 425–426 accessing site collections and sites, 423–424

accessing user information, 426–427 elevating permissions, 424–425 overview, 421–423 Single Sign-On Service (SSO) overview, 435 setting up, 435–440 using in code, 440–442 site definition creation exercise copying site definition, 443–444 modifying Configurations section, 444–446 modifying Modules section, 446 overview, 443 using site definition, 446 site definitions creating, 412–415 customizing, 416–420 overview, 411–412 Site Explorer, building adding child sites, 449 adding web reference, 447 overview, 446–447 returning all sites, 447–448 running sample, 449 web services list data, 429–434 overview, 428–429 site data, 429 project documents, 18 Project element, 416, 418 project sponsors, 15 project tasks items, 78 properties, web parts, 366–367, 401 Properties element, 132, 239 Properties object, 255 Property element, 132, 292 provider web part, building, 390–394 public Internet site, creating, 165–168 PublicKeyToken, 252–253, 291, 381 public/private key, 373 Publish to SharePoint Site button, Access, 197 Published Links web service, 429 Publishing Feature activating and configuring, 183–187 creating and approving pages, 168–171 creating public Internet site, 165–168 overview, 165 using alternate style sheet, 171 publishing forms, 281–282 Publishing Portal template, 148

■INDEX

Publishing Wizard, 214, 219 PublishingConsole:Console server control, 180 PublishingSiteAction:SiteActionMenu server control, 180 PublishingWebControls:AuthoringContainer server control, 180 purge functionality, 359

■Q

■R RDA (Remote Desktop for Administration), 45–46 RdbCommandText property, 135 RdbConnection Data Source property, 133 RdbConnection Initial Catalog property, 133 RdbConnection Integrated Security property, 133 read permissions, 464 read-only mode, 74 Really Simple Syndication (RSS), 27, 81–82 ReceiverAssembly attribute, 239, 252, 265, 292 ReceiverClass attribute, 239, 252, 292 Receivers element, 256 record repository template, 14 record retention regulations, 9 Record Routing list, 221 Records Center link, Application Management tab, 221 Records Center templates, 148, 221, 232 records management, 14, 221–222 archiving document, 234–235 configuring records repository, 233–234 creating document library, 232 creating hold category, 235 creating records repository, 233 defining site columns, 229–230 defining site content types, 230–232 overview, 229 prerequisites, 229

Find it faster at http://superindex.apress.com/

Query element, 433 QueryOptions element, 433 queryOptions parameter, 433 Quick Launch, 154, 308 Quick Parts, 324–325 quiescing farms, 469 quota templates, 472 Quota templates, 472

records repository, 221 configuring, 233–234 creating, 233 recovery utility, 453 RecurrenceId token, 247 recycle bin, document library, 202 References dialog, 421 Refresh button, 198 Register statement, 178 RegisterClientScriptBlock method, 384 RegisterClientScriptInclude method, 384 regulation compliance, 14 regulations, documentation, 16–17 relational databases, 303 relationship files, 336 Relationship Items, 334 Relevant Documents web part, blank template, 153 Remote Desktop Connection applet, 45 Remote Desktop for Administration (RDA), 45–46 remote workers, supporting, 12 RenderContents method, 367–368, 372, 397, 403 rendering web parts, 367–368, 403–404 Replicator activity, 263 Report Center, 11, 295, 307, 310, 317, 319 report center overview, 295–296 reports, 297–299 scorecards, 296–297 Report Center template, 29, 148 Report Explorer, 310 Report Services, 311 Report Viewer, 310 Reporting Services, 29, 310 reporting systems, 304 reports, 295 Information Management Policy Usage Reports, 458–459 portal usage reporting, 456–457 Reports Library, 297, 307 Reports site, 72 RequestService method, 344 RequireResources attribute, Feature element, 239 Research button, Proofing group, 323 Research Library, 323–324 resource strings, 416 Rest to Site Definition link, Site Settings page, 163

505

506

■INDEX

restore. See backup and restore Restore from Backup link, Operations tab, 454 Restricted forms, 214 retention policy, workflow with, 28 retention requirements, 17 retrieving information, with tokens, 247 return on investment (ROI), 15 Revert to Page Template, 163 RevertToSelf value, 133 ReviewFlow directory, 293 ReviewFlow.dll assembly, 293 ribbon, 25 ribbon element, 345 Ribbon Support component, 343 Ribbon Support, loading, 344 rich-text editing interface, 150 rights, 67 Rights Management Services (RMS), 463, 464 RMS. See Windows Rights Management RMS (Rights Management Services), 463, 464 ROI (return on investment), 15 RootOfList content type, 194 row element, 432 rowLimit parameter, 433 RSS (Really Simple Syndication), 27, 81–82 RuleDesigner element, 271 RunWithElevatedPrivileges method, 425

■S Safe attribute, 381 Safe for Authenticated Use setting, cache profile, 461 element, 381, 382 SafeControls section, 382 Sanitize method, 355 Save Site as Template link, Look and Feel section, 164 SaveViewState event, 372 Schemas property, XML file, 240 SCHEMA.XML file, 412, 417 Scope attribute, Feature element, 239, 241 scope identifier, 238 scorecards, 295–297, 301 screen thumbnail, 39 search, configuring crawling content sources, 105–106 including file types, 106–107 overview, 105

reporting on search usage, 109 understanding search scopes, 108 using keywords and best bets, 109 Search Center template, 148 Search Center with Tabs template, 148 Search Service, 53, 105 Search site, 72 Search web service, 428 secondary data source, 279 secure Internet site, creating adding new incoming URL, 100 configuring Forms authentication, 97–99 creating alias, 92–93 creating new certificate, 96 extending web application, 92 installing Certificate Services adding Application Server Role, 93–94 adding Certificate Services, 94 overview, 93 installing new certificate, 96–97 overview, 91 requesting new certificate, 94–95 testing secure Access, 100–101 Secure Sockets Layer (SSL), 16, 90, 91 SecurID tokens, 16 security, web parts. See code access security Security Level information, 214 security policies, 70–71 section, 376 security-trimmed, 68 Select Certificate button, 214 SelectData activity, 263 SelectSingleNode method, 212 self-service site creation, 117 Sentence attribute, 271 Sequence activity, 263 Sequence attribute, 242 SequenceNumber attribute, Receivers element, 256 sequential workflow, 262 Server Gallery, 152 server-side processing, 31 Service Principal Name (SPN), 51, 58 SetCell method, 124 SetConsumerSchema method, 392, 396 SetState activity, 263 setup project, 343 SETUP.EXE self-extracting executable, 37 SetValue method, 213, 269 shared file systems, 7

■INDEX

SharePoint namespace, 380 SharePoint object model accessing lists and list items, 425–426 accessing site collections and sites, 423–424 accessing user information, 426–427 elevating permissions, 424–425 overview, 421–423 SharePoint Portal Server (SPS), 10, 27 SharePoint server, 64 SharePoint Services. See programming SharePoint Services SharePoint site, 111 SharePoint template projects, 260 SharePoint:CssLink server control, 180 Sign This Form Template, 214 Single Line of Text data type, 174 Single Sign-On Service (SSO) overview, 435 setting up, 435–440 using in code, 440–442 single-server configuration, 34–35 single-server deployment strategy, 15 SingleSignOn assembly, 440 SingleSignonCredsNotFoundException exception, 441 SingleSignonException object, 441 SingleSignonLocator class, 441 Site Actions menu, 67, 240 site collection, 33, 72 Site Collection Features page, 258 Site Collection Object Cache, 463 Site Collection Quotas and Locks, Application Management tab, 472 site collections, 147–149, 423–424 site columns, 195–196, 229–230 Site Columns Gallery, 174 Site Content and Structure explorer, MOSS, 72 Site Content Type Gallery, 168, 174 site content types, defining, 230–232 Site Content Types link, 168 site creation and branding, Windows SharePoint Services (WSS), 25 Site Data web service, 428 site data, web services, 429 site definitions, 162 creating, 412–415 creation exercise, 443–446 customizing, 416–420 overview, 411–412

Find it faster at http://superindex.apress.com/

Shared Services audiences, 109–110 configuring search crawling content sources, 105–106 including file types, 106–107 overview, 105 reporting on search usage, 109 understanding search scopes, 108 using keywords and best bets, 109 creating and managing Shared Services Providers (SSP), 103–104 Excel Services configuring, 119–121 creating user-defined functions, 124–125 custom solutions with, 141–145 overview, 119 using data connections, 123–124 using Excel Web Services, 124 using parameters in, 121–122 integrating Business Data Catalog (BDC) metadata, 126–136 overview, 125–126 uploading application definition, 136, 138 using BDC information, 138–140 My Site customizing, 118 overview, 116–117 publishing links, 119 using, 117–118 overview, 103 user profiles, 111–116 Shared Services Administration site, 119, 125 Shared Services Provider (SSP), 456 creating and managing, 103–104 Microsoft Office SharePoint Server (MOSS), 30, 61–62 SharePoint Central Administration site, 51, 59 SharePoint Designer, 22, 175 adding new page, 157–159 Contributor Mode, 156–157 creating workflows in, 265 custom, 270–271 overview, 155–156 working with data sources, 159–162 working with data views, 162 SharePoint Designer workflows, 265 SharePoint Lists group, 197 SharePoint Lists.pst, 328

507

508

■INDEX

Site Directory, 72, 148 Site event, receiving coding event receiver, 255–256 creating manifest file, 256 overview, 253–255 Site Explorer, building (exercise) adding child sites, 449 adding web reference, 447 overview, 446–447 returning all sites, 447–448 running sample, 449 Site level, 243 [site name] Gallery, 152 site navigation, customizing, 154–155 site permissions, 65 Site Settings page, 68, 72, 80, 245, 363, 384, 463 site structure management lists e-mail-enabled, configuring, 79–80 overview, 73–74 using announcements list, 77 using calendars, 78 using contacts list, 77 using custom lists, 79 using discussion boards, 77 using document libraries, 74–75 using form libraries, 76–77 using issues tracking lists, 78 using links list items, 77 using picture libraries, 77 using project tasks items, 78 using surveys, 78 using tasks items, 78 overview, 71–72 pages, 80–81 sites, 72–73 site template file (STP), 412 Site Template Gallery, 164 Site Template Pages, 164 site templates, 63, 164 Site Templates directory, 412 Site Theme link, Look and Feel section, 154 ~site token, 247 Site Users web part, blank template, 153 ~sitecollection token, 247 SiteDeleted event, 254 SiteDeleting event, 254 SiteFeatures element, 418 sites, 33, 72–73 Sites site, 72

Sites web service, 428 SiteUrl token, 247 small farm configuration, 35 SMTP server, for MOSS, 62 SMTP service, 79 snapshot, 121 snippets, 291 Social Meeting Workspace template, 148 Solution element, 382 solution file, 405 Solution Management link, Central Administration web site, 383 solution package, 406 solution store, 383 SolutionId attribute, 382 SolutionId attribute, Feature element, 239 SPAdmins, groups, 45 SPBaseType enumeration, 426 SPConfigAcct account, 45 SPContentPool account, 45 SPControl class, 423 SPControl object, 425 SPCrawlAcct account, 45 SPDataPart project, 409 SPItemEventProperties class, 255 SPList object, 425 SPListCollection object, 425 SPListEventProperties class, 255 SPListItem object, 426 SPListItemCollection object, 426 SPN (Service Principal Name), 51, 58 spreadsheets, 120, 142, 301, 302, 319 SPS (SharePoint Portal Server), 10, 27 SPSearchAcct account, 45 SPSecurity class, 424 SPSecurity object, 425 SPSharedServicesAcct account, 45 SPSharedServicesPool account, 45 SPSite object, 423 SPTHEME.XML file, 155 SPUser object, 426 SPWeb objects, 423 SPWebEventProperties class, 255 SQL Reporting Services, 46 integrating overview, 308–309 SQL Server 2005 Service Pack 2 (SP2), 311–312 web parts, 310–311

■INDEX

System.ComponentModel.Property DescriptorCollection, 392 System.ComponentModel.TypeDescriptor object, 392 System.Diagnostics.EventLog class, 269 System.IO.Packaging namespace, 336–340 System.Security namespace, 375 System.Web namespace, 365 section, 87, 377 System.Web.UI.Control class, 372 System.Web.UI.Page object, 423 System.Web.UI.WebControls namespace, 367 System.Web.UI.WebControls.WebParts. WebPart, 365 System.Workflow namespace, 260 System.Workflow.ComponentModel.Activity class, 267 System.Workflow.ComponentModel. Compiler.ActivityValidator class, 269 System.Workflow.ComponentModel. DependencyProperty type, 269 System.Workflow.ComponentModel. Design.ActivityDesigner class, 269 System.Xml namespace, 337

■T T option, 291 tag, 368 tabs element, 345 Target attribute, 336 Target Audiences property, 202 target folder, for backup, 451–453 Task content type, 194 Task items, 78 task panes, 347–350 TaskChanged1_MethodInvoked method, 291 tasks items, 78 team level productivity, 10 Team Site template, 74, 147 team sites, 21, 229 TEMPLATE directory, 173 Template element, 413 template parts, 203–207, 223, 224 templates, 31, 147 document, 417–418 list, 417–418 site collection templates, 147–149 TEMPLATES directory, 362 Terminate activity, 263

Find it faster at http://superindex.apress.com/

SQL Server 2005 installing, 46–47 surface areas, configuring, 47–48 SQL Server 2005 Analysis Services, 306 SQL Server Business Intelligence Development Studio, 313 SQL Server Business Intelligence Studio, 306 SQL Server database, 85 SQL Server Express, 34 SQL statement, web parts, 409–410 SqlMembershipProvider class, 84–89 SSL (Secure Sockets Layer), 16, 90, 91 SSO. See Single Sign-On Service SSP. See Shared Services Provider staging area, 304 Standard edition, MOSS, 30 Standard View, 197 star schema, 305 State activity, 263 state machine workflow, 262 StateInitialization activity, 263 static IP address, 42 static tokens, 250 Status tab, Document Management Information panel, 321 STDVIEW.XML file, 412 stop light, 297 storage capacity planning, 31 STP (site template file), 412 Stream object, 338 String type, 396 strings, 441 strong name, creating, 404–405 Strong Name tool, 373 STSADM.EXE command-line utility, 310, 451, 473 style sheets, 155 styles, 154–155 Submit for Approval button, 171 subsites, 154 Summary data type, 174 surveys, 78 Suspend activity, 263 SyncChanges method, 397 SYSPREP utility, 37, 40–41 System content type, 193–194 System Properties dialog, 45 system workflow, 257 System.ComponentModel. PropertyDescriptor, 392

509

510

■INDEX

themes, 154–155 threaded discussions, 10, 77 Three-State workflow, 258 Throw activity, 263 ticket-based authentication protocol, Kerberos, 32 Timer Job Definitions, 453 Timer service, 453 Title attribute, 239, 242, 415, 416, 432 Title property, 135 toggle button, 344 tokens, using to retrieve information, 247 toolbars, adding actions to, 240–243 Top Link Bar hyperlink, Look and Feel section, 154 TopNavFlyouts master page, 176 Trace Log section, 455 tracing images, 157 Tracking category, 74 TransactionalContext activity, 263 transactors, 5 transformers, 389 Tree View link, Look and Feel section, 154 tag, 377 trusted file locations, 119 trusted library, 141 element, 376 two-factor authentication, 16 two-stage recycle bin, 202 Type attribute, 248–249, 256, 336, 415 TypeName attribute, 381 Tzunami Deployer tool, 203

■U UDC (Universal Data Connection) files, 209 UdfClass attribute, 124 UdfMethod attribute, 124 ULS (Unified Logging Service), 455, 473 ULSLogViewer page, creating adding required references, 474–475 adding required script, 480–483 coding main placeholder, 476–479 coding placeholders, 475–476 overview, 474 ULSLogViewer.aspx file, 483 Unclassified Records document library, 221 uncustomized pages, 162 uncustomized sites, 411 unghosted pages, 163 unghosting, 25 Unified Logging Service (ULS), 455, 473

Uniform Resource Identifier (URI), 380 unique identifier, 238 Universal Data Connection (UDC) files, 209 Unlink button, Design tab, 301 UntypedDocument content type, 194 unused sites, cleaning up, 470–472 Update Personal Web Parts personal permission, 67 UpdateData activity, 263 UpdateListItems method, 434 Upload menu, library toolbar, 77 URI (Uniform Resource Identifier), 380 Url attribute, File element, 248 Url attribute, Module element, 248 URL data type, 174 UrlAction element, 242 Use Client Integration Features site permission, 67 Use Remote Interfaces site permission, 66 Use Self-Service Site Creation site permission, 66 user capacity planning, 30–31 user information, accessing, 426–427 user management configuring anonymous access, 70 overview, 65–67 permission levels and SharePoint groups, 67–68 security policies, 70–71 User Profile Change web service, 429 User Profile web service, 429 user profiles, 111–116 User Profiles and Properties page, 116 user profiles, Shared Services Provider (SSP), 103 User Tasks web part, blank template, 153 UserControls, 347 user-defined functions, 124–125 username element, 213 users, adding to domain, 44–45 Users and Groups web service, 428 using client-side script, 387 using statements, 337

■V ValidateProperties method, 269 Value property, 213 Variables buttons, 265 Vary by Custom Parameter setting, cache profile, 461

■INDEX

Visual Studio creating custom workflows in creating InfoPath forms, 264 deploying workflows, 265 overview, 259–260 working in Visual Studio, 260, 262–264 Visual Studio Tools for Applications (VSTA), 210 accessing form elements, 212–214 managing form trust, 214–216 overview, 210–212 Visual Studio Tools for Office (VSTO), 211, 321 creating development environment, 341–343 creating Office 2007 add-ins adding buttons to tab, 344–346 loading Ribbon Support, 344 overview, 343–344 creating Office 2007 task panes, 347–350 deploying VSTO 2005 SE solutions, 350–353 overview, 341 VPC. See virtual PC VSMOSS, 57, 94, 165, 341 VSPDC virtual machine, 41 VSSQL server, 465 VSTA. See Visual Studio Tools for Applications VSTO. See Visual Studio Tools for Office VSTO 2005 SE, 341 VSWSS, 50, 94 VWSTYLES.XML file, 412

■W WaitForData activity, 263 WaitForQuery activity, 263 WCM. See Web Content Management element, 356 web application, 33 Web Content Management (WCM), 28, 165 activating and configuring Publishing Feature, 183–187 creating new site, 182–183 creating new welcome page, 187 creating page layout, 189 defining content type, 188–189 defining site columns, 188 editing page layout, 189–190 overview, 182 publishing page layout, 191 using page layout, 191

Find it faster at http://superindex.apress.com/

Vary by HTTP Header setting, cache profile, 461 Vary by Query String Parameters setting, cache profile, 461 Vary by Rights setting, cache profile, 461 VBA (Visual Basic for Applications), 210, 341 VeriSign, 93 Version attribute, 132, 239, 381 version information, 253 versioning settings, document library, 200 Versioning Settings page, 75 Versions web service, 428 VHD (virtual hard drive) files, 37 View Application Pages list permission, 66 View element, 420 View Items list permission, 66 View Pages site permission, 66 View Profile action, 138 View Usage Data site permission, 66 View Versions list permission, 66 viewFields parameter, 433 viewName parameter, 433 views overview, 196–197 using list data in Microsoft Access, 197 using list data in Microsoft Excel, 198 Views web service, 429 ViewState property, 371 virtual hard drive (VHD) files, 37 Virtual Machine Additions, 39 Virtual Machine Remote Control Client, 39 virtual machines, 36 virtual PC (VPC) image, creating creating answer file, 40–41 formatting partition, 39 getting started, 38–39 naming server, 39 overview, 38 prepping operating system, 41 skipping domain, 39 Virtual Machine Additions, 39 Windows Server Post-Setup Security Updates page, 39 Virtual Server 2005, 36, 37–38 Virtual Server web interface, 39 VisibilityFeatureDependency attribute, Configuration element, 415 vision document, 15 Visual Basic for Applications (VBA), 210, 341

511

512

■INDEX

Web Features element, 418 Web Part Connections, 162 web part page, 80 Web Part Page, Create page, 149 Web Part Pages web part, blank template, 153 Web Part Pages web service, 429 web part zones, 149 web parts complete web parts exercise coding web part, 401–404 creating new project, 400–401 deploying web part, 404–407 installing AdventureWorks Database, 400 overview, 399 using web part, 407–408 connectable, building building custom connection interfaces, 387–389 overview, 387 using standard connection interfaces, 389–396 connectable web parts exercise adding callback method, 409 adding filter property, 409 building and deploying web part, 410 creating contact list, 410 modifying SQL statement, 409–410 overview, 408 connecting, 153 custom editor parts creating, 397–398 overview, 396–397 using, 398–399 deploying building web part, 375–376 code access security, 376–381 creating solution packages, 381–384 deployment options, 373–375 overview, 373 using custom web parts, 384 life cycle, 369–373 overview, 365–366 properties, 366–367 rendering, 367–368 using, 151–153 using client-side script, 384–387 Web Parts Gallery, 151, 407 web services list data, 429–434

overview, 428–429 site data, 429 web single sign-on, 90 web site configuration tools, Visual Studio 2005, 85 web sites, modifying look and feel of, 154–155 web template file, 413 WebApplication, 382 WebBrowsable, 366, 371 web.config file, 375–377, 380, 384, 462 WebDeleted event, 254 WebDeleting event, 254 WebMoved event, 254 WebMoving event, 254 WebPart class, 365 web-part solution file, 152 WebPartPage content type, 194 WebPartPages:SPWebPartManager server control, 178 WebParts namespace, 394 WebPartToEdit property, 397 Webs web service, 429 WebServiceReceive activity, 263 WebServiceResponse activity, 263 WEBTEMPSOFTWARE.XML file, 413–414 WEBTEMP.XML file, 413, 418 welcome page, creating, 187 WF (Windows Workflow Foundation), 22, 260 While activity, 263, 285 width definition, 368 Wiki Site template, 148 WikiDocument content type, 194 Windows authentication, 83 Windows Live ID service, 90 Windows Live identity, 37 Windows Rights Management (RMS) configuring antivirus protection, 468 configuring in SharePoint farm, 467 installing RMS server, 465–466 overview, 463–464 preparing for installation, 464–465 using with documents, 467–468 Windows Server Post-Setup Security Updates page, 39 Windows SharePoint Services (WSS), 1, 94, 193, 365 document libraries, 22

■INDEX

custom activities coding, 267–269 overview, 266–267 using custom SharePoint Designer, 270–271 employee performance review workflow building project, 291 coding project, 287–291 creating workflow project, 281 deploying workflow, 291–294 developing project, 282–286 InfoPath workflow forms, 273–281 overview, 273 publishing forms, 281–282 using workflow, 294 options, 272–273 Workflows menu item, 259 WorkflowTask content type, 194 Workflow.xml file, 291 WriteEntry method, System.Diagnostics. EventLog class, 269 WSS. See Windows SharePoint Services WSS Central Administration site, 51 WSS.ACTIONS file, 271 wss.xsd schema file, 240 element, 338

■X XML (AJAX) solutions, 384 XML extensions, 334 XML file formats document packages, 333–336 overview, 332–333 System.IO.Packaging, 336–340 XML metadata file, 125 XML Paper Specification, 332 XML web part, 153 XmlDocument object, 291, 338 XmlNamespaceManager object, 338 XmlNode, 338, 429 XPath values, 291 XPathNavigator class, 212, 213 XSLT (eXtensible Stylesheet Language Transform), 160

■Z zero-footprint form, 216

Find it faster at http://superindex.apress.com/

installing adding Application Server role, 48 configuring components, 51–53 installing .NET Framework 2.0, 48 installing .NET Framework 3.0, 49 overview, 48 software installation, 49–51 lists, 23 overview, 21 site creation and branding, 25 web parts and custom development, 24–25 Windows Update, 48, 55 Windows Workflow Foundation (WF), 22, 260 WindowsBase assembly, 337 WindowsCredentials value, 133 WindowsIdentity class, 213, 214 element, 356 wizard interface, 49, 56 Word documents, 207–209, 339 WordCleaner.Worker, coding compiling assembly, 358–359 deleting comments part, 358 opening package, 355–356 overview, 355 removing changes and comments, 356–357 Work Offline button, 197 Workbook Connections dialog, 198 Worker class, 358 Worker.aspx page coding, 360–361 creating, 359–360 Workflow Designer, 265 Workflow Settings link, Application Management tab, 258 Workflow web service, 429 WorkflowHistory content type, 194 workflowProperties object, 291 workflows built-in, 258–259 creating in SharePoint Designer, 265 custom, creating in Visual Studio creating InfoPath forms, 264 deploying workflows, 265 overview, 259–260 working in Visual Studio, 260–264

513