SP2010 MySites – Part Six: MySite Centric

MyProfile

This is the sixth article in a series which explores the SharePoint 2010 MySite features. This article will discuss the approach taken to use the MySite as the centre of the intranet.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010
  2. Anatomy, we delve inside the MySite and dissect its inner secrets
  3. Customisation for Branding, how to change the look and feel
  4. Customisation of My Content page, how to change the page layout and contents
  5. Customisation of a MySite Blog, how to alter the Blog
  6. The MySite centric intranet, putting the MySite at the centre of the universe – This Article

The approach

 

To understand how to approach using the MySite as the homepage we need to examine the distance and control of information for a user. This will help to explain the compelling reason for using the technical MySite approach as the homepage for the intranet.

The following diagram all follow the same theme, you as the user is the top left. As the axis moves further to the right the information is consumed/shared with more people. As the axis move down from ‘Me’ that user has less control of the authoring and creation of the information.

First is the MySite. Here the user has full unlimited control to the information and functionality available. The concept is similar to that of iGoogle where a use can add the widgets to the page they want. This section is not really consumed by other people and is really about that individuals context.

SocialIntranetOveriew1

Second is the Profile. This again is closely controlled by the individual user but starts to have outside influence from such things as HR or Active Directory entries. This information begins to be used and consumed by other people. This in concept is similar to a LinkedIn or Facebook profile.

SocialIntranetOveriew2

Third is Team Sites. This is where an individual use begins to collaborate or consume information shared with more people. Examples might be Wikipedia, YouTube and forums.

SocialIntranetOveriew3

Forth is the Community Sites. These sites move away from the traditional organisation team/unit and more towards natural work team sites. Again these are collaborative consume and contributed to by many.

SocialIntranetOveriew4

Fifth are the Corporate Sites. These sites are what can termed the ‘traditional’ intranet. The sites are authored by only a small number of users and consumed by many. This is normally where Marketing and Internal Communication sites are located.

SocialIntranetOveriew5

Sixth is External access. While not technically a content section the ability to access the platform from any location is important to the user.

SocialIntranetOveriew6

Finally are the Search, communicator and desktop sharing capabilities which should underpin the entire platform.

SocialIntranetOveriew7

Conclusion

 

So that wraps up the MySite series. Hopefully this has shown how the MySite is constructed and how it can be customised in a supportable manner. And finally how to view its positioning in the information architecture design for an intranet platform.

SP2010 MySites – Part Five: Blog

MyProfile

This is the fifth article in a series which explores the SharePoint 2010 MySite features. This article will examines the default Blog creation and highlight changes required to customise this default.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010
  2. Anatomy, we delve inside the MySite and dissect its inner secrets
  3. Customisation for Branding, how to change the look and feel
  4. Customisation of My Content page, how to change the page layout and contents
  5. Customisation of a MySite Blog, how to alter the Blog – This Article
  6. The MySite centric intranet, putting the MySite at the centre of the universe

The challenge

 

By default the OOB MySite contains a web part which gives the user a quick prompt to create a personal blog on both the default.aspx and the persons profile page.

image

When clicked this will create a sub site based on the Blog site definition. It provisions a new blog site with some default data. So which approach do you take if you wanted to add additional functionality or change that default data for the blog site? The obvious answer would be to create the required features and staple these to the Blog site definition.

So assume we have several stapled features which replace the default content and make some additional tweaks to provision a client specific ‘enhanced’ blog. In theory when the user clicks the link to ‘Create Blog’ these features will get activated during site creation and all will be sorted.

You have to consider that stapled features can’t act upon anything being provisioned in the definition modules. If you examine the Blog site definition you’ll see that the lists and data are provisioned this way. So you need to take another approach to modify the data within provisioned lists. One approach would be to use the List provisioned or Site provisioned event handlers and put the logic there.

Well this works without error but the end result is not what you’d quite expect.

Unexpected results

 

So nothing unusual there, the blog created with no errors, works as it should and is still based on the OOB Blog site definition. But the custom data is not there and blog posts were not showing in the NewsFeed. Fearing something was fundamentally broken the investigation began. The following is the details about what’s going on in depths when the user clicks ‘Create Blog’

The fundamental problem was that when the user clicks this specific web part link it goes through some MySite specific logic to attach three event receivers to the Post list.

The ‘Microsoft.Office.Server.UserProfiles.BlogListEventReceiver’ needs to have the item added, updated and deleted events registered against the blog site Post list. This handler is responsible for generating the ActivityFeed change marker which drives the activity gathering event generation.

The OOB page contains the Microsoft.SharePoint.Portal.WebControls.BlogView web part. This web part checks for the existence of a property bag property of ‘urn:schemas.microsoft.com:sharepoint:portal:profile:blogwebid’ if this is not null or empty it renders the link for creating a new blog site. The generated url is something like ‘/_layouts/MySite.aspx?Blog=1’. As you can see this is pointing at the MySite aspx page but interesting has a query string value. This is the important part. Normally this page will simply check the existing user has a MySite and create one if not. With the query string value of ‘Blog=1’ it’s also instructed to generate a blog.

The logic basically checks the ‘urn:schemas.microsoft.com:sharepoint:portal:profile:blogwebid’ to see if a blog exists (will navigate to it if it did). If no value is set the the code will activate the ‘MySiteBlogs’ feature. This feature generates the site then sets the property. Once the site exists it will modify the list items adding the generic values. Final step is to associate the ‘Microsoft.Office.Server.UserProfiles.BlogListEventReceiver’ handlers.

With this knowledge in hand a quick addition to the custom blog stapling feature had them also attaching the missing handlers.

That fixes the missing Activity events but the data still appears to be wrong. During the execution of site creation the MySite.aspx modifies the data in the lists and replaces it with versions it chooses. The only 100% accurate way of stopping is to implement all this functionality in a page/handler yourself and adjust the blog web part link to point to your custom code instead.

What’s next?

 

So now we’ve seen some of the MySite specific extras for Blog sites. In the next article we’ll examine using the MySite functionality as the default homepage for an intranet.

SP2010 MySites – Part Four: My Content

MyProfile

This is the fourth article in a series which explores the SharePoint 2010 MySite features. This article will examine the ways that you can customise the default page for the MySite. It will describe the common requirement and how to approach them in a supportable and scalable fashion. The walkthrough will provide an example implementation which you can tailor to your exact needs.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010
  2. Anatomy, we delve inside the MySite and dissect its inner secrets
  3. Customisation for Branding, how to change the look and feel
  4. Customisation of My Content page, how to change the page layout and contents – This Article
  5. Customisation of a MySite Blog, how to alter the Blog
  6. The MySite centric intranet, putting the MySite at the centre of the universe

The challenge

 

With the up take of Social media and the focus many organisations are now putting on the MySite capability of SharePoint it is becoming more common for people to want customisations to the default page. Now before we get all excited and break out Visual Studio lets cover some basics. You’re not supported to modify the MySite Personal site definition which provisions the default aspx page. This could have you scratching you chin and turning to ‘Bing’ for answers. You also need to consider things like scale, first time site creation and on going performance and upgradability for future enhancements.

There are a couple of articles out on the web SharePoint Team and CKS MySiteCreate 1.0 Production. These solutions have an interesting approach of stapling modification features and using a control which performs the required page changes during load for the first render. After reading and walking through this approach I can see several things that are not optimal. First it forces you to change the masterpage in order to provision the one containing the actioning control. Second the actioning control itself, to be blunt this ‘smells’ to me.

Using a UI element to perform one time customisation doesn’t feel that smart. Although it only executes on the first page load per user the overhead for the user waiting for the required logic can lead to increased page load after the MySite is created. After testing, this process was found to often fail to execute in time and the user had a strange experience where the page sometimes looked empty until a refresh.

Following evaluation it became apparent that to perform customisations on large scale and have them consistently performant another approach was needed.

The new approach

 

After some tinkering over a particularly wet weekend I had a eureka moment. The stapling approach was right, but what about setting up the page? Well thinking a little laterally it becomes obvious. The MySite personal is like any other site, go to the root and it picks up the default page url and loads it. Anyone familiar with Publishing features knows that these sites allow you to set the ‘welcome page’ of any site. This means that if you browse http://sp/ for example it works out to render http://sp/pages/default.aspx instead.

After a quick test using SPManager to set the welcome url to a different page my suspicions were confirmed. You can indeed change the default page and therefore point it to another page other than default.aspx. Armed with this knowledge lets look at how we can create a feature set to provision and apply the MySite customisation.

So the basic elements for customising the default page are the following:

  • Feature to activate and add the relevant web parts. (covered in article six)
  • Feature to provision the new aspx page.
  • Feature to change the set the welcome page.
  • Feature to staple the above to the MySite Personal template.

The basic solution structure

 

Lets create a new Farm solution and add the basic structure to it.

image

The CustomPage feature is responsible for provisioning the custom page to the site. The WelcomePage feature sets the welcome page to the custom page. The Stapler feature associates these features with the MySite Personal site definition. There is a module to provision the custom page, and finally the stapling elements to ensure these features gets activated against the MySite on creation.

The CustomPage feature

 

The CustomPage feature provisions the customised aspx page and includes the web part provisioning as required. If you’ve got complex requirements you may wish to create more features to activate the required web part features as dependencies.

So lets look at the elements:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="CustomPage" Path="CustomPage">
    <File Url="CustomPage.aspx">
    </File>
  </Module>
</Elements>

As you can see this simple elements provisions the custompage.aspx. If we were adding web parts to this custom page we’d add this to the all user web parts elements. For this article we’re not going to deal with this customisation. Although at this point it’s definitely worth mentioning the complexity if you want to keep the Shared and Personal documents views. As you’ll be aware these are provisioned from the Onet file and therefore it’s likely the list instances won’t exist when your stapled custom page feature fires. You’ll need to decide the best approach to provisioning list views from these ONET lists if you need them. As you’ll see in article six of this series we’re going to implement something quite different to the OOB so I’m not going to cover this now.

Another thing this feature is responsible for is activating the WelcomePage feature to set the page as the site welcome page. The reason we make this custompage feature responsible for it’s activation is that the welcome page property will throw an exception is the url is not resolvable.

[Guid("c61637c6-760f-4449-b997-08467930597f")]
    public class CustomPageEventReceiver : SPFeatureReceiver
    {
        #region Methods

/// <summary>
        /// Occurs after a Feature is activated.
        /// </summary>
        /// <param name="properties">An <see cref="T:Microsoft.SharePoint.SPFeatureReceiverProperties"/> object that represents the properties of the event.</param>
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            base.FeatureActivated(properties);

SPWeb web = properties.Feature.Parent as SPWeb;

if (web != null)
            {

// Get the depended-upon Feature definition.
                SPFeatureDefinition featureDefinition = null;
                try
                {
                    featureDefinition = SPFarm.Local.FeatureDefinitions[new Guid("9e852c4f-93c4-401e-a947-968fa85fb985")];
                }
                catch (Exception ex)
                {
                    //Log here if you wanted
                    throw;
                }

web.Features.Add(featureDefinition.Id);
            }
        }

#endregion

}

The WelcomePage feature

 

The WelcomePage feature sets the web root folder welcome page. This is done via the feature receiver which contains the following code:

[Guid("8616b35f-efa6-4c69-9c2f-809e50fb99ef")]
    public class WelcomePageEventReceiver : SPFeatureReceiver
    {
        #region Constants

//The mycontent.apsx
        private const string CUSTOMPAGE = "custompage.aspx";

//The default.aspx
        private const string DEFAULTPAGE = "default.aspx";

#endregion

#region Methods

/// <summary>
        /// Occurs after a Feature is activated.
        /// </summary>
        /// <param name="properties">An <see cref="T:Microsoft.SharePoint.SPFeatureReceiverProperties"/> object that represents the properties of the event.</param>
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            try
            {
                SPWeb web = properties.Feature.Parent as SPWeb;

if (web != null)
                {
                    SetDefaultPage(web, CUSTOMPAGE);
                }
            }
            catch (Exception ex)
            {
                //Do the logging here
                throw;
            }
        }

/// <summary>
        /// Occurs when a Feature is deactivated.
        /// </summary>
        /// <param name="properties">An <see cref="T:Microsoft.SharePoint.SPFeatureReceiverProperties"/> object that represents the properties of the event.</param>
        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            try
            {
                SPWeb web = properties.Feature.Parent as SPWeb;

if (web != null)
                {
                    SetDefaultPage(web, DEFAULTPAGE);
                }
            }
            catch (Exception ex)
            {
                //Do the logging here
                throw;
            }
        }

/// <summary>
        /// Sets the default page.
        /// </summary>
        /// <param name="web">The web.</param>
        /// <param name="page">The page.</param>
        protected virtual void SetDefaultPage(SPWeb web, string page)
        {
            #region Guard

if (web == null)
            {
                throw new ArgumentException("Web was null");
            }

#endregion

SPFolder rootFolder = web.RootFolder;

rootFolder.WelcomePage = page;
            rootFolder.Update();

web.Update();
        }

#endregion
    }

This gives you an example of how to change the default page for the MySite personal. The code would need some embellishment to be production ready but gives you a good starting point.

The Stapling feature

 

The Stapling feature staples the CustomPage feature to the MySite Personal site definition to ensure that when new sites are created the custompage.aspx is provisioned and set page to the default page.

The elements looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!– CustomPage –>
  <FeatureSiteTemplateAssociation Id="9dd6c130-4752-4ec7-910b-9b6be3cafb53" TemplateName="SPSPERS#0"/>
</Elements>

And that’s all there really is too it.

Before and after

 

Before the features are deployed the MySite created looks like the following:

image

It’s hosted under the standard url, which for example looks like ‘http://my/sites/administrator/default.aspx’.

After the Stapling feature is activated on the MySite web application the new MySites will change to our custom page. For the purposes of the example I’ve just dropped in a new paragraph of text. In reality you might make fundamental structural changes.

image

The major advantage is the light touch this approach makes. I’m a great believer that whenever customisations are made to SharePoint they should always leave you in a supportable and cleanable state. This approach leaves the OOB default.aspx alone and thus should you ever need to revert back to OOB you have that capability.

What’s next?

 

This article has laid some foundations to much deeper levels of customisation. It opens up structural as well as content changes as possible customisations. In the next article we’ll examine in more detail how to customise the blog feature for MySite to embellish the default blog site and how it gets created.

SP2010 MySites – Part Three: Branding

MyProfile

This is the third article in a series which explores the SharePoint 2010 MySite features. This article will examine the ways that you can change the look and feel of the MySite. We’ll look at the ways you can modify the visual elements and also the techniques you can employ to apply custom branding such as masterpage and a custom theme.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010
  2. Anatomy, we delve inside the MySite and dissect its inner secrets
  3. Customisation for Branding, how to change the look and feel – This Article
  4. Customisation of My Content page, how to change the page layout and contents
  5. Customisation of a MySite Blog, how to alter the Blog
  6. The MySite centric intranet, putting the MySite at the centre of the universe

Global Navigation

 

One of the most common questions I’ve been asked by developers in my teams is ‘How do I apply the company logo to the MySite?’. Now you can go straight in and start whipping up a new masterpage to include the design changes, but there is a much similar way. The v4.master used on the MySite contains a little known ‘Delegate Control’ with the ID of ‘GlobalNavigation’. (This is around line 58 of the masterpage if viewing in SPD2010).

Those of you who saw my CKSDev presentations at either the UK or India SharePoint Saturday’ events would have seen me use this delegate to add the SPS logo to all the site headers.

So you can see in the OOB MySite the GlobalNavigation control displays the menu, welcome control and help icon. In the picture below the global navigation control is the darkest area at the top.

image

Understanding the OOB

Before we create our own control lets examine the OOB one further so we understand what it’s giving us. As you read in the last article both the MySite host and personal site definitions activate a web scoped feature called ‘MySiteNavigation’. This is the feature we’ll be taking a closer look at.

The feature ‘My Site Navigation’ {6ADFF05C-D581-4c05-A6B9-920F15EC6FD9} is located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteNavigation\Feature.xml.

The contents of the feature definition are as follows:

<Feature Id="6ADFF05C-D581-4c05-A6B9-920F15EC6FD9"
    Title="$Resources:spscore,PeopleFeatures_MySiteNavigation_Text;"
    Description="$Resources:spscore,PeopleFeatures_MySiteNavigation_Desc;"
    Version="14.0.0.0"
    Hidden="TRUE"
    Scope="Web"
    ReceiverAssembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
    ReceiverClass="Microsoft.SharePoint.Portal.UserProfiles.MySiteNavigationFeatureReceiver"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
        <ElementManifest Location="mysitenavigationfeatureelements.xml"/>
    </ElementManifests>
</Feature>

The feature references an ‘ElementManifest’ and ‘FeatureReceiver’. Lets look at the work the ‘FeatureReceiver’ does first. The class responsible is the ‘MySiteNavigationFeatureReceiver’. On activation it simply sets a property on the SPWeb object. As below:

SPWeb parent = properties.Feature.Parent as SPWeb;
if (parent != null)
{
    parent.AllProperties["AllowSubwebsOnTopNavigation"] = true.ToString();
    parent.Update();
}

On deactivation it removes this property. As below:

SPWeb parent = properties.Feature.Parent as SPWeb;
if ((parent != null) && parent.AllProperties.ContainsKey("AllowSubwebsOnTopNavigation"))
{
    parent.AllProperties.Remove("AllowSubwebsOnTopNavigation");
    parent.Update();
}

The ‘ElementManaifest’ content is as follow:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Control Id="GlobalNavigation"
           Sequence="100"
           ControlSrc="~/_controltemplates/mysitetopnavigation.ascx" />
</Elements>

As you can see it is creating a ‘Delegatecontrol’ pointing to an ascx file in the controltemplates folder and has a sequence number of 100. The full path to the ascx is {SharePointRoot}\TEMPLATE\CONTROLTEMPLATES\MySiteTopNavigation.ascx.

Custom delegate control

So to customise the global navigation we need at least two things. The first is a new ‘DelegateControl’ feature with a lower sequence than 100 to deploy our custom control, the second is the control itself.

There is a decision to make about how to create a custom control. You can create a new ascx control and nest the OOB control inside it. This is most appropriate if you’re only planning on subtle changes above or below the OOB control. The other option is to copy the OOB control ascx contents into a new ascx and make the required changes there. This would be most appropriate if you plan to heavily customise the visual or functionality. For the purpose of this article we’ll go with the nested approach for simplicity.

I’d recommend installing CKSDev Visual Studio extensions to speed up your development here Winking smile but then I’m part of the project team so have a slight bias Smile with tongue out I’m going to describe this process using CKSDev but the OOB tooling will support the same process just with a few more steps.

  1. Create new SharePoint project.
  2. Create the project as a Farm solution as we need to push a asmx onto the SharePointRoot.
  3. Add a new UserControl to the project. This will be the control displayed in the delegate. The project will now look something like this:image
  4. Open up the ascx and add a temporary block of html such as a <p>Hello World</p> tag. We’ll do this to check the wiring before going to the effort of changing the control. In case you don’t know, if a ‘DelegateControl’ throws an error nothing with show in the UI. So a good technique is to wired up the control and test it first without any of the added complexity to ensure its working. This could save you of stress hours Winking smile
  5. Next lets create the ‘DelegateControl’, CKSDev provides a SPI for this but you can use an empty OOB element to achieve the same results.image
  6. Enter the following propertiesimage
  7. We don’t need any properties for the control so click finish without any changes on the second page.
  8. Rename the Feature1 to something more sensible and set the propertiesimage
  9. Deploy the project to the MySite and you’ll see that instead of the OOB navigation we now get ‘Hello World’ as you can see belowimage
  10. We can now be confident that our feature, delegate control and ascx are all hooked together and work.
  11. So back to the ascx file to add the banner and OOB navigation control.
    1. Add the banner image into the project, you can choose where you store it but for simplicity I’ve chosen the SharePointRoot images folder.
    2. Add the required markup to the ascx file, for example something like the following

      <%@ Register TagPrefix="wssuc" TagName="MySiteTopNavigation"
      src="~/_controltemplates/MySiteTopNavigation.ascx" %>
      <style type="text/css">
      .TopBody {
           background-color: #21344A;
      }
      </style>
      <div class="TopBody">
      <img src="_layouts/images/custommysite/spsuk.png" alt="Our Banner" />
      </div>
      <wssuc:MySiteTopNavigation ID="OOBNav" runat="server"/>

    3. The project will now look something like thisimage
  12. Redeploy the updates and you should see the changes as belowimage

There you have it, custom global navigation and we’ve been nowhere near the masterpage.

Masterpage and CSS

 

I’m not that great at CSS and front end development in general and will defer any in depth example or advice on the finer points to people I consider the experts:

In high level terms you can build and apply custom masterpage and CSS in the same way you can with any other SharePoint site.

Custom theme

 

SharePoint 2010 provides a new way to change some of the colours within the site. The old Theme mechanism was a little bit tricky but the new one runs off the PowerPoint theme files. This gives the end user to put a little bit of there own styling choice into their site without the need for development, SPD access. Each site contains over 15 themes to choose from and they are stored within the theme gallery.

The user can change the theme by browsing to the ‘Site Settings’ page and under ‘Look and Feel’ selecting ‘site Theme’. The following page then allows the user to select a different theme and apply it to their personal MySite.

image

After applying the theme the site will now have a new scheme applied for example the above selection changes the personal site to look like this

image

Creating a custom theme

So if the OOB themes aren’t to your liking how about creating a custom one. Well in order to create a new custom theme you need to have access to PowerPoint 2010.

So lets create a custom theme and apply it to the site using a feature. We’ll start from an existing theme file for simplicity, but you can create one from scratch as well.

  1. Using the Visual Studio Server Explorer browse your site and locate the ‘Theme gallery’ node.
  2. Select a theme we’ll use as the base and right click.
  3. From the context menu select ‘Export this theme’, choose a save location and save the file.
  4. Open it in PowerPoint 2010.
    1. Select the ‘Design’ tab on the ribbon.
    2. Select ‘Colors’ option.image
    3. Change the required colours and save them. For this example I’m just going to change the background to a tasty lime greenimage
    4. Select the ‘Fonts’ option.image
    5. Make the required changes and save them.
    6. Final step is to save the theme file. Expand the themes ribbon section and click ‘Save current theme’.image
  5. We now have a thmx theme file we can upload directly into our site or deploy via a feature. We’ll go with the feature deployment as manually it’s like any other file upload to a gallery Winking smile
  6. Add a new module to the project and add the thmx file into the module.
  7. Append the module contents with the following

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module Name="CustomThemeModule"
              Url="_catalogs/theme"
              RootWebOnly="TRUE"
              Path="CustomThemeModule">
      <File Type="GhostableInLibrary"
            Url="CustomAzure.thmx"
            IgnoreIfAlreadyExists="true" />
    </Module>
    </Elements>

  8. Add a new feature to deploy the themes.
  9. Your project should look something like thisimage
  10. Deploy the project and your custom theme should now be available in the themes pageimage
  11. Add a feature receiver to the themes feature and added the following to the code

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        SPWeb web = properties.Feature.Parent as SPWeb;
        ThmxTheme.SetThemeUrlForWeb(web, "/_catalogs/theme/CustomAzure.thmx");
    }

    public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
    {
        SPWeb web = properties.Feature.Parent as SPWeb;
        ThmxTheme.SetThemeUrlForWeb(web, "");
    }

  12. Deploy the project and this time the theme should get auto applied, and removed on deactivation.
  13. So the final project looks something like this
  14. image

What’s next?

 

Hopefully you can see how you have several options to customise the look and feel of the MySite. In the next article we’ll examine in more detail how to customise the default page.

SP2010 MySites – Part Two: Anatomy

MyProfile

This is the second article in a series which explores the SharePoint 2010 MySite features. This article will examine the various elements that get brought together to form a MySite in SharePoint 2010. Gaining a detailed understanding of these elements will help us to target areas during customisations. As with most areas of SharePoint I believe it’s important to understand what you have before cracking open Visual Studio to make customisation.

If you’ve never setup MySites before there is information in TechNet http://technet.microsoft.com/en-us/library/ee624362.aspx.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010
  2. Anatomy, we delve inside the MySite and dissect its inner secrets – This Article
  3. Customisation for Branding, how to change the look and feel
  4. Customisation of My Content page, how to change the page layout and contents
  5. Customisation of a MySite Blog, how to alter the Blog
  6. The MySite centric intranet, putting the MySite at the centre of the universe

The MySite Host

 

The MySite Host is the shared site collection which provides shared elements within the MySite such as profile page, newsfeed page. This site is created as the root site collection of a web application configured for MySites.

MySite Host site definition

The site definition is located in {SharePointRoot}\TEMPLATE\SiteTemplates\SPSMSITEHOST\

Top bar navigation

The definition provisions the following global navigation nodes:

  • ‘My Newsfeed’ which goes to the default.aspx page.
  • ‘My Content’ which goes to the _layouts/mysite.aspx page.
  • ‘My Profile’ which goes to the person.aspx page.

image

Quick Launch navigation

The definition provisions the following quick launch navigation nodes:

  • ‘Overview’ which goes to the person.aspx page.
  • ‘Organization’ which goes to the organizationview.aspx page.
  • ‘Content’ which goes to the personcontent.aspx page.
  • ‘Tags and Notes’ which goes to the _layouts/thoughts.aspx page.
  • ‘Colleagues’ which goes to the _layouts/MyContactLinks.aspx page.
  • ‘Memberships’ which goes to the _layouts/MyMemberships.aspx page.

image

Configuration 0

The primary configuration activates the following Site features:

  • ‘My Site Host’ {49571CD1-B6A1-43a3-BF75-955ACC79C8D8} located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteHost\Feature.xml.
  • ‘My Site Layouts’ {6928B0E5-5707-46a1-AE16-D6E52522D52B} located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteLayouts\feature.xml.

The primary configuration activates the following Web features:

  • ‘My Site Navigation’ {6ADFF05C-D581-4c05-A6B9-920F15EC6FD9} located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteNavigation\Feature.xml.
  • ‘Shared Picture Library for Organizations logos’ {5EDE0A86-C772-4f1d-A120-72E734B3400C} located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteHostPictureLibrary\Feature.xml.
  • ‘Team Collaboration Lists’ {00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5} located in {SharePointRoot}\TEMPLATE\FEATURES\TeamCollab\feature.xml.

Default Module provisions the following files:

  • blog.xsl
  • tagprofile.aspx
  • person.aspx
  • default.aspx

Blog xsl

The blog.xsl is used for the blog web part.

Tagprofile.aspx

The tag profile page displays the tag profile information. It is reached from the tags and notes page tag hyperlinks.

The web parts provisioned to this page are:

image

Person.aspx

The person profile page displays the information about an individual profile. It is reached from the ‘My Profile’ link in the global navigation or from the people search results links for other individuals.

The web parts provisioned to this page are:

image

Default.aspx

The default page displays the individuals news feed. This is all the activity from their colleagues.

The web parts provisioned to this page are:

image

The MySite Personal

 

The MySite Personal is the individual MySite site collection which provides elements within the MySite. This site is created as a site collection of a web application configured for MySites under a managed path, normally ‘personal’. The site collection is created when an individual requests access to the Mysite.aspx for the first time.

MySite Personal site definition

The site definition is located in {SharePointRoot}\TEMPLATE\SiteTemplates\SPSPERS\

Top bar navigation

The definition provisions no global navigation nodes.

Quick Launch navigation

The definition provisions the following quick launch navigation nodes:

  • ‘Documents’ as an area.
  • ‘Pictures’ as an area.
  • ‘Libraries’ as an area.

Configuration 0

The primary configuration activates no Site features.

The primary configuration activates the following Web features:

  • ‘Personalization Site’ {ED5E77F7-C7B1-4961-A659-0DE93080FA36} located in {SharePointRoot}\TEMPLATE\FEATURES\PersonalizationSite\feature.xml.
  • ‘My Site Navigation’ {6ADFF05C-D581-4c05-A6B9-920F15EC6FD9} located in {SharePointRoot}\TEMPLATE\FEATURES\MySiteNavigation\Feature.xml.
  • ‘Team Collaboration Lists’ {00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5} located in {SharePointRoot}\TEMPLATE\FEATURES\TeamCollab\feature.xml.

Default Module provisions the following files:

  • public.aspx
  • default.aspx

Public.aspx

The public page contains a redirection control.

There are no web parts provisioned to this page.

Default.aspx

The default page is the content view for the individuals personal MySite.

The web parts provisioned to this page are:

The web parts are then manipulated during the feature activation to give the final result below.

image

What’s next?

Hopefully this has given you an insight into what makes up the SharePoint 2010 MySite. In the next article we’ll examine in more detail how to customise the branding and other visual elements.

SP2010 MySites – Part One: Overview

MyProfile

This is the first article in a series which explores the SharePoint 2010 MySite features. SharePoint 2010 has brought with it vast arrays of improvements and several of these are focused around ‘Social’ features. Many of us are familiar with Facebook, LinkedIn and other sites which bring people together to share personal information. Within SharePoint this is provided by the MySite concept.

Series contents:

  1. Overview, which details the MySite functionality provided by SP2010 – This Article
  2. Anatomy, we delve inside the MySite and dissect its inner secrets
  3. Customisation for Branding, how to change the look and feel
  4. Customisation of My Content page, how to change the page layout and contents
  5. Customisation of a MySite Blog, how to alter the Blog
  6. The MySite centric intranet, putting the MySite at the centre of the universe

What are MySites?

 

SharePoint MySites are commonly referred to as ‘Facebook for the enterprise’, they provide each user a personal space to store private and public information such as documents, pictures, status updates, information about themselves and blogs.

Microsoft say:

My Site Web sites are personal sites in Microsoft SharePoint Server 2010 that provide users in an organization with a rich set of social networking and collaboration features. These features give users a way to discover areas of expertise, projects, and business relationship from one central location. Each user can view his or her My Site Web site by clicking the corresponding user name in the top, right corner of any page and then clicking My Site.

Why would my organisation use MySites?

 

The use of SharePoint 2010 MySites allows users to share information about themselves and their work. Sharing this kind of functionality fits well within collaboration strategies where connecting people and skills together becomes important. A MySite also helps end users feel some kind of ownership of a corporate system, that little bit is all theirs to play with.

MySite features

 

The MySite consists of three distinct areas

My Newsfeed page

SharePoint 2010 introduces a new social feature to the MySite called the activity feed. This feed is similar in concept to the news stream on Facebook or LinkedIn. It displays activity from your colleagues, such as new tags, changes in profile information, colleagues being added and new blog posts from the user.

image

My Content page

The my content page is the personal space for the user. This site collection contains document libraries for private and shared documents, pictures which can be linked to Office applications. The main page provides a page where a user can add whatever web parts they need. The user is also able to create a blog site under their personal space to allow others to read about their experiences.

image

User profile page

The user profile page displays various information about the person. Such as an introduction, skills, interests, past projects, contact details and personal photo. This information can be sync’d from Active Directory as well as several other sources using the BCS capability. Another feature of the profile page is to allow the user to display different levels of information depending on social distance. For example you can restrict your mobile number to only those users who are colleagues.

image

What’s next?

 

Hopefully this has given you a 1000 foot view of the SharePoint 2010 MySite. In the next article we’ll examine in more detail the features and components that are brought together to build this MySite functionality.