locked
Site Creation - additional custom steps RRS feed

  • Question

  • Building a SharePoint infrastructure for my organization. The portal when live, would enable groups to create their own subsites ( e.g HR, Finance, etc). However whenever a site is created, I would need some additional steps to be done mandatorily by the site creators. I'm envisioning following flow

    1. Create a subsite: using existing Createweb page, which lists site templates. Users can create with any of existing templates
    2. Collect data on groups specific to the group ( e.g HR Managers, HR Executivies) etc and create appropriate SharePoint Groups through code.
    3. Collect Metadata - e.g Business Group, Cost Center, Duration, Business Data Risk Category that helps me document the sites

    OOB, sharepoint allows me to do these as seperate steps, but looking at a workflow to tie these together which is triggered during site creation? I dont want to comprimise on #1 ( as most solns in net point to collecting data in seperate form and create site through code)

    Appreciate any solution for this.
    Monday, August 24, 2009 8:44 AM

Answers

All replies

  • I would recommend the technique of "feature stappling"... This technique enables you to add your custom feature to a site definition (site template).

    for example, i add my featureX to the custom list template ==> every time a custom list is created my feature X is executed

    than you can use the feature eventhandlers to attach custom code to your template...

    I think it is even better to create a new template for this :)


    more info: http://blogs.msdn.com/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx

    MCT,MCTS - http://www.tomvangaever.be
    Monday, August 24, 2009 10:35 AM
  • Tom - Appreciate responding to the question. Aware of the feature stapling option. However the tasks I want to do involves getting user input ( e.g which business group, cost center etc), which to my understanding isnt possible with features.

    Only (fallback) option I'm considering  is to create a custom "createweb" page, where in I can collect custom datapoints other than site name, description etc and do the extra steps. Any thoughts on this? Hope not inviting additional problems/constraints.
    Monday, August 24, 2009 2:55 PM
  • On one of my projects I created a custom application page for creating customer sites.  The application page had a form which captured some meta data and allowed the user to create a web using a particular site template.  The operation of creating a site takes a few seconds so I wrapped the code in a SPLongOperation http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splongoperation.aspx.  This displays the gears and a message whilst the code is executing.  Andrew Connell has a good article for creating a code behind application page http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx

    Hope this helps

    Dave
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    • Marked as answer by sraju Tuesday, August 25, 2009 12:41 PM
    Monday, August 24, 2009 3:28 PM
  • The other alternative is to create the webs in the site directory, choose unique permissions so that SharePoint will provision the site groups and modify the sites list to include your extra meta data.
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Monday, August 24, 2009 3:30 PM