My Sites - Share Point 2010

One of the first steps in configuring user profiles for use within SharePoint is to set up a My Sites host by following these steps:

  1. In Central Administration, under Application Management, create a new Site Collection using the My Site Host template from the Enterprise category.
  2. My Sites

  3. Once the My Sites site collection is up and running, we can configure the User Profile Service application and use it to create sites for each user. In Central Administration, choose Manage Service Applications | User Profile Service Application | Setup My Sites. In the My Site Host Location text box, enter the URL of the site collection that we just created:
  4. My Sites

  5. As well as providing a user interface for managing user profile information, users have the option of creating their own personal sites. This is covered in a bit more detail later. However, since each personal site is effectively a site collection in its own right, before users can create these sites, self-service site creation must be enabled on the web application that hosts the My Sites site collection. To enable self-service site creation, from Central Administration, select Application Management. In the Site Collections section, select Configure Self-Service Site Creation and then select the On option, making sure that the My Site host web application is selected first.
  6. feed back

    TIP Self-service site creation is defined at the web application level. Creating a separate web application to host My Sites will allow greater administrative control over the sites that can be created within a SharePoint farm. If My Sites is enabled on an existing web application, users with the appropriate permissions will be able to create other types of site collections, potentially leading to fragmented distribution of content and an ineffective use of resources.

  7. Now that we’ve configured My Sites, users can manage their profiles and access their personal sites by clicking their username in the upperright corner of the page and then selecting My Profile:
  8. After selecting My Profile, the user is automatically directed to the My Sites site collection. Across the top of the page are three links: My Profile, My Network, and My Content. Let’s take a look at each of these.

My Profile
The My Profile page contains a number of useful features and is the main access point for social computing in SharePoint 2010. Users can add to their profile information, including a personal description and a picture as well as contact details. These are pretty standard features that you’d expect to find in any user profile application. However, SharePoint 2010 also includes new features such as Ask Me About, where a user can list subjects in which they have relevant expertise. These subjects are then listed on the user’s profile page, and other users can ask questions based on the subject by clicking a hyperlink.

This feature is not trivial—this additional data is included in the people search index, making it possible for others users to search for experts in a particular field and easily ask questions. Bearing in mind that the key aim of social computing in the enterprise is the development of organizational intelligence, you can begin to see how this feature can be very powerful.

Ask Me About is just one property that users can complete on their profile. Other data such as Skills and Interests can be used in a similar manner. In effect, these tags are used as metadata to help users find other users who can assist with problems or who are interested in a particular topic regardless of where they sit within an organizational hierarchy. The properties that are available within the Edit Profile page are defined by the User Profile Service application and can therefore be extended to meet any requirement.

Earlier discussed taxonomies and the Managed Metadata column. You can add profile properties that make use of the managed metadata column, as shown below, allowing users to select from a range of predefined tags. Functionality such as this is useful for allowing users to manage their geographic location—and, again, this data can be used to refine search results.

My Profile

Status Messages
As well as providing links to a user’s profile information, the My Profile page also includes a number of social computing features that are new to SharePoint 2010. Probably the most obvious of these is the status message, shown next:

Status Messages

Status messages work similarly to Twitter, the only difference being that the messages are not posted to the public Internet. A user can enter short messages that are then visible by all users viewing the user’s profile; these messages are automatically shown on the profile page of other users in their network (more on networks later).

NOTE I’ve got a confession to make when it comes to Twitter. When I was first introduced to the service, I thought, “Who’s got the time to waste posting inane comments on the Web that nobody will ever read?” I was missing the point. Status updates in SharePoint or Twitter provide a record of your thoughts, ideas, musings, and findings over time, which can be referred to at a later date. Not only that, but they help to spread information quickly throughout an organization—or, in the case of Twitter, throughout the world. Everything you ever type is stored, indexed, and made available for searching.Why is this a good thing? How many times do you find yourself saying, “I vaguely remember a conversation about that, but I can’t remember the details”? Now you don’t need to remember the details—“Note to self” has been superseded by status update.

Most things that you do within SharePoint appear in your activity feed. Whether it’s creating a new document or updating your user profile, it all ends up in your activity feed, and anybody who’s interested can view it. In a sense, the activity feed is like the news feed in Facebook.

As developers, we’re likely to be involved in writing data to and retrieving data from the activity feed for our custom applications. Before we get into some code snippets that illustrate how we can tackle these tasks, let’s look at how activities are represented by the object model:


The ActivityManager class is used to manage the ActivityApplications that are registered with the User Profile Service. Configuration of a custom application that adds events to the activity feed will begin with the ActivityApplication class:

Each application will have one or more ActivityTypes, where an ActivityType is the type of event that’s written to the feed. For example, if we develop a custom helpdesk application and we want activities to be written when a case is assigned to a user, we would add an ActivityType for CaseAssignment. We may also add ActivityTypes for CaseClosed or ReachedSLATimeout.

Once we’ve defined our ActivityType, the next part of the configuration is the ActivityTemplate, which defines the template that will be populated when adding an event using our custom ActivityType. Each ActivityType may have one or more ActivityTemplates. Here’s an example:

Both ActivityType and ActivityTemplate objects make use of resource files to retrieve the content that is included in a user’s activity feed. This allows the content to be localized based on the user’s language preferences.

For the ActivityType object, the resource file is configured using the following properties:

  • ActivityType.ActivityTypeNameLocStringResourceFile Contains the name of the resource file. All resource files are stored in the %SPRoot%Resources folder.
  • ActivityType.ActivityTypeNameLocStringName Contains the name of a data element within the resource file that defined the name that will be displayed for the ActivityType.
  • A sample resource file containing details for an ActivityType might look like this:

    <root><data name="My_Activity_Key"><value xml:space="preserve">My Sample Activity Type Name</value></data></root>

    For the ActivityTemplate object, configuration is performed by using two similar properties:

  • ActivityTemplate.TitleFormatLocStringResourceFile Contains the name of the resource file.
  • NOTE Resource filenames should not contain the path or extension. For example, a resource file named myresources.en-us.resx would be used by setting the appropriate property to myresources.
  • ActivityTemplate.TitleFormatLocStringName Contains the name of the data element within the resource file that contains the event template.

A sample resource file containing two activity templates, one with a single value and another multi-value template, might look as follows:

TIP Templates can contain entity escaped HTML if additional formatting is required.

Making use of these functions, we can write some setup code that adds the appropriate ActivityType and ActivityTemplate elements as follows:

If we run this code sample and then click the Edit My Profile link on the My Profile page for a user, we’ll see that three additional options in the Activities I Am Following section, as shown next. These new activities correspond to the ActivityType objects that we configured in our code sample.


Now that we know how to configure custom activities for our applications, let’s move on to take a look at how to make use of these configured activities. The following class diagram shows the classes that are involved in creating activity events:


Using ActivityEvents is a two-step process. First, the events are generated and written to the appropriate user’s activity feed using the ActivityFeedGatherer. The ActivityFeedGatherer object makes use of batching to write events. This allows for scheduled jobs to scan periodically for changes and write activity events in batches while at the same time allowing for more traditional event-driven activity generation. For example, in the case of our helpdesk application, the CaseCreated event would most likely be event-driven, whereas the SLATimeout would probably be generated by a scheduled task.

The second step in the process, once the events have been written to the user’s activity feed, is to broadcast the events to colleagues who have elected to receive them. This is where the terminology gets a bit confusing and warrants some further explanation. Looking at the code above for GenerateActivityEvent, we can see that the CreateActivityEvent method accepts two properties of type Entity: owner and publisher.

First, let’s consider what an Entity is. An Entity object represents the owner or publisher of a feed. The feed part is significant. Earlier you learned that each user has an activity feed and that other users can subscribe to that feed; when we’re generating activity events, the owner should always be the owner of the feed to which we’re trying to add the event.

Second, now that we’re clear on what an Entity is and the significance of the owner, let’s take a look at the publisher. You’d think that publisher would be the user or application that published the event. In some cases, this is true, but as a rule of thumb the assumption doesn’t work. A more accurate definition of publisher is the user who is the target of the activity—or maybe an easier way to picture it is the user whose activity feed will contain the activity.

These two properties are significant when looking at broadcasting events to subscribers. Consider this template as an example:

<data name="MyHelpdesk_Closed_SVT" xml:space="preserve"><value>{Publisher} has closed a case: {Link}</value></data>

This same template will be used for the event when written to the originating user’s activity feed as well as the My Network feed of colleagues who have elected to receive updates. We’re using the {Publisher} property in the description because, unless it is changed programmatically, the publisher will remain the user that originated the event. If instead of {Publisher} we were to use {Owner}, the value would change to the user viewing the My Network feed. {Publisher} is the originator or source of the activity, whereas {Owner} is the current consumer of the feed.

In the preceding code snippet, notice that when calling GenerateActivityEvent, both the owner and the publisher are set to the same user. This is necessary to have the activity appear in the user’s activity feed. The following code broadcasts an ActivityEvent to all subscribed colleagues:

The important thing to note about this code snippet is that it uses the same
BatchWriteActivityEvents method to generate the subscriber events. The main difference between the events being generated by this process and the original event is that the entities that represent the owner and the publisher will be different. The owner will be the colleague who has elected to subscribe, whereas the publisher will be the originating user.

Memberships in SharePoint 2010 are a central component of fostering community-based social computing. Two types of membership are built in:

  • Distribution List Membership These groups and members are retrieved directly from Active Directory as part of the User Profile synchronization process.
  • SharePoint Site Membership These groups can be created within individual sites and are commonly used for assigning rights and permissions.

As well as built-in membership types, you can create custom groups programmatically and add users to those groups. When developing social computing applications, this functionality is very useful. Here’s an example:

Tags and Notes
As mentioned, the ability to add tags and notes to SharePoint content is available by default for most content. When tags and notes are added, although they are visible on the page containing the content, the main reason for adding them is to make the content easier to find for the user attaching the tags and notes. This functionality is implemented using the Tags and Notes section of the My Profile site. In addition, tags and notes can be added to external content such as public web sites or other web-based content not managed by SharePoint.

My Network
The My Network application is another key social computing element of SharePoint 2010. Although the My Profile page allows users to manage their own profiles, the My Network page provides a consolidated view of relevant data that’s specific to the current user. For example, by specifying additional users as colleagues, content from their activity feeds will automatically become visiblein the user’s My Network page. By the same token, if interests are specified in a user profile, when any content is tagged matching those interests, a link to the content is also available on the My Network page.

The My Network application is where social computing works its magic in SharePoint 2010. By making use of user profile data, users have access to information that is relevant to them and their interests at any time. The net effect of this is that users converge into a collaborative community, where ideas and information can flow freely among interested members. Documents move from being a source of reference to a focus for collaborative endeavor.

My Content
In a sense, SharePoint has come full circle. Originally with SharePoint Team Services 2001, the aim was to provide a web-based alternative to the ubiquitous network file share. This allowed teams to collaborate on documents with the benefit of the additional context information that could be made available using HTML. So rather than a document on a network share named ProjectHooHaTechnicalSpec.doc, the document could be stored in a document library named Technical Specifications, on a team site name Project HooHa. The team site could contain other relevant information such as an overview of the project or a list of team members and relevant contacts. Of course, all of this information could still be contained in various documents on a network file share, but using a web application made it much simpler to keep together related information and to add context easily in the form of lists and other content.

To get back to SharePoint 2010, clearly this functionality has moved on over the years. The same is also true of the requirements of knowledge workers. Nowadays, it is common practice for users within a large organization to have a dedicated network file share that can be used for storing documents. Using network file shares facilitates backups and ensures that documents can be made available regardless of the physical hardware that the user is using. My Content takes this idea a step further and applies the rationale behind SharePoint Team Services to all user-generated content. Rather than storing content on a personal file share, all documents can be uploaded to a user’s My Content site, where they can be freely shared with anybody within an organization.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Share Point 2010 Topics