locked
Creating Site Definition RRS feed

  • Question

  • Hi all,

    I need to create a Custom Site Definition in MOSS 2007. But my Client is not interested in Providing Visual Studio or SharePoint Designer. Can I create a site which includes Content of Content Types Galleries,Custom Site COlumns and Having some lists Predefined content and Some 5 Sub Sites.These all should be created automatically when I select my custom Site Template in Central Admin. I did Initial research and found out that Save as Site Template option in Site Settings does not serve the purpose and hence there is a need to create  a site definition using SharePoint Object Model. After discussing this with the client he told that he cannot provide VS or SPD . I am blank and need some other way to get through this scenario. If any of you have any suggestions on this please direct me.

    Thanks

    • Edited by Mike Walsh FIN Friday, March 4, 2011 5:20 AM MOSS 2007 default and not useful in Title.
    Friday, March 4, 2011 5:00 AM

All replies

  • Is the client aware that SPD 2007 is free ?
    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Friday, March 4, 2011 5:21 AM
  • Hi,

    Save site as Template should work for you. Why you didn't go for it??


    Thanks,
    Chanakya
    Friday, March 4, 2011 5:36 AM
  • Hi Mike,

    I think that the client know that SPD is free. But he doesn't prefer customization. Indeed need a custom site definition with out SPD or VS.. Iam in a dilemma. what should be done. if you have any ideas please share.

    Friday, March 4, 2011 6:05 AM
  • Hi Chanakya,

    Thanks for the reply. But Save as site template is not including Custom Content types or Sub Sites when a new site is created. And thats the reason I routed to Site Definition. Creating a site Definition needs SPD or VS but client is not interested in either...

    So Whats Next...? Thats my question.

    Thanks,

    Friday, March 4, 2011 6:07 AM
  • Hi,

    Are you trying to move your site from Production to live??

    The requirement you specify is more of a backup restore type than creating a site definition.


    Thanks,
    Chanakya
    Friday, March 4, 2011 6:22 AM
  • Hi Chanankya,

    A kind of Prod to live. The Site Definition which  I create will be used by the users to create the site for their Specific Purpose. He already have a site definition which performs the same from a third Party vendor. he wants to completely abort it and get a new one.Thence the rework...

    :)

    Thanks

    Friday, March 4, 2011 7:02 AM
  • Hi,

    In that case you may go for a Site Definition. But that will make your complicated.

    You can check the details here http://www.windowsitpro.com/article/web-parts/customizing-sharepoint-site-templates.aspx

    Better solution can be keep the site as back up, whenever you need to create a site create one using the backup (Let the admin do this step). From there the user starts customizing or using the site.

    This suits better for you.


    Thanks,
    Chanakya
    Friday, March 4, 2011 7:12 AM
  • The only way to create a custom Site Definition is to create a SharePoint Package (WSP). Saving an existing Site as Template will give you a Site Template which is different than a Site Definition in many ways.

    Since a Site Definition is nothing more than a collection of text files packed in a CAB archive (WSP) you could create it even using Notepad: the point is that it is development process rather than configuration/customization.


    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 5:32 AM
  • Hi Waldek,

    I think the discussion is going Out of Scope here. Let me revise my requirement. I need to create a site with Some prediefined lists,content types associated with them,and some web parts and few sub sites in it. Now if I use Site Templatefrom UI , It is not giving content types and site columns.and Sub Sites. So I am in a dilemma to go with Site Definition or not. Now you please suggest me whether to go with site template or Definition. If you choose Site Definition , then also tell me that whether I can do this via some configuration of XML files or do I need to really use Object model to accomplish this. This is my question in summary for which I have posted here.

    Thanks

     

    Monday, March 7, 2011 5:52 AM
  • As far as I know the only way to accomplish this is to create a custom Site Definition. Using the Site Provisioning Provider you can provision subsites while creating a site off your Site Definition. Since the structure of the subsites is specified as XML you don't need any custom code to accomplish this. If you want to know more about this approach you should have a closer look at the Publishing Site Site Definition which does exactly that. You can find its definition in the 12\TEMPLATE\1033\XML\webtempsps.xml file (look for the BLANKINTERNETCONTAINER#52 template near the end of the file).
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 6:27 AM
  • Hi Waldek,

    Thanks for the guidance. I am digging down the publishing site definition by creating two different sites for Collaboration site and Publishing site. But I am not able to find the exact structure of these sites while creating from Central Admin. I am searchig the location where the structure of the entire clooab and Publishing portal is defined. If you know where it will be provisioned. please share with me. Waiting for your reply.

    Thanks,

    Monday, March 7, 2011 8:00 AM
  • The structure is defined in the 12\TEMPLATE\XML\InternetBlank.xml file.


    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 8:07 AM
  • Hi Waldek,

    I think you were talking about Publishing Portal template. I also need Collaboration Portal file location so that I can spot out my differences and proceed further. If you do know it, again please share with me.

    Thanks,

    Monday, March 7, 2011 8:15 AM
  • It's in 12\TEMPLATE\SiteTemplates\WebManifest\portalwebmanifest.xml.
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 8:18 AM
  • Hi Waldek,

    Thanks for the Info, i have a doubt in those files . They refer to a site definition through Site Definition Attribute. A sample code is given below.

     <web name="Search"
               siteDefinition="SRCHCENTERLITE#1"
              displayName="$Resources:cmscore,IPPT_Portal_SearchCenterLite_DisplayName;"
              description="" />

    In the above code Site Definition refers to SRCHCENTERLITE#1 it means that this web site should use that site definition SRCHCENTERLITE. and #1 referes to configuration Id right...? But I am unable to find the COnfiguration Id with 1 in it .Please clarify me regarding this.

    Monday, March 7, 2011 8:29 AM
  • The SRCHCENTERLITE#1 definition is located in the 12\TEMPLATE\1033\XML\webtempsrch.xml file.
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 8:38 AM
  • Actually all the site definitionare present in 12\Templates\Site Templates Directory. But why we are referring to 12\TEMPLATE\1033\XML\ folder for this site..? and what about the BLANKINTERNET#1 which is used in Blank Internet Sote definition where is this file and more over why aren't these are avialable in the site definition's ONET.XML...? Please clarify

    Thanks,

    Monday, March 7, 2011 8:46 AM
  • Hi Waldek,

    Thanks for your Help. I have found the location of definition files in the WEBTEMPSPS.xml itself. Hope I can find my req met. But what should I do fol Default lists to be included and content types and columns to be associated with those lists, Branding if any...?

    Thanks,

    Monday, March 7, 2011 8:52 AM
  • You are correct: all the Site Definitions are located under 12\TEMPLATE\SiteTemplates directory. However the XML files that I mentioned are not Site Definitions: they are used by the Portal Provisioning Provider to describe the structure of subsites that should be created while creating the site. Those files can be located anywhere within the 12\TEMPLATE directory. The XML files that you saw are specific for the standard Portal Provisioning Provider which is a part of MOSS 2007. You could however create your own Portal Provisioning Provider (which is nothing more than a class deriving from a specific class) that would create the sites either fully in code or from other resource such as XML file, CSV file, etc.
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 9:05 AM
  • I suggest you take a look at Site Definitions which are a part of SharePoint to see which one of them is the best match for your requirement. Then you could create a new Site Definition based on that definition and customize it further to match your requirements.
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 9:06 AM
  • Hi Waldek,

    I am very grateful to you for your guidance. I am trying to create a site definition and hope it goes well. But in case i find an issue I will definitely revert to you. But till now I haven't got any idea of how to include lists and associate content types to them. i am even able to specify sub sites in the site definition but need more info for lists. I am trying on this if you have any info on this please share. Once again thanks for your help.

    Thanks,

    Pavan

    Monday, March 7, 2011 10:34 AM
  • There are many ways of how you can include a List Instance in a Site Definition. The best way to keep the Site Definition as minimal as possible and use Features to create List Instances. To create a List Instance using a Feature you can use either imperative approach using custom code with Feature Receiver or declarative approach using the ListInstance element. You can find some sample guidance in the following blog post: http://www.tonstegeman.com/Blog/Lists/Posts/Post.aspx?List=70640fe5%2D28d9%2D464f%2Db1c9%2D91e07c8f7e47&ID=91
    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 10:42 AM
  • Hi Waldek,

    Do I need to create a list Instance based on feature or can I create it independent of any feature on the site. Does this make my list types visible at any time independent of features activation? If yes then thats all I want na...? i just want to populate the site with predefined lists and content types for them. What are the extra benefits can I get if I use features for this purpose?

    Thanks,

    Monday, March 7, 2011 12:01 PM
  • It's not like you will create a List Instance that depends on a Feature. By activating a Feature you will create an instance of a list. This has nothing to do with visibility which applies to List Template and not List Instances.

    You could also hardcode List Instances in onet.xml. The downside of this approach is, that whenever you need to add/remove a list from the Site Definition you would have to create another version of the Site Definition since modifying onet.xml is not supported. If you will use Features for creating List Instances you will simplify the maintenance of the whole solution in the future.


    w: http://blog.mastykarz.nl | t: @waldekm | c: http://mavention.codeplex.com | c: http://mavention.nl
    Monday, March 7, 2011 12:11 PM
  • Hi Waldek,

    You mean to say  that if I activate the feature it will appear in create page of the site..? I think I understand what you are trying to explain.I will try it and see.So how come we deploy the Site definition as a WSP package in MOSS 2007 for client Environment?I am not using Visual Studio or any other tool. How can I package this site definition into a single WSP Package which could be deployable and used by client?

    Tuesday, March 8, 2011 7:42 AM