Adding my support to Claytons/Sezai's approach - From (painful) experience coupling functionality into ONET.xml is bad news... I tend to look at the Site Definition as a container for the Features I want 'plugged in' for a particular type of site.
Now, this may be a slight diversion on the topic but thought I'd put this out thereJ... Something that's been troubling me for a while is the activation of Features with properties! As shown below, in ONET.xml you can specify properties to pass on to the feature property bag on activation/deactivation etc which is all well and good(you can also specify properties in the feature xml file). However, the problem comes when you want to subsequently activate/deactivate the feature on a particular site. Where would the Feature get these properties from because as stated before ONET.xml is only read at the time you create the site?! Is it that one needs to provide alternative functionality when using Features with properties? Or is there another way of activating Features with properties on a per site basis. Cheers, Lee From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sezai KOMUR Sent: Thursday, 7 February 2008 4:20 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question Reset to site definition resets customised files in the site to the site definition, but it doesn't 'pick up' ONET.xml changes, which are only read during provisioning. It resets all customised pages. Eg. ONET.xml contains my custom feature - <!-- MyCustomActions --> <Feature ID="3B9E163E-BE5F-4df7-8A16-556F2FCD59F5" /> It also contains some Publishing Settings <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/Mycustommaster.master"/> <Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/> Now if I edit the ONET.xml file, such as commenting out the MyCustomActions feature and change the ChromeMasterUrl setting or the WelcomePageUrl setting to different values. Then do an IIS reset, and then access the /_layouts/reghost.aspx page and select the Reset all pages in this site to site definition version option. My site still has my Custom Actions feature enabled and it still has the old ChromeMasterUrl and WelcomePageUrl it hasn't 'picked up' ONET.xml changes. Of course if you need to make these sorts of changes, you can easily activate/deactivate features separately as suggested by Clayton, you can also manually switch the Welcome Page and the Master Page for the site in site settings etc. ONET.xml is only read when you provision a new site. Sezai Kömür Senior Developer - BEng, BSc - Microsoft Certified Technology Specialist - http://www.moss2007.com.au/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Vranich Sent: Thursday, 7 February 2008 1:50 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question If you haven't customised the site from the Site Definition. You can reset to site definition which "should" pick up the new changes. Right? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sezai KOMUR Sent: Thursday, 7 February 2008 3:29 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question ONET.xml is used for PROVISIONING new sites, but if the site definition contains .aspx files then these are actually read from the file system every time (unless customised) Changes in ONET.xml are read from the XML file the next time you create a site. So you are stuck if you want your existing site to make use of changes in ONET.xml. You will need to 'magically' export out the content from your existing site, then re-create the site (provision a new site) using the updated site definition, then 'magically' re-import it in. 'magically' - using a custom built or third party content import/export tool Sezai Kömür Senior Developer - BEng, BSc - Microsoft Certified Technology Specialist - http://www.moss2007.com.au/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clayton James Sent: Thursday, 7 February 2008 1:18 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question Site Definition ONET.xml Changes to the Site Definitions ONET.XML file won't be reflected in sites that have previously been created. Changes will only be reflected only when you create new sites. Site Definition .aspx pages modified using notepad or VS.Net If these pages are modified with notepad or VS.net (not SPD) and existing sites haven't customised these pages using SPD then yes existing sites will take on these changes. Site Definition .aspx pages modified using SPD If the .aspx pages have been customised using SPD then they are stored in the content database so changes to the original files on file system won't change existing sites. Cheers CJ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ishai Sagi Sent: Thursday, 07 February 2008 01:53 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question Depends what changes...changes to aspx pages will affect the existing ones. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hodges, Kristen Sent: Thursday, 7 February 2008 2:43 PM To: [email protected] Subject: RE: [OzMOSS] custom site definition question Sadly no it won't pick up the changes automatically... but you can force it to reset to the Site Definition on a per site basis in site settings. This is MOSS 2007 I'm talking about here of course. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Saikovski Sent: Thursday, 7 February 2008 2:41 PM To: [email protected] Subject: [OzMOSS] custom site definition question Dear All, I am having a mental blank at the moment and I can't remember for the life of me how this works. If I create a custom site definition, create a new site based on that definition, make changes to the original site definition. Will the changes be reflected in my sites based on that definition, or do I need to recreate the sites? Can you refresh my memory. Cheers, Aaron ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.20/1261 - Release Date: 05/02/2008 08:57 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.20/1261 - Release Date: 05/02/2008 08:57 PM ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net
