MSDN Magazine - October 2008 - (Page 56) VENDOR-SPONSORED CONTENT 9. Custom Content Types Content types are designed to help users organize their SharePoint content in a more meaningful way. A content type is a reusable collection of settings you can apply to a certain category of content, such as documents and folders. For example, you can define a custom purchase order document type. Using Windows SharePoint Services, you can define custom columns to track metadata and behaviors such as workflow, forms, event handlers, and information policies that are specific to this document type. Let’s say you also want to define a custom contract for external vendors and store it in the same document library. Content types enable you to store multiple types of content in the same document library or list. Content types are independent of a SharePoint list location. After you define a content type, you can use it throughout an entire site collection. Content types let you extend functionality by allowing you to define additional settings, custom workflows and attributes. You can create content types by using the UI in Office SharePoint Server 2007, by using the Windows SharePoint Services object model, or via a SharePoint Feature. The Microsoft.SharePoint namespace provides an SPContentType class that represents a site or list content type that you can use to retrieve information and manipulate a content type programmatically. The following code example shows how to add a Status field to an existing “Projects” content type. SPWeb mySite = SPContext.Current.Web; SPContentType contentType = mySite.ContentTypes["Projects"]; StringCollection values = new StringCollection(); sc.AddRange(new string[]{ "Not Started","On Track","Completed" }); contentType.Fields.Add("Status",SPFieldTy pe.Choice, false, true, values); contentType.Update(); In the same way, Office SharePoint Server 2007 allows you to define custom user profiles and audiences so you can control authorization to SharePoint sites. You can use user profiles and audiences to target content and information in content pages. For example, you can show or hide Web Parts in a content page based on audiences. User Profiles In Office SharePoint Server 2007, user account property information is stored in a user profile store. Office SharePoint Server 2007 can import user profile information from Active Directory and Lightweight Directory Access Protocol (LDAP) domain controllers. Additionally, Office SharePoint Server 2007 supports the import of user profile information stored in databases or enterprise applications, such as SAP or Siebel, through the Business Data Catalog. You can even schedule incremental or full regular imports to the user profile store. After you define the source and populate the user profile store, access and configure user information programmatically by using either the object model classes in the Microsoft.Office.Server namespace or the User Profile Service Web Service. Audiences In Office SharePoint Server 2007, you can define audiences and content targeting based on audience rules, SharePoint groups, and Microsoft Exchange Server distribution list (DL) memberships. Office SharePoint Server 2007 also provides an Audience object model, implemented in the Microsoft.Office.Server.Audience namespace, that allows you to target content programmatically. If you are building Web Part solutions, you can implement the IRuntimeFilter2 interface to control which Web Parts are rendered at run time. The selection of Web Parts is based on a set of arbitrary parameters that are stored in the AuthorizationFilter property of the Web Part base class. Conclusion 10. User Management ASP.NET provides support for role-based authentication. This allows you to programmatically control different access levels for users to Web pages. For example, you can have a Web site that has pages that can be seen only by managers, and pages that can be seen only by vice presidents. ASP.NET provides a set of different membership and role manager providers that allow you to customize and control authorization in your application. That’s it—the first 10 artifacts you should learn about developing on the SharePoint Products and Technologies platform. As a professional .NET Framework developer, you can take advantage of SharePoint Products and Technologies to build components and enterprise solutions. For more information, see http://MSSharePointDeveloper.com http://MSSharePointDeveloper.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.