| By Kris Syverstad | Article Rating: |
|
| February 9, 2005 12:00 AM EST | Reads: |
54,639 |
Enable Document Versioning
Now that we have a document library for change requests, we need to enable version control so we can track changes made to the document. This can be accomplished by using VersioningEnabled attributes of the List element such as:
<List xmlns:ows="Microsoft SharePoint" Name="Change Requests" Title="Change Requests"
VersioningEnabled="TRUE" Direction="0" Url="Change Requests" BaseType="1" >
ExecuteUrl
Although CAML is a powerful tool for customizing your site definition, you will more than likely run into issues that can not be solved while using it. A case in point is the configuration of content approval for a list. If you need to turn content approval on for a specified list within your site definition there is currently no way to do this using CAML. However, there is a project attribute, ExecuteUrl, that can be used to execute a page from a specified Url whenever a site is created. Using this attribute allows you to create a code module that you can use to work directly against the WSS object model. This is a great way for dealing with those requirements that don't seem to have an eloquent solution from within CAML. The one downside to ExecuteUrl is that it only works from the WSS create wizard, so it won't work when creating Area sites from the portal, nor will it work from custom code where SelfServiceCreate is being invoked. If you decide to use a build script for deleting/creating sites during development, remember that the ExecuteUrl will not be invoked.
<Project Title="Project Management Site" ListDir="Lists" xmlns:ows="Microsoft SharePoint"
ExecuteUrl="_layouts/ConfigureProjectManagement.aspx"
CustomJSUrl
SharePoint uses quite a few JavaScript functions for providing menu options and other client-side functionality. You may find a need to disable one or more menu items from one of the context menus within a SharePoint list or document library. These lists are generated by the ows.js file; this file should not be edited. SharePoint provides a great way to override functions in the ows.js file by allowing for site definitions to invoke a custom JavaScript file. The CustomJSUrl property is specified within the project element of the ONET.XML file for your site definition. SharePoint will include the url for the javascript file after the inclusion for the ows.js file, which allows you to override functions and/or create new functions. For this example we will use a file named pm-ows.js that has been placed in the layouts virtual directory.
<Project Title="Project Management Site" ListDir="Lists" xmlns:ows="Microsoft SharePoint"
CustomJSUrl="/_layouts/pm-ows.js">
You should always provide a value for the CustomJSUrl property even if you don't currently have a need to override anything in the ows.js file. Doing so will allow you to easily incorporate custom functionality after sites have been created with your new site definition.
Deployment
To deploy your site definition, all you have to do is copy the site definition folder and the corresponding WEBTEMP file to the target server (assuming that you haven't created any custom Web parts) and then restart IIS.
Conclusion
Custom site definitions give you quite a bit of flexibility for creating sites that meet the specific needs of your domain by allowing you to customize and extend SharePoint. When your application requires that custom features be developed, tested, and then applied in a consistent and repeatable manner, you should consider this approach. By following the best practices described in this article you can greatly reduce the complexity of the development process.
Resources
Sidebar
VIRTUAL SITES
SharePoint implements a powerful architecture for extensibility by allowing Web applications to be virtualized across all WSS and SPS sites. However, this may not be very intuitive to you if you have tried to add pages by placing them directly in the wwwroot folder for the default server. SharePoint is implemented as an ISAPI handler and is programmed to allow Web applications to be virtualized. The benefit to you is that you can create a Web application and make it available across all of your sites, provided you place it in the correct location. The WSS administration pages are implemented in this manner. These applications are located in the layouts virtual directory that is mapped to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS. (For example, all WSS sites have a settings.aspx page that is accessible by using the layouts/1033/settings.aspx url from any site.) If you wish to create a new Web application and you don't want it to be virtualized, you can either create an excluded path from ISS or create a new virtual server that can host the application.
Published February 9, 2005 Reads 54,639
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kris Syverstad
Kris Syverstad is a Microsoft Most Valuable Professional (MVP) for SharePoint Portal Server and a member of the Microsoft Collaboration &
Portals Developer Advisory Council. He leads the Rocky Mountain SharePoint
Users Group, and has been invited to present on SharePoint Best Practices to Microsoft Product Teams and at Microsoft's Architectural Summit.
![]() |
shirley 11/04/08 01:03:31 AM EST | |||
We can assist here as we specialize in developing and implementing SharePoint – that’s all we do. There is more information on this at http://www.nsynergy.com/Services/Pages/default.aspx or mail to Mark.Davis@nsynergy.com |
||||
![]() |
Gery D. Dorazio 03/22/05 07:08:02 PM EST | |||
Kris, |
||||
![]() |
Amrita 02/21/05 01:09:36 AM EST | |||
Perfect,real nice explanation. |
||||
- Kindle 2 vs Nook
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Computing & Federal IT - What Does the Future Hold?
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Cloud Expo and the End of Tech Recession
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Eval JavaScript in a Global Context
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications

































