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.