From what I can understand, you wants to automate a site creation process. Meaning to say that the created site should have some predefined settings according to your client request.
I have done something like that.
What I did was,
- I created a new site (based on the Team Site template), modified that site design, create some new document library and add some document template to the document libraries as the user requested.
- Next, I go to the SiteAction->Site Setting and click on the save site as template link. Fill out the details and CHECK the INCLUDE CONTENT. Then upload the template into the Solutions Galleries.
- Then I created a solution (application page) and put a link in the Site Setting and named it Create a new Department. When the user click this link, my solution will create a new site based on the template that I've specified. So they get all the initial setting a site should have based on the company policy.
- Thats not all, I will break inheritance, copied only the Visitor group and then create 3 new empty groups (Admin,Manager and Member) also change the master page.
Some of the code is as follow:-
SPWebTemplate targetTemplate = GetTemplate(currentWeb, templateName, 1033);
.....
using (SPWeb newWeb = web.Webs.Add(properUrlName, siteName, description, 1033, targetTemplate, false, false))
{
newWeb.AllowUnsafeUpdates = true;
string masterPageUrl = site.RootWeb.ServerRelativeUrl + "/_catalogs/masterpage/NeMaster.master";
newWeb.MasterUrl = masterPageUrl;
newWeb.CustomMasterUrl = masterPageUrl;
newWeb.Update();
SPGroup visitor = newWeb.Groups["Visitors"];
RemoveAllPermissions(newWeb, visitor.ID);
newWeb.Update();
Hope this answer your question.