www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SHAREPOINT® 2010 FIELD GUIDE INTRODUCTION xxi PART I USING SHAREPOINT TECHNOLOGIES AND EXPLOITING FUNCTIONALITY CHAPTER 1 Leveraging the SharePoint Object Model 3 CHAPTER 2 Creating Visual Web Parts 35 CHAPTER 3 Customizing Search 55 CHAPTER 4 Leveraging the SharePoint ListsWeb Service 73 CHAPTER 5 Custom Field Types, Content Types, and List Definitions 93 CHAPTER 6 Workflow 131 CHAPTER 7 Administrating SharePoint 2010with PowerShell 175 PART II SHAREPOINT SOLUTIONS CHAPTER 8 UI Design and Branding 211 CHAPTER 9 Building a Site Provisioning System 233 CHAPTER 10 Building Scalable Applications inSharePoint 297 CHAPTER 11 Building a Custom Global Navigation Solution 343 APPENDIX A URL Shortcuts 399 APPENDIX B CSS Quick Reference 401 APPENDIX C Hiding and Customizing Page Breadcrumbs 405 APPENDIX D PowerShell Quick Reference 407 GLOSSARY 409 INDEX 411 www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SharePoint ® 2010 Field Guide www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SharePoint ® 2010 Field Guide Steve Mann Colin Murphy Pablo Gazmuri Chris Caravajal Christina Wheeler www.it-ebooks.info Professional SharePoint® 2010 Field Guide Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2012 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-10505-4 ISBN: 978-1-118-22403-8 ISBN: 978-1-118-23767-0 ISBN: 978-1-118-26224-5 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specically disclaim all warranties, including without limita- tion warranties of tness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a poten- tial source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2011942765 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its afliates, in the United States and other countries, and may not be used without written permission. SharePoint is a registered trademark of Microsoft Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book. www.it-ebooks.info ABOUT THE AUTHORS STEVE MANN was born and raised in Philadelphia, Pennsylvania, where he still resides today. He is an Enterprise Applications Engineer for Morgan Lewis and has more than 17 years of professional experience. Steve was previously a Principal Architect for RDA Corporation, where he worked for over thirteen years. Steve graduated from Drexel University in 1993. For the past eight years, he has focused primarily on collaboration and business intelligence solutions using Microsoft technologies. Steve managed the internal BI Practice Group at RDA for several years. He was also heavily involved within RDA’s Collaboration/Search Practice Group. Steve has authored and coauthored several books related to the subject of SharePoint Server 2010. Steve’s blog can be found at: www.SteveTheManMann .com . Steve enjoys vacationing with his family along the east coast, including locations such as Orlando, Florida; Williamsburg, Virginia; Ocean City and Sea Isle City, New Jersey; and New York City. They usually hits three or four locations each year. Follow Steve on Twitter @stevethemanmann! COLIN MURPHY lives in Atlanta, Georgia, where heworks as a Principal Architect for RDA Corporation, a Microsoft Gold Partner. He has spent the last fteen years developing Web sites and Windows applications using a variety of languages including C++, PowerBuilder, Java, PHP, and Python, but has primarily been a .NET/C# developer for the last ten years. Colin has been developing enterprise solutions built on SharePoint since SharePoint 2007 was in beta. Colin holds a number of technical certications includingMicrosoft Certied Professional, Microsoft Certied Application Developer, Microsoft Certied Solutions Developer, and is also a Microsoft Certied Technical Specialist forSharePoint. Hehas been recognizedas a K2 Insider and is the coauthor of the book Professional K2blackpearl by Wiley. PABLO GAZMURI is a Principal Architect with RDA Corporation, an IT Consulting rm. He has led SharePoint efforts for a number of Fortune 500 companies where he conducts planning, mentoring, training, and coding activities. With fteen years of development experience, Pablo is a web, collabo- ration, and search expert who has built numerous corporate intranets, extranets, ecommerce sites, and custom applications over the course of his career. Pablo has recently built custom SharePoint applications enabling project management, document generation, SharePoint site provisioning, gover- nance enforcement, and more. You can nd him on Twitter as @PGazmuri, or contact him through RDA at http://www.rdacorp.com. CHRIS CARAVAJAL has been working exclusively with SharePoint technologies since 2007. As a con- sultant, he works with organizations on planning and architecting SharePoint solutions that vary in both size and complexity. Primarily an “out-of-the-box” specialist, Chris’s main focus is getting the most out of SharePoint with the native features and tools. He also has experience building InfoPath forms and SharePoint Designer workow solutions. Chris is a MCTS and is a contributing author to the top-selling SharePoint technical publication, “Professional SharePoint 2010 Administration.” www.it-ebooks.info CHRISTINA WHEELER is a SharePoint Trainer for Mindsharp and founder of CM Portal Solutions, LLC. She is a highly respected SharePoint consultant who is extremely active in the SharePoint com- munity. With over ten years of experience in the industry, Christina has knowledge and experience in graphic design, web development, and custom development. Her work is targeted primarily toward educational institutions, nancial institutions, and telecommunications. As a trainer, Christina brings her real-world experience to the classroom. She enjoys contributing articles to technical Web sites and often speaks at SharePoint community events and conferences. You can follow her on Twitter as @cwheeler76. ABOUT THE TECHNICAL EDITOR REZA ALIREZAEI MVP, MCP, MCPD, MCITP & MCTS for SharePoint 2010, is a SharePoint solu- tion architect focused on designing custom applications with SharePoint, Ofce, and Microsoft Business Intelligence technologies. Reza is the founder and president of Development Horizon, where he has helped many clients architect and build large-scale, mission-critical SharePoint applications. He also speaks in many local and international conferences. Reza achieved the status of Microsoft Most Valuable Professional (MVP) for SharePoint in 2006, which he still is today. He has also co- authored several books, papers, and articles. Reza can be reached at reza@devhorizon.com. www.it-ebooks.info [...]... Associations Starting Workflows Selecting Your Solution Method SharePoint 2010 Native Tools SharePoint Workflow Tools SharePoint Workflow Templates Microsoft Office Visio 2010 Premium SPD 2010 132 133 134 134 136 136 138 148 151 Conditions 151 Actions 154 Workflow Options and Features 160 Visual Studio 2010 171 Summary 173 Chapter 7: Administrating SharePoint 2010 with PowerShell 175 Getting Started 176 Starting... deepen one’s understanding and knowledge in SharePoint 2010 It is meant to be a guide for those in the field that suddenly find themselves needing to create custom SharePoint solutions Who This Book Is For This book is for SharePoint or NET Developers who now need to implement solutions in SharePoint 2010 These are developers that may have been exposed to some SharePoint development but haven’t spent... www.it-ebooks.info Part I Using SharePoint Technologies and Exploiting Functionality ⊲⊲ Chapter 1: Leveraging the SharePoint Object Model ⊲⊲ Chapter 2: Creating Visual Web Parts ⊲⊲ Chapter 3: Customizing Search ⊲⊲ Chapter 4: Leveraging the SharePoint Lists Web Service ⊲⊲ Chapter 5: Custom Field Types, Content Types, and List Definitions ⊲⊲ Chapter 6: Workflow ⊲⊲ Chapter 7: Administrating SharePoint 2010 with PowerShell... parts are the primary UI building block within SharePoint They are modular elements that you can place on almost any page within SharePoint SharePoint ships with a large number of web parts, but it will often be necessary to write your own Within SharePoint 2010, there are two types of web parts: visual web parts and traditional web parts Back in the days of SharePoint 2007, there was only a single type... this book If you need to become an expert in SharePoint 2010 solutions, this book takes you down that road What This Book Covers This book covers the main aspects of customizing SharePoint from branding and creating web parts, to exploiting the SharePoint API and building workflows PowerShell administration is discussed and explained The Search features of SharePoint are demonstrated and customized Full-scale... TO PROVIDE a wide coverage of complex solutions to common needs and desires from SharePoint 2010 implementations along with great reference material for digging in and learning the new platform; an excellent guide and handbook for people in the field There are plenty of books to ramp up and learn how to do things with SharePoint; however, this book focuses on the main areas of customization and provides... Leveraging the SharePoint Object Model SharePoint provides a rich and complex object model for working with SharePoint data Although it is challenging to master the details of the SharePoint object model, an even greater challenge that many developers face is taking their knowledge of the object model and using it to craft a solution that delivers on a set of requirements By its nature, SharePoint solutions... Customizing SharePoint SharePoint is a powerful platform that offers many points of extension and customization You can’t cover everything that SharePoint encompasses within a single chapter, but this chapter highlights some of the most common bits of functionality that you are likely to need to implement in your role as a SharePoint developer www.it-ebooks.info 4 ❘ CHAPTER 1 Leveraging the SharePoint. .. Finding Content with Alerts 70 Summary 71 Chapter 4: Leveraging the SharePoint Lists Web Service Web Services Overview 73 73 SharePoint Web Services Introduction Instantiating a Web Service Setting Credentials Querying Lists and List Items Modifying the SharePoint Location Retrieving Lists from a SharePoint Location Retrieving List Items from a SharePoint List Modifying List Items 73 73 76 78 78 79 79 83... \_layouts\ and SharePoint does not secure them assuming the user has access to the site, so you need to check user access within your own code www.it-ebooks.info 8 ❘ CHAPTER 1 Leveraging the SharePoint Object Model Figure 1-4: pplication page in SharePoint A Custom Lists SharePoint Lists provide a flexible and extensible way for users to store data within SharePoint and is frequently . 411 www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SharePoint ® 2010 Field Guide www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SharePoint ® 2010 Field Guide Steve Mann Colin. www.it-ebooks.info www.it-ebooks.info PROFESSIONAL SHAREPOINT 2010 FIELD GUIDE INTRODUCTION xxi PART I USING SHAREPOINT TECHNOLOGIES AND EXPLOITING FUNCTIONALITY CHAPTER 1 Leveraging the SharePoint