Advanced Microsoft Content Management Server Development - Stefan Gossner - E-Book

Advanced Microsoft Content Management Server Development E-Book

Stefan Gossner

0,0
47,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Microsoft Content Management Server 2002 is a dynamic web publishing system with which you can build websites quickly and cost-efficiently. MCMS provides the administration, authoring, and data management functionality, and you provide the website interface, logic, and workflow. Microsoft SharePoint Portal Server (SPS) also features in the book. SPS 2003 enables enterprises to deploy an intelligent portal that seamlessly connects users, teams, and knowledge so that people can take advantage of relevant information across business processes to help them work more efficiently.You've mastered the basics of MCMS, and setup your own MCMS installation. You've only scratched the surface. This book is your gateway to squeezing every penny from your investment in MCMS and SPS, and making these two applications work together to provide an outstanding richness of content delivery and easy maintainability. As a developer, the Publishing API (PAPI) is at the heart of your work with MCMS, and this book starts by taking you on the most detailed tour of the PAPI you will find anywhere. As a live example, a component that reveals the structure of your MCMS site is created, taking you through how to manage the common elements of MCMS programmatically. Getting SharePoint and MCMS to work together is the next stop in the book. You will see how to use SharePoint's search engine to search MCMS content, publish content between the two systems, and create SharePoint Web Parts to draw content from MCMS.To ease your everyday work with MCMS, there are chapters on placeholder validation, and some useful custom placeholders for common MCMS tasks, such as a date-time picker, a placeholder for multiple attachments, and a DataGrid placeholder among others. There are a number of ways to consume MCMS content from the outside world, and we look at two exciting ways here; RSS and InfoPath/Web Services. The InfoPath solution provides another interface to MCMS content that allows content authors to concentrate on content and not the presentation. The book is rounded off with a number of must-have MCMS tips and tricks.

Revert a posting to a previous version
Change a posting's template
Build a recycle bin
Deal with links to deleted resources
Update a posting's properties directly from a template file
Re-write ugly URLs to friendly URLs
Export resource gallery items using the site deployment API (SDAPI)
Configure the position and size of the Web Author Console Dialogs
Get frames and IFrames to work correctly in a template file

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 730

Veröffentlichungsjahr: 2005

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Advanced Microsoft Content Management Server Development
Credits
About the Authors
Shared Acknowledgements
About the Reviewers
Introduction
What This Book Covers
What You Need for This Book
Conventions
Reader Feedback
Customer Support
Downloading the Example Code for the Book
Errata
Questions
1. Building CMS Explorer
A Central Administrative Tool: CMS Explorer
Creating the Workspace
The Four MCMS Publishing Modes
Determining the Current Publishing Mode
Changing the MCMS Publishing Mode
The Ugly URL Querystring Specifies the Publishing Mode
Toggling Modes with CmsHttpContext
Toggling Modes with CmsApplicationContext
Adding Querystring Parameters to the URL with CmsHttpContext.PropagateParameter()
Specifying the Parent Container
Rendering Collections in a DataGrid
Displaying Only Selected Properties in the DataGrid
Considerations for Template Galleries and Resource Galleries
Adding Custom Columns to the DataGrid
Building an Edit Menu
Building the Toolbar
The Up Button
The Refresh Button
The DropDownList
The Channels Button
The Templates Button
The Resources Button
The Completed User Interface
Using Reflection to List Properties and their Values
Updating Property Values
Summary
2. Managing Channels and Postings with the PAPI
Managing Channels and Postings
Creating Channels
Validating Names
Testing the Create Channel Dialog
Creating Postings
Connected Postings
Copying Postings
Moving Postings
Summary
3. Managing Templates, Template Galleries, and Resources
Managing Template Galleries and Templates
Creating Template Galleries
Creating Templates
Submitting the Template
Creating Custom Property Definitions
Creating Placeholder Definitions
Creating Connected Templates
Copying Templates
Moving Template Galleries and Templates
Managing Resources
Creating Resources
Replacing Resources
Deleting Objects
Summary
4. Preparing Postings for Search Indexing
Influencing Search Engines with the ROBOTS META Tag
The RobotMetaTag Control and Channel Rendering Scripts
Outputting META Tags
Using <%= %> within Template Files
Pulling META Tag Content from Custom Properties
Using Literal Controls
Overriding the Render Method of a Web User Control
Configuring Templates to Allow Postings to Return Accurate Last Modified Time
Dealing with Output Caching
Increasing Search Accuracy by Generating Search Engine Specific Pages
Interrogating the User Agent
Hiding Navigational Elements
Creating a Posting/Channel Listing User Control
Tips for Search Engine Optimization
Design and Navigation Considerations
Frames
Flash Content
Image Maps and JavaScript Navigation
Adding Details to the Title Tag
Using META Tags
Choosing your Keywords and Density
Description
Summary
5. Searching MCMS with SharePoint
MCMS Search Options
Microsoft SharePoint Portal Server Search
Preparing the MCMS Site for Indexing
Disabling Channel Names to Host Header Names Mapping
Assigning a Search Account
Enable Guest Access for Tropical Green
Output Caching and Last-Modified Dates of Postings
The Connector SearchMetaTagGenerator Control
Configuring SharePoint Portal Server Search
Creating a New Content Source
Creating a Content Source with the MCMS Connector Utility
Creating a New Search Scope
Creating a Content Source Manually
Search Rights for the MCMS Application Pool Account
Adding a Search Page to the MCMS Site
Searching with the MCMS SharePoint Connector
Building a Custom Search Implementation
About the SharePoint Portal Server Query Service
Building a Search Input Control
The Advanced Search and Results Page
Building the Microsoft SQL Full-Text Query
Building the MSQuery XML String
Summary
6. Publishing Content Between MCMS and SharePoint
Using MCMS and SharePoint Together
Joining MCMS and SharePoint in a Single Solution
Using SharePoint to Display MCMS Content
The MCMS Connector for SharePoint Technologies
Installing the MCMS Connector Web Parts
MCMS Page Listing Web Part
A Custom View for the MCMS Page Listing Web Part
The MCMS Pages in Production Web Part
The MCMS Pages Waiting for Approval Web Part
Limitations of the MCMS Connector for SharePoint
Using MCMS to Display SharePoint Content
The MCMS Connector for SharePoint Technologies
Using the SharePoint Document Placeholder
Limitations of the MCMS Connector for SharePoint
A Placeholder Control to Display SharePoint List Contents
Summary
7. Building SharePoint Web Parts
The SharePoint MCMS Navigation Control
Preparing the Development Environment
Creating the Web Part Project
Creating the Web Part
Defining Custom Properties for the Web Part
Developing Custom Properties for the Web Part
Building the Data Layer
Building the Presentation Layer
Web Part Deployment
Preparing the Web Part Description (.DWP) File
Preparing the Web Part Manifest File
Creating the Deployment Project
Executing the Deployment
Right-Click Deployment of Web Part CAB Files
Adding Our Web Part to a Page
Configuring the Web Part
Debugging the Web Part
Summary
8. Useful Placeholder Controls
Before We Begin
A Date-Time Picker Placeholder Control
The DateTimePickerPlaceholderControl Class
Loading the Controls for Authoring
Retrieving Saved Content
Saving the Date and Time
Validating the Date and Time
Presenting the Selected Date and Time
The Date and Time Picker Dialog
Adding the Placeholder Control to a Template File
A Placeholder Control for Multiple Attachments
The MultipleAttachmentPlaceholderControl Class
Generating the Table of Attachments
Deleting Attachments
Reusing the Insert Attachment Dialog
Calling the Dialog
Returning Values from the Dialog
Client-Side Script for All Types of Placeholder Controls
Passing Attachment Information to the Placeholder Control
Generating the WBC_setThinEditIEAttachment() Method
Saving the List of Attachments
Retrieving Saved Content
Preparing Arrays for Storing Information about the Attachments
Retrieving Previously Saved XML
Extracting Information about the Attachments from the XML
Populating the Table with the Saved Attachments
Displaying the Attachments
Using the MultipleAttachmentPlaceholderControl
An Image Rotator Placeholder Control
The ImageRotatorPlaceholderControl Class
Specifying the Resource Gallery
Loading the TextBox
Saving the Selected Resource Gallery Path
Loading Previously Saved Values
Rotating Images Randomly
Using the Image Rotator Placeholder Control
A Placeholder Control to Store All HTML Tags
The AllTagsHtmlPlaceholderControl Class
Saving All Kinds of Tags
Escaping Tags
UnEscaping Tags
Loading Content for Authoring and Presentation
Using the AllTagsHtmlPlaceholderControl
A DataGrid Placeholder Control
The DataGridPlaceholderControl Class
Loading the DataGrid for Authoring
Retrieving Placeholder Content
Saving the Modified XML
Adding a Row
Deleting a Row
Editing a Row
Updating a Row
Displaying the XML in Presentation Mode
Using the DataGrid Placeholder Control
Turning Off the Leave Warning Alert
Summary
9. Validating Placeholder Controls
Limitations of the ASP.NET Validation Controls
The MCMSValidators Project
Validating the HtmlPlaceholderControl
Retrieving the Current Value of the HtmlPlaceholderControl
Checking for an Empty HtmlPlaceholderControl
Matching Tags with Regular Expressions
Building the Required HTML Placeholder Validator
Overriding the ControlPropertiesValid() Method
Overriding the OnPreRender() Method
Overriding the AddAttributesToRender() Method
Overriding the EvaluateIsValid() Method
Adding the Custom Validator to the Template File
Preventing Pages with Invalid Content from Being Saved
Save New Page with Validation
Save and Exit with Validation
Save with Validation
Adding the Modified Buttons to the Authoring Console
Implementing Server-Side Validation
The HtmlPlaceholderControl with Validation
The RequiredHTMLPHValidator with Server-Side Validation
Checking the Length of Text Entered
Canceling the Save Operation
Validating the SingleImagePlaceholderControl
Retrieving the Value of the SingleImagePlaceholderControl
Checking for an Empty SingleImagePlaceholderControl
The RequiredImagePHValidator
Validating the SingleAttachmentPlaceholderControl
Stored Values of the SingleAttachmentPlaceholderControl
Checking for an Empty SingleAttachmentPlaceholderControl
The RequiredAttachmentPHValidator
Summary
10. Staging Static Pages
Site Stager in Brief
Installing Site Stager
Defining the Destination User
The Site Stager Administration Dialog
Creating a Staging Profile
Running a Job
Scheduling a Profile
Deleting a Profile
The ASP.NET Stager Application
The DotNetSiteStager Project
Configuring Stager Settings
Recording Messages to a Log File
Logging in as the ‘Stage As’ User
Revealing Hidden Postings
Staging Channels and Postings
Getting the Start Channel
Iterating Through the Channel Tree
Issuing an HTTP Request
Getting Responses and Creating Files
Staging Attachments
Collecting a List of Attachments to Download
Scanning Pages for Attachments
Storing Information about the Attachments to a List
Enhancing the Searches.GetByUrl() Method
Downloading the Attachments
Running the DotNetSiteStager
Suggested Improvements
Summary
11. InfoPath with MCMS Web Services
Project Overview
What are ASP.NET Web Services?
Creating the MCMS Web Service Project
Creating the Business Layer
Maintaining Custom Properties
Creating the Lightweight Template Class
Maintaining Placeholder Values
Maintaining Placeholder Collections
Creating an Object to Maintain Postings
Creating the ASP.NET Web Service
The GetPosting() Web Method
Configuring IIS Security
Testing the Web Service
The SavePosting() Web Method
Preparing the InfoPath Environment
Creating the InfoPath Document
Creating the Controls in InfoPath
Cleaning up the Generated Form
Testing the InfoPath Form
Saving the InfoPath Form
Possible Enhancements to this Solution
Summary
12. MCMS and RSS
Looking Ahead
The Structure of an RSS Feed
Providing Content as an RSS Feed
Creating the RSS Feed
Defining Global Settings in the Web.config
Testing the RSS Feed
Testing the RSS Feed in an Aggregator
Aggregating an RSS Feed into MCMS
Creating the Placeholder Control
Setting up the Authoring Interface
Retrieving and Parsing the RSS Feed
Rendering the RSS Feed in Presentation Mode
Adding the Control to a Template
Creating the Placeholder Definition in the Template
Adding the RSS Reader Placeholder to the Template
Testing the Template
Possible Enhancements
Enhancements to the RSS Feed Generator
Enhancements to the RSS Aggregator Placeholder Control
Summary
13. Essential How-Tos, Tips, and Tricks
Tip #1: How to Revert a Posting to a Previous Version
The Revert Page to Previous Version Dialog
How to Get and Sort a List of Page Revisions
Programming the Button that Triggers the Page Reversion Process
Accessing the ItemCommand() Event Handler of the DataGrid
Retrieving the Selected Revision
Triggering the Page Reversion Process
Rolling Back When the Reversion Process is Unsuccessful
Refreshing the Parent Window
Copying Content from One Placeholder to Another
Copying Custom Property Values
Adding the New Action to the Web Author Console
Tip #2: How to Change a Posting’s Template
The Change Template Dialog
Creating a Copy of the Posting Based on the New Template
Adding the Change Template Button to the Web Author Console
Tip #3: How to Build a Recycle Bin
Creating a Recycle Bin Channel
Deleting the Posting
Restoring the Posting
The Recycle Bin Dialog
Listing All Deleted Items in the Recycle Bin
Restoring a Deleted Item
Permanently Deleting Items from the Bin
Adding the Recycle Bin Button to the Web Author Console
Tip #4: How to Deal with Links to Deleted Resources
What Happens When Resources Used by Postings Get Deleted
Detecting When Placeholder Content has Changed
Identifying Links to Deleted Resources
Removing Links from ImagePlaceholders and AttachmentPlaceholders
Removing Links from HtmlPlaceholders
Handling Images
Handling Attachments
Tip #5: How to Generate a Resource Dependency Report
The FindResources Project
Walking the Tree
Scanning Placeholder Content for Resources
Generating the Report
Tip #6: How to Update Posting Properties Directly from a Template File
Designing the Web User Control
Getting the Posting’s Display Name
Hiding the Web User Control in Published Mode
Capturing the Posting’s Save Event
Tip #7: How to Re-write Unfriendly URLs as Friendly URLs
An HttpModule to Intercept All Requests
Converting Unfriendly URLs to Friendly URLs
Handling Unfriendly URLs Caused by Postbacks
Activating the HttpModule
Tip #8: How to Export Resource Gallery Items using the Site Deployment API
The SDAPIResourceExport Project
Setting Export Parameters
Collecting Resources
Creating the Service Posting
Starting the Export Process
Tip #9: How to Configure the Position and Size of the Web Author Console Dialogs
Tip #10: How to Get Frames and IFrames to Work Correctly in a Template File
When the Frame or IFrame Links to Another Site
When the MCMS Page is Embedded Within a Frame or IFrame of Another Website
Summary
A. Setting up MCMS and SPS on the Same Virtual Server
SharePoint and MCMS-Managed URLs
Creating a New Virtual Server
Creating a New SharePoint Portal
Creating a New MCMS Web Entry Point
Configuring SharePoint to Allow MCMS Requests
Trust Settings for MCMS Web Applications
Verifying that SharePoint and MCMS are Functioning Correctly
Summary
B. MCMS Connector for SharePoint Technologies
Installation
Leveraging SharePoint Portal Search within an MCMS Site
Integrating MCMS Content into a Portal site
Publishing SharePoint Document Library Documents within an MCMS Site
Additional Utilities Included
MCMS Connector Sample Data, Project, and Documentation
Summary
C. Installing the Tropical Green Website
Downloading the Sample Code
Creating the TropicalGreen Web Application
Adding the CMS Virtual Directory
Importing the Site Deployment Object File
Creating the Guest Account
Checking the Server Configuration
Setting www.tropicalgreen.net to Execute Locally
Configuring the Browser to Bypass the Proxy
Testing the Tropical Green Website
Index

Advanced Microsoft Content Management Server Development

Lim Mei Ying

Stefan Goßner

Andrew Connell

Angus Logan

Advanced Microsoft Content Management Server Development

Working with the Publishing API, Placeholders, Search, Web Services, RSS, and SharePoint Integration

Copyright © 2005 Packt Publishing©

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First edition: November 2005

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

www.packtpub.com

Cover Design by www.visionwt.com

Credits

Authors

Lim Mei Ying

Stefan Goßner

Angus Logan

Andrew Connell

Technical Reviewers

Mick Badran

Spencer Harbar

David Mielcarek

Chester Ragel

Christopher Walker

Joel Ward

Editorial Manager

Dipali Chittar

Development Editor

Douglas Paterson

Technical Editor

Richard Deeson

Indexer

Niranjan Jahagirdar

Proofreader

Chris Smith

Production Coordinator

Manjiri Nadkarni

Cover Designer

Helen Wood

About the Authors

Lim Mei Ying is a Senior Consultant with Avanade and has extensive experience in setting up MCMS systems at the enterprise level. She has spent many hours figuring out the dos and don’ts of the product, and enjoys finding new ways to solve MCMS-related problems.

She contributes actively to the newsgroup community and is a Microsoft Most Valuable Professional for Content Management Server. Mei Ying lives on the sunny island of Singapore and blogs at http://meiyinglim.blogspot.com. She also co-authored the earlier book, Building Websites with Microsoft Content Management Server (ISBN: 1-904811-16-7, Packt Publishing January 2005).

Note

Thanks to my husband, Louis, for the much needed support throughout the many months of writing. Special thanks to my family and friends for their encouragement.

Stefan Goßner works for Microsoft as an Escalation Engineer in the Developer Support department. He provides customers with technical solutions to problems related to Microsoft Internet Server Products. Stefan has a broad and deep understanding of all areas of MCMS. His contributions to the newsgroup community have helped many people implement MCMS solutions in corporations around the globe, to the point where it has been said that if you don’t know Stefan, then you’re probably new to MCMS.

He maintains a huge MCMS 2002 FAQ on the Microsoft website and provides MCMS tips and tricks on his personal blog at http://blogs.technet.com/stefan_gossner.

He lives in Munich, Germany.

Note

I would like to thank my girlfriend, Michaela, for her support throughout months of writing, reviewing, and coding for the book. Also many thanks to my colleagues in the European Developer Support Team and to my friends in the MCMS product team in the US.

Angus Logan is a Product Specialist at Data#3 Limited (http://www.data3.com.au), Australia’s leading IT solutions company, and is a Microsoft Gold Certified Partner. Angus is a MCAD.NET and MCDBA, as well as a Microsoft Most Valuable Professional for Content Management Server. His specialities are Content Management Server, SharePoint Portal Server, .NET development, SQL Server, and Customer Relationship Management (CRM).

You can usually find Angus in the microsoft.* newsgroups or blogging (http://www.anguslogan.com).

Angus gets a real buzz from using these technologies in a presales or delivery capacity to find solutions to his customers’ real-world problems.

Note

To my friends and family, especially Michael, thank you! Working with a great team on this book made all the time and effort worthwhile.

Andrew Connell has worked with content-management solutions since obtaining his degree from the University of Florida. As one of the original developers for the most successful versions of AdmiNET, a custom web content administration product, he has consistently focused on the challenges facing businesses today as they strive to maintain an up-to-date site without having to constantly rely on technical expertise.

Andrew’s background is in content-management solutions and web development using Microsoft technologies. He enjoys working with MCMS and integrating it with other products such as Microsoft SharePoint Products and Technologies.

As a Client/Server Consultant for Fidelity Information Services, Andrew has leveraged both MCMS and SharePoint Portal Server to redeploy Fidelity’s intranet site as a single solution that capitalizes on the best features of both products. In 2005, he was recognized as a Microsoft Most Valuable Professional for his contributions to the MCMS community.

Andrew lives in Jacksonville, Florida in the United States, and maintains a blog at http://www.andrewconnell.com/.

Note

Thank you to my wife, Meredith, and first born son, Steven, for their patience and support. Thanks to my girls Maggie and Sadie for providing me company during the many late nights it took to finish this project. Thanks also to my parents and brother for their support and the confidence they showed in me.

Shared Acknowledgements

We the authors would also like to thank the following people for supporting us and helping us along the way:

Our editors, Douglas Paterson and Richard Deeson, and the rest of the team at Packt for accepting our book proposal and for the wonderful work they have done in bringing this book to life.

Our project manager, Joel Ward, for his exceptional project management skills. Thanks for being there for us!

About the Reviewers

Mick Badran has been performing Microsoft technical classroom-based training for more than nine years, and has over 12 years commercial development experience in various languages. Mick has been consulting for Microsoft in areas of CMS, SPS, and BizTalk for over four years. Mick also specializes in customized training in these areas.

He can be reached at <[email protected]> and would love to hear your feedback.

Spencer Harbar is an MCSD.NET, MCSE, and MVP for MCMS, with over ten years commercial experience of architecture, design, development, deployment, and operational support of web-based applications, and hosting platforms for some of Europe’s largest organizations.

Spencer maintains http://www.mcmsfaq.com—an MCMS resources portal—and is active in the public newsgroups. His experience of MCMS goes back to the days of NCompass Resolution, and he has been involved in many enterprise implementations. Selected clients include Barclays Bank plc, ScottishPower plc, Microsoft, The Royal Bank of Scotland, Scottish Enterprise, HBOS, Centrica, BASF, and The Automobile Association.

Currently working as an independent consultant, Spencer delivers enterprise content management and portal systems architecture, design, development, and deployment solutions, application security best practices, threat modeling, and the implementation of highly available Windows Server System-based hosting platforms.

Spencer resides in Edinburgh, UK, and blogs at www.harbar.net.

David Mielcarek is employed as the Internet/Domain Administrator at Lower Columbia College in Washington State. Most of the time, he utilizes one of ten programming languages to get the job done.

Starting his career as a telecommunications cryptologist in the Air Force, he merged into the corporate world. Following a term with Lockheed, he increased his abilities by taking on larger positions. In 1994, the Internet became his mainstay, and it remains so to this day.

Juggling an educational position, outside-work through his GoldBorder.com site, and raising a family of three kids, 11 cats, two dogs, and two rats allows little time for his love of drawing. You can often find him taking his short breaks at the nearest table to pencil something in his art pad.

Chester Ragel is a Computer Professional, obtaining his degree in Computer Science and Engineering from the University of Moratuwa. He is an MCSD.NET holder, and enjoys working with Microsoft technologies.

Chester contributes to the MCMS community and several IT Magazines. He lives in Sri Lanka and can be found blogging at http://chestermr.blogspot.com.

Christopher Walker is a Senior Consultant with Microsoft Services, providing specialist advice on integrated portal solutions (SharePoint, MCMS, BizTalk, and InfoPath). Christopher has a background in portal development and technologies with Unisys and a portal software ISV.

Christopher contributes to the community through his blog at http://blogs.msdn.com/cjwalker/, providing real solutions to customers using Microsoft technologies.

Christopher lives in Brisbane, Australia.

Joel Ward works for Booz Allen Hamilton as a technical manager and developer. Joel likes to work on ASP.NET, MCMS, and SharePoint projects, and he helped create a .NET user group at Booz Allen. He has a background in design, programming, and architecture, and has worked with MCMS since its first release in 2001.

As a Microsoft Most Valuable Professional, Joel is acknowledged by peers and Microsoft for his active participation in the technical communities around the globe. Joel lives in Virginia in the United States.

Chapter . Introduction

Following on from Building Websites with Microsoft Content Management Server (Packt Publishing, January 2005, ISBN 1-904811-16-7), this book takes MCMS development to a higher level of both power and integration. Like its predecessor, this book is packed with code examples and never-before-seen secrets of MCMS.

Microsoft Content Management Server 2002 is a dynamic web publishing system with which you can build websites quickly and cost-efficiently. MCMS provides the administration, authoring, and data-management functionality and you provide the website interface, logic, and workflow. Microsoft SharePoint Portal Server (SPS) also features in this book. SPS 2003 enables enterprises to deploy an intelligent portal that seamlessly connects users, teams, and knowledge so that people can take advantage of relevant information across business processes to help them work more efficiently.

You’ve mastered the basics of MCMS, and have set up your own MCMS installation. But you’ve only scratched the surface. This book is your gateway to squeezing every penny from your investment in MCMS and SPS, and making these two applications work together to provide an outstanding richness of content delivery and easy maintainability.

What This Book Covers

Chapter 1 demonstrates the power of the MCMS Publishing API (PAPI) by building the CMS Explorer administration tool to manage an MCMS website. Chapter 2 builds on the CMS Explorer by adding the ability to manage channels and postings. Chapter 3 looks at the creation, submission, copying, moving, and deletion of templates, template galleries, and resources through the PAPI.

In Chapter 4, you will learn how to prepare postings for search indexing. We look at several techniques that can improve the accuracy of search results and optimize your search engine.

SharePoint Portal Technologies complement MCMS by providing collaboration, document libraries, and searching to the robust publishing workflow of MCMS. Chapter 5 takes you through the process of adding searching to an MCMS Site using SharePoint Portal Server, either using the MCMS Connector for SharePoint Technologies or by building your own solution.

Chapter 6 demonstrates how you can use the MCMS Connector for SharePoint to build your own components to share content between MCMS and SharePoint. Chapter 7 shows how you can build Web Parts that integrate content from MCMS on a SharePoint portal site.

Chapter 8 discusses five custom placeholder controls that provide some frequently requested features that are not present in the default controls: a date-time picker placeholder control, a placeholder control that permits multiple attachments, an image-rotator placeholder control, a placeholder control to store all kinds of HTML tags, and a DataGrid placeholder control.

Validation of content is a key requirement in many MCMS implementations. Chapter 9 looks at how you can apply ASP.NET validation techniques to each of the out-of-the box placeholder controls.

Static pages are often used in direct mailers, help files, and even for archiving purposes. Chapter 10 discusses a couple of techniques that you can use to create static snapshots of postings.

The authoring experience doesn’t always need to be through the browser. One author-friendly way of maintaining content is detailed in Chapter 11. In this chapter, we leverage the power of InfoPath to quickly create a GUI that allows authors to submit content directly from Microsoft Word, with the help of MCMS Web Services.

Since the release of MCMS in 2002, a lot of technologies have changed. Syndication of websites using RSS is the norm, and to capitalize on this, Chapter 12 takes you through the steps involved in creating a dynamic RSS feed of your website’s recent changes.

Finally, Chapter 13 provides many invaluable insider’s tips and tricks for MCMS, as well as solutions to common MCMS issues, including gems such as how to revert a posting to a previous version, change a posting’s template, build a recycle bin, and export resource gallery items using the Site Deployment API.

What You Need for This Book

This book has been written for ASP.NET developers with a sound grasp of C#. To use this book, you need to have access to the following:

Visual Studio .NET Professional or higher (2002 or 2003 version).Microsoft Content Management Server 2002 Developer or Enterprise edition. You can also use the Standard edition, but be aware that some features will not be available. A 120-day evaluation version of the Enterprise edition is available at http://www.microsoft.com/cmserver.

To install and run Microsoft Content Management Server 2002, you will need the following:

The .NET Framework 1.0 or 1.1.One of the following operating systems: Windows Server 2003, Windows 2000 Professional, Windows 2000 Server, or Windows XP Professional.An installation of SQL Server 2000 Developer or Enterprise edition.

Some of the chapters utilize Microsoft SharePoint Portal Server 2003. For these chapters, you will need:

The .NET Framework 1.1.Windows Server 2003.An installation of SQL Server 2000 Developer or Enterprise editions.An installation of SharePoint Portal Server 2003. A 120-day evaluation version is available at http://www.microsoft.com/sharepoint.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an e-mail to <[email protected]>, making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, then please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, then see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we want you to get the most from your purchase. Packt’s Customer Support is here to try to make sure that happens, and there are a number of ways we can help you.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/support, and select this book from the list of titles to view any example code or extra resources available for download for this book.

Note

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our books’ contents, mistakes do happen. If you find a mistake in one of our books—be it a mistake in text or a code error—we would be grateful if you could report this to us. By doing this you can save other readers from frustration, and also help to improve subsequent versions of this book.

To report any errata you find, visit http://www.packtpub.com/support, select your book, click on the Submit Errata link, and enter the details of your errata. Once your errata have been verified, your submission will be accepted and added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Building CMS Explorer

The Building Websites with Microsoft Content Management Server book (Packt Publishing, January 2005, ISBN 1-904811-16-7) makes extensive use of MCMS’s Publishing Application Programming Interface (PAPI). We show how to use it to provide custom functionality within template files, to add business processes to workflow events, to tailor the Web Author Console, and to implement forms authentication for the Tropical Green site, which the reader builds as they progress through the book.

The PAPI is in fact a huge library. You could code with it for months and still find new tricks you never knew existed! This is the first of three chapters that compliment the understanding you will have gained from the book and attempt to take your understanding of the PAPI to another level. Follow along as we demonstrate several highly useful techniques and show how they can be leveraged in a real-world scenario, as we apply them to the Tropical Green site.

Note

Where can I download a copy of the Tropical Green website?

The code files for the Tropical Green website created over the course of the earlier book are available as a download package on this book’s download page. Go to the Packt website at http://www.packtpub.com/support/, and choose Advanced Microsoft Content Management Server Development in the dropdown.

A Central Administrative Tool: CMS Explorer

We put some serious thought into creating an example that would not only give you a thorough grounding in the more advanced methods available in the PAPI but would also leave you with a tool that you will find handy in your day-to-day MCMS work. From our own experiences as MCMS developers working in the time-critical world of the software industry, one thing that we have found invaluable has been a custom MCMS administrative tool. In the first three chapters of this book, we walk you through the process of building such a tool, which we will name CMS Explorer.

Here’s how CMS Explorer will look once completed:

The interface is made up of two sections:

At the top of the page (in case you hadn’t guessed, we’re going to create the tool as a web application), you’ll see a toolbar. The toolbar provides a drop-down list with options to create new postings and channels. It also has three buttons: one to toggle to a list of channels and postings, a second to list template galleries and templates, and a third for resource galleries and resources.The second half of the page is a DataGrid. The grid lists the items in the current container. Each row has an Edit button, which reveals a list of actions for each object when clicked.

For navigation, you can move in two directions: click on the name of the container to see what’s in it, or use the Up button on the toolbar to move up one level.

Why build a tool when the out-of-the box-solution provides not one, but three tools to manage MCMS objects? There’s already a Site Manager and the Web Author as well as the Template Explorer available within Visual Studio .NET. There are several reasons why building the CMS Explorer tool is worthwhile:

Firstly of course, you’ll get first-hand experience in using many of the more advanced methods from the PAPI. After building this tool, you will not only be very comfortable with the PAPI but also well on your way to becoming an expert in it!Although the PAPI contains a large collection of classes, it doesn’t cover everything. While it would be nice for the CMS Explorer to be able to do everything that the tools shipped with MCMS can do, it can’t go beyond what’s available in the PAPI. One of the secondary objectives of the next few chapters is to highlight the PAPI’s limitations.Finally, this tool could quite likely be useful in your daily work. There are some actions that can only be done using Site Manager, some that are available only within Web Author, and others exclusive to Template Explorer. For example, you would use Site Manager to create a channel and switch over to Web Author to create postings within it. CMS Explorer attempts to fill in this gap by providing as much functionality as possible from a single location.

Note

You can download the entire sample from the code download section of the Packt site, at http://www.packtpub.com/support/.

Creating the Workspace

Let’s start by creating a work area for the CMS Explorer tool. Create a new Visual C# MCMS Web Application Project in Visual Studio .NET.

Name the new project CMSExplorer.Get the Styles.css file from the book’s code download. Select Project | Add Existing Item and add it to the CMSExplorer project.Create a new folder and name it images. Download the image files for this tutorial from the code download section of the book’s companion website and add them to the project.Right-click the CMSExplorer project in the Solution Explorer and select Properties. Click Designer Defaults. Set the Page Layout field to Flow. This will set the default layout to flow instead of grid for all web forms created in the project. Click OK.Right-click the Console folder and select Delete.Add a new web form to the CMSExplorer project, and name it default.aspx.In Design view, drag and drop the Styles.css file from Solution Explorer onto the form. This applies the stylesheet to the page.Switch to HTML view. Add the table below between the <form> tags to provide the basic structure of the page. We use a litCurrentContainer Literal control to display the name of the current container. The lblPublishingMode Label will be used later to display the current publishing mode.
<table cellSpacing="0" cellPadding="0"> <tr> <td> <table> <tr> <td valign="top"> <asp:Image runat="server" ID="imgTitle"></asp:Image> </td> <td valign="center"> <h1> <asp:Literal ID="litCurrentContainer" runat="server"/> </h1> </td> </tr> </table> <asp:Label ID="lblPublishingMode" runat="server" CssClass="BodyText"/> </td> </tr> <tr> <td width="100%" bgcolor="#cccccc">(Space for Toolbar)</td> </tr> <tr> <td>(Space for DataGrid)</td> </tr> </table>
Toggle to Design view. Double-click on the form to get to its code-behind file. Above the namespace declaration, import the Microsoft.ContentManagement.Publishing namespace.
//MCMS PAPIusing Microsoft.ContentManagement.Publishing; namespace CMSExplorer { /// <summary> /// Summary description for _default. /// </summary> public class _default : System.Web.UI.Page { . . . code continues . . . } }