Udostępnij za pośrednictwem


My Site Pages and Architecture

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: https://mysite/person.aspx. This page has code that displays a "Home" tab linking to the user's MySite at https://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)

MySite page relationships 

What happens when you browse to https://mysite/?

Whenever you browse to https://mysite/, you're redirected to https://mysite/personal/userid/default.aspx through a few steps:

  1. https://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.
  2. /_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.
  3. You arrive at https://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."

Customizing MySite

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 https://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:

  1. 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)
  2. 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 https://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: https://solutionizing.net/2008/12/08/user-profile-mysite-redirect-via-delegate-control/.  This references a CodePlex solution created to do this, at https://www.codeplex.com/Solutionizing/Release/ProjectReleases.aspx?ReleaseId=20923.

See also
To enable/disable MySites,
Managing MySite Creation and Usage .
If MySites are disabled,
Where is My Picture stored? What if MySites are off?

Comments

  • Anonymous
    February 22, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/02/23/mysite-pages-and-architecture/

  • Anonymous
    February 25, 2008
    MySite Mark Arend hat in einer Visio-Grafik die Zusammenhänge der MySite grafisch aufgearbeitet Schon

  • Anonymous
    February 25, 2008
    MySite Mark Arend hat in einer Visio-Grafik die Zusammenhänge der MySite grafisch aufgearbeitet Schon

  • Anonymous
    February 26, 2008
    I wonder if you ever saw this error for users who don't have Mysite ( Create personal site is unchecked and SP1 has been applied) who try to edit their profile, manage links,... NullReferenceException: Object reference not set to an instance of an object.]   Microsoft.SharePoint.Portal.MySiteMapProvider.get_Home() +50   Microsoft.SharePoint.Portal.MySiteMapProvider.GetRootNodeCore() +3615   System.Web.SiteMapProvider.get_RootNode() +12

  • Anonymous
    February 26, 2008
    This is great info, thank you sir!

  • Anonymous
    February 27, 2008
    Haifa, I have not seen this specific error.  Were MySites enabled for a time, perhaps some were created, but then they were disabled?  Is the "Use personal features" permission enabled?  As a test, maybe you could enable MySite creation, attempt to create a MySite and see if there are further errors.  Then disable MySite creation again and test My Profile.  The My Profile page should work when MySites are disabled in the way you mention.

  • Anonymous
    February 28, 2008
    Mark, thanks for looking at my question. The "Use personal features" permission is enabled. Users that have  created mysite don't get this error and able to get to "http://mysite/_layouts/editprofile.aspx" and all other links like quicklinks.aspx,... When I enable MySite creation the error is going away (user can edit links and profile) simply because Mysite is immediately created for the user who did not have it and was receiving the error. This kind of problem started after SP1 has been applied.

  • Anonymous
    April 22, 2008
    Hi Arend, I have been following your comments related to MySite modifications. Had been of great use. Had a new customization in my project where I have to add new nodes for the top navigationbar along with MyHome and MySite. Can you guide through the steps to be followed to develop a new sitemap provider or any other ways of achiving this. thanks & regards, Shilpa

  • Anonymous
    September 04, 2008
    Sous entendu comment modifier les My Site de MOSS 2007 avant création et leur maintenance après création.

  • Anonymous
    March 01, 2009
    SharePoint Customize a publishing page layout How-To Delete SharePoint Shared Services Provider (SSP