This blog posting applies to Microsoft Office SharePoint Server 2007.
MySites are very interesting on many levels. When you start to think about how to architect, deploy or customize them, you may encounter some initial confusion and a lack of detailed information. For instance, did you know that your MySite’s Home page and the My Profile page are in completely different site collections? What’s up with that?
The reason is that a My Profile page is provided for every user in the portal regardless of whether they have a MySite, or even if MySites is disabled. Actually, a single page renders every MyProfile page: http://mysite/person.aspx. This page has code that displays a “Home” tab linking to the user’s MySite at http://mysite/personal/userid/default.aspx if it exists. The Home tab makes it appear that these two pages are part of the same site. But the URLs hint at the truth: the My Profile page is on one site collection, while the user’s MySite Home page is on another.
You knew each MySite is hosted in its own site collection, right? When a MySite is created for a user (see below), that user is added to the Owners group for the new site collection, and is also added to the Site Administrators list. This user has full power over their MySite. To customize that is a bit difficult, but possible.
I created a Visio diagram that depicts the relationships between the pages, where profile information is used on them, and how the links between them interact.
Screenshot (click to download the diagram)
What happens when you browse to http://mysite/?
Whenever you browse to http://mysite/, you’re redirected to http://mysite/personal/userid/default.aspx through a few steps:
http://mysite/default.aspx inherits from Microsoft.SharePoint.Portal.WebControls.MySiteHostHomePage. This assembly authorizes the user against the MySite shared service rights (can be enabled/disabled by users or groups), then emits an HttpResponse.Redirect to either /_layouts/MySite.aspx or /_layouts/AccessDenied.aspx, accordingly.
/_layouts/MySite.aspx inherits from Microsoft.SharePoint.Portal.WebControls.CreatePersonalSpace. This assembly examines the user profile property Personal site.
If the Personal site property is blank, CreatePersonalSpace creates a new MySite site collection for this user, then stores its relative URL (e.g. “/personal/userid/”) in the Personal site property.
CreatePersonalSpace then emits an HttpResponse.Redirect to the URL in the Personal site property.
You arrive at http://mysite/personal/userid/default.aspx, where “mysite” is the URL of the web application hosting your MySites, and “userid” is your user id.
Note, other configurations could change this URL, such as the Personal Site Location (“personal”) and the Site Naming Format (whether “userid” should include your domain.) These settings are found on the SSP Admin page “My Site settings.”
Steve Peschka has the best information for customizing MySites, including how to set a custom master page automatically for all new MySites being created… this one’s not obvious! Steve has a very clever approach that uploads an XML file to each new MySite, containing instructions on what should be modified. Then, a control in the custom master page reads the XML file and performs the customizations. He explains why this approach is necessary.
His XML spec for customizations provides several things you can do, such as removing/adding web parts and modifying QuickLaunch links. He doesn’t provide a way to change the permissions of the owner… look for another blog posting from me on how to do that when you want to restrict the rights of each MySite’s owner.
A Belated Update: the My Settings page
Because I still have a hard time finding this info, here’s the explanation of why some customers find that clicking on a user name takes them to the My Site persondetails.aspx page while others only see the simple WSS userdisp.aspx page.
All people links go to http://SiteCollectionURL/SiteURL/_layouts/userdisp.aspx?ID=17&Source=… And this page decides whether to redirect to the My Site provider defined in the SSP that the Web Application containing the content site collection is assigned to based on one of the following rules:
- Host name of the My Site web application matches the site from where userdisp.aspx is called (i.e. both web applications are running on different port numbers)
- The site collection where userdisp.aspx is called from has a Portal Connection setting which is set to the My Site url (this would add the My Site to the start of the breadcrumb navigation for OOTB master pages which most customers don’t want).
From Ian Morrish at http://www.wssdemo.com/Blog/Lists/Posts/Post.aspx?List=b853926a%2Db04e%2D4620%2D94e4%2D88a5d56cb262&ID=427&Web=d47402ad%2D1767%2D42ba%2Da072%2D133479a9bb5a. Ian describes the situation in detail, plus an unsupported fix. A supported method extends his approach to use a delegate control: http://solutionizing.net/2008/12/08/user-profile-mysite-redirect-via-delegate-control/. This references a CodePlex solution created to do this, at http://www.codeplex.com/Solutionizing/Release/ProjectReleases.aspx?ReleaseId=20923.
To enable/disable MySites, Managing MySite Creation and Usage.
If MySites are disabled, Where is My Picture stored? What if MySites are off?