More Visual How-To’s

It seems that my buddy in crime Ted Pattison also has spent some evenings talking to his laptop the last couple of weeks. There are a couple of brand new visual how-to's available on the MSDN site:

Activating Auditing Programmatically for a Single Document Library in Windows SharePoint Services 3.0
Microsoft Windows SharePoint Services 3.0 includes a powerful new infrastructure for auditing user access to pages, and document and list items. You can enable auditing for an entire site collection, but it can be more efficient to enable auditing with more granularities. For example, you might want to enable auditing for one specific list or document library. You can go even further and just enable auditing for one specific list item or one specific document.

Activating Auditing Programmatically for a Site Collection in Windows SharePoint Services 3.0
Microsoft Windows SharePoint Services 3.0 includes a powerful new infrastructure for auditing user access to list items, and documents and pages. In Windows SharePoint Services, auditing is configured on a site collection-by-site collection basis. It just takes a few lines of code to fully enable the auditing for an entire site collection. When you do this, Windows SharePoint Services writes an audit entry to its audit log each time a user views or modifies a list item, document, or site page.

Creating a Feature for an Entry Control Block Item in Windows SharePoint Services 3.0
You can add a custom menu item for an entry control block to a list item or a document in Microsoft Windows SharePoint Services 3.0 by creating a Feature with a CustomAction element. In this way, you can add custom commands to the default SharePoint user interface. These menu commands allow users to perform custom operations on items and documents. For example, you can create a custom menu item for an entry control block for a list item or document that redirects the user to a custom application page. Use this as a starting point to create business solutions that provide an intuitive user interface to automate domain-specific tasks on list items and documents.

Creating a Feature for the Site Actions Menu in Windows SharePoint Services 3.0
You can add a custom menu item to the default Site Actions menu in Microsoft Windows SharePoint Services by creating a Feature with a CustomAction element. In this way, you can add custom commands to the default SharePoint user interface. These commands are available to users as they move between pages on a SharePoint site. When you create a Site Actions menu item, you can configure it to redirect the user to any URL. For example, you can redirect the user to another Web site. You can also redirect users to a custom application page that allows them either to see a custom display of data, or to perform custom operations on the content within the current site.

Creating an Application Page in Windows SharePoint Services 3.0
You can create custom application pages to add user interface components to a custom solution based on Microsoft Windows SharePoint Services 3.0. Unlike site pages (for example, default.aspx), a custom application page is deployed once per Web server and cannot be customized on a site-by-site basis. Application pages are based in the virtual _layouts directory. In addition, they are compiled into a single assembly DLL. They are also used across all sites within a server farm. For these reasons, they perform better than site pages. With application pages, you can also add inline code. With site pages, you cannot add inline code.

Reading ListId and ItemId from an Application Page in Windows SharePoint Services 3.0
In Microsoft Windows SharePoint Services 3.0, you can create a menu item for an entry control block that redirects users to a custom application page. For example, the MSDN article Item-Level Auditing with SharePoint Server 2007 demonstrates how to provide each document within a document library with its own menu item in the entry control block. This menu item redirects the user to a custom application page that displays the audit history for that particular document. When a user clicks a menu item in the entry control block, it runs an application page. The code behind the application page typically must program against the list item or document that supplied the menu item. To do this, the application page must be able to identify the list item or document. Windows SharePoint Services does this by passing the information that identifies the list item or document to the application page in a query string. The page uses this information within the page-initialization code to create an SPListItem object and its containing SPList object.

Good work Teddy boy! Looking forward to next month when we're back on stage together.