Micro-messaging Server Control

The Micro-messaging server control allows users to post brief messages. It resembles micro-blogging services like Twitter.

A user can reply to another user’s micro-message.

The control also lets users search micro-messages. See Also: Searching for Micro-messages

In addition, Micro-messages are a type of notification.

This feature builds tighter-knit communities by allowing members to share information and feel they have a personal stake in that information.

NOTE: If you are in a load-balanced environment, the same reply may appear several times. If this problem occurs, stop the Ektron notification service on all but one of the servers in the cluster.

NOTE: A user’s Private Profile setting has 3 possible values: Public, Private and Colleague. When discussing this control and these settings, Private and Colleague both act as Colleague.

Micro-Message controls on sample sites

Micro-Message Controls on Sample Sites

You can find examples of the Micro-message server control in these Ektron sample sites. You can copy and edit the samples as needed to build your own pages.

  • Ektron Technology site > Login
    • user or colleague mode—User Profile page (top right corner)
    • time line mode—http://your server/Ektrontech/timeline.aspx
  • Developer Sample Site > Social Networking > MicroMessage and MicroMessage Api
Micro-messages are an activity type

Micro-messages are an Activity Type

A micro-message is type of Ektron activity, like adding content or joining a Community Group. As such, a new micro-message can generate a notification. See Also: Notifications

Like other notifications, Micro-messages can appear on an Activity Stream control.

Users can determine if they want to be notified about colleagues' Micro-messages on the User Profile > Activities > Colleagues tab, and if want to notify others on the My Activities tab.

Micro-messaging display modes

Micro-messaging Display Modes

This Micro-messaging server control has 4 modes, which let you control the messages being displayed.

Associating the control with a user

Associating the Control with a User

Like other Ektron server controls, there are 2 ways to specify the user associated with the control.

  • the server control’s DefaultObjectID property. Do this to display a particular user’s micro-messages on a page.
  • the user ID is retrieved from the page URL, which typically contains the logged-in user ID (see example below). Do this to display micro-messages of the logged-in user.

User mode

User Mode

Use this mode to show micro-messages for a specified user, such as on a User Profile page. For example, when you view your own page in User Mode, you can

  • see your messages
  • submit a new micro-message. For example, you update your status.
  • search micro-messages. See Also: Searching for Micro-messages.

The following example of the Micro-messaging server control with the Mode property set to User.

In User Mode, you can view the control that is associated with another user. For example, when you view another's profile, which contains the Micro-messaging control in User Mode, you see only micro-messages of the user who owns the profile. You cannot submit a micro-message from your colleague’s profile page, nor can you search micro-messages. For example, you and Steve are colleagues. When you view Steve’s profile page:

  • you can see all of Steve’s messages
  • you can see messages from colleagues they have in common
  • you cannot update his status
  • you cannot search messages
Colleagues mode

Colleagues Mode

Colleagues Mode displays micro-messages from the user associated with the control and the user's colleagues. Use this mode to show micro-messages for these users, such as on a user profile page. When you are logged in and visit a page containing a Micro-messaging control in colleagues mode, you can:

  • see the colleague's messages
  • see the colleagues’ messages from other colleagues
  • update the colleague's profile
  • search micro-messages. See Also: Searching for Micro-messages

You also can view the control in Colleagues Mode when it is associated with another user. For example, when you view another user’s profile, which contains the Micro-messaging control in Colleagues Mode, you see only micro-messages from the user who owns the profile and the colleagues that you have in common with the user. You cannot submit a micro-message from the colleague’s profile page, nor can you search micro-messages. For example, you and Steve are colleagues. When you view Steve’s profile page:

  • you can see Steve’s messages
  • you can see messages from colleagues you have in common
  • you cannot update his status
  • you cannot search messages
TimeLine mode

TimeLine Mode

This mode displays micro-messages for a site’s users whose Private Profile setting is set to Public. This mode displays a chronological stream of micro-messages from all such users, with the most recent at top.

Whenever a user whose profile is set to Public submits a micro-message, it’s added to the time line.

From the time line page, logged in users can reply to and search micro-messages. See Also: Replying to a Micro-message, Searching for Micro-messages

Message mode

Message Mode

This mode displays a single micro-message on a page.

For example, John sends his boss a link to a micro-message that praises his work. When his boss clicks the link, a page that contains this control appears. See Also: Making a Hyperlink to a Single Page Version of a Micro-message

Making a hyperlink to a single-page version of a Micro-message

Making a Hyperlink to a Single Page Version of a Micro-message

Each micro-message includes a time lapse, that is, the length of time since a message was submitted. See example below.

Each micro-message’s time lapse can become a hyperlink that contains the ID of that message and a destination window. Users can click the link to view that message in the new window.

The destination window must

  • be identified in the properties of the Micro-messaging server control that displays the original message
  • contain a Micro-messaging server control in Message Mode

Users can also copy the link and send it to another user, who can then view the message. To copy a time lapse’s link information, hover over the link, right click, and select Copy Shortcut (if using Internet Explorer) or Copy Link Location (if using Firefox).

NOTE: If someone sends a micro-message link to another user who is ineligible to see the message, it does not appear. To see the message, either the user who submitted it has his profile set to Public, or the link recipient must be a colleague of the message's creator.

The following example shows how to set up this capability.

—Show the steps—
  • Page1.aspx contains a Micro-messaging server control that displays a user’s micro-messages. The messages’ time lapses are hyperlinks.
  • Page2.aspx has a Micro-messaging server control in Message Mode. It displays the individual message whose time lapse was clicked on the first page.

NOTE: For a full description of the Micro-message server control properties, see Micro-messaging Server Control Properties.

  1. On Page1.aspx, add a Micro-messaging server control.
  2. Set the DynamicObjectParameter to id.
  3. Set the TemplateMessage to the path to Page2.aspx.
  4. Set the Mode property to anything other than Message.
  5. Save Page1.aspx.
  6. On Page2.aspx, add a Micro-messaging server control.
  7. Set the DynamicObjectParameter to id.
  8. Set the Mode property to Message.
  9. Save Page2.aspx.

Now, when you log in to your site and navigate to Page1.aspx, you see a list of your micro-messages. If you click the time lapse on any message, Page2.aspx loads, showing the message you clicked.

Searching for Micro-messages

Searching for Micro-messages

The Micro-messaging server control includes search functionality that prompts a user to enter terms and returns micro-messages that match them. The search looks through micro-messages only. It does not search content, products, users, or groups.

When searching, a user can only find micro-messages submitted by

  • one's self
  • one's colleagues
  • users whose profile is set to public

The following topics explain how to enable and use the micro-message search.

Enabling the Micro-message search

Enabling the Micro-message Search

The micro-message search requires your server to have the Full Text Search component of Microsoft SQL Server.

You can install the Full Text Search component during the installation of Microsoft SQL Server.

Installing the full text search component

Installing the Full Text Search Component

If the Full Text Search component is not installed, and you want to use the Micro-messaging search functionality, insert the SQL Server installation disc into your computer and look for Full Text Search.

After the Full Text Search is installed, run the FullTextIndex.sql script on your database. This script is located in:

Program Files\Ektron\CMS400v8versionnumber\Utilities\SiteSetup\Database\FullTextIndex.sql
Running a Micro-message search

Running a Micro-message Search

When Micro-message search is enabled, a Search tab appears on the control. To use the search, click the tab and enter search terms.

When results appear, you can click any message’s time span to proceed to the message itself. If a reply appears among search results, you can click the link indicated below to view the original message.

Entering multiple search terms

Entering Multiple Search Terms

You can enter more than one search term. If you do, the terms have an “and” relationship. For example, if you enter Community and Group, only messages containing both Community and Group are found.

Replying to a Micro-message

Replying to a Micro-message

The Micro-message control lets users reply to micro-messages and nests the reply with the original message. Anyone who can see a message can reply to it, and see all other replies.

To add a reply, hover over a message and click Reply (). When you do, a dialog box prompts you to submit a reply of up to 2000 characters. The box also displays the original message.

Replies do not appear when a micro-message is viewed. Instead, a Replies link appears below the comment. The number of replies appears next to the link.

Click Replies to view them. The newest replies are at the top.

To remove a reply, click Delete (), which appears when you hover over the reply. Only the user who submitted the reply and the message board owner can delete replies.

NOTE: If you are in a load-balanced environment, the same reply may appear several times. If this problem occurs, stop the Ektron notification service on all but one of the servers in the cluster.

Filtering Micro-message spam

Filtering Micro-message Spam

You can filter spam from Micro-messages. Ektron defines spam filtering as preventing users from posting a micro-message or replying using:

  • the same message more than once a day
  • any second message within a specified time period after posting a first
  • the same message within a specified time period

NOTE: If a user enters a micro-message and a reply that have the same text, each can be sent once without being stopped by the spam filter. However, if either is sent a second time within the specified time period, the spam filter blocks it.

The Micro-messaging server control also lets you define custom spam filters.

To define a spam filter, use the SpamControlType property on the MessageBoard server control. The table below provides possible values and examples of how to set that property.

—Spam filter options—

As a developer I want to...

So I set the SpamControlType property to...

And I set the SpamTimeSpan property to …

Prevent the same user from posting the same message more than once a day

SameUserSameMessageSameDay

 

Prevent a user from posting any additional messages for 30 minutes

SameUserTimeDelay

1800

Prevent a user from posting the same message for 2 hours

SameMessageTimeDelay

7200

Use my own spam filter code

Custom and add the code to the code-behind page of the template containing the Micro-messaging server control. See Also: Creating a Custom Spam Filter

 

Creating a custom spam filter

Creating a Custom Spam Filter

You can create your own spam filter in the code-behind of the page that contains the Micro-messaging control. To do this, set the SpamControlType property to Custom, call the CustomSpamMethod in the page load event, and point it to your custom spam filter method.

The following Visual Basic example blocks the text “Hello World.”

Partial Class Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.MicroMessaging1.CustomSpamMethod(AddressOf SpamHandler)
End Sub
Private Function SpamHandler(ByVal data As Ektron.Cms.MicroMessageData) As Boolean
If data.MessageText = "Hello World"Then
Return True
End If
End Function

End Class
Micro-messaging server control properties

Micro-messaging Server Control Properties

The following are Ektron-specific server control properties. You can find information about native .NET properties such as font, height, width and border style in Visual Studio® help.

  • Authenticated (String)

    Indicates if you are logged into the CMS Explorer and can use it to browse to content, collections, and so on. See Also: Browsing Your Ektron Site Using CMS Explorer.

  • CacheInterval (Double)

    The number of seconds that the server control’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See Also: Caching with Server Controls.

  • DefaultObjectID (Long)

    The default object ID for this control to use when there is no matching dynamic parameter value passed.

  • DisplayXslt (String)

    If desired, enter a relative or absolute path to an Xslt that determines the display of the page.

    WARNING! If you specify an external file, do not store this file in the Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.

  • DoInitFill (Boolean)

    By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.

  • DynamicObjectParameter (String)

    Gets or sets the QueryString parameter to read a object ID dynamically. To use the default object ID, leave blank. For example, if you are passing the ID value of a user, you might enter ‘uid’ for this property. So, if you passed
    http://~yoursite~/UPpage.aspx?uid=21 on the QueryStrings to a page containing this control, you would see the list of Micro-messages for the user with an ID of 21.

  • EnablePaging (Boolean)

    This property, in conjunction with the MaxNumber property, lets site visitors view an unlimited number of items while controlling the amount of screen space. The MaxNumber property limits the number of items displayed. If you set this property to True, and the number of items exceeds MaxNumber, navigation aids appear below the last item, allowing the visitor to go to the next screen.

  • Hide (Boolean)

    Hides or displays the output of the control in design time and run time.

    • True—Hide the control output.
    • False—Display the control output.
  • Language (Integer)

    Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).

  • MaxResults (Integer)

    Enter the maximum number of items to appear in the initial display of this server control. To set no maximum, enter zero (0). To let site visitors view more than the maximum but limit the amount of space, enter the maximum number of results per page here. Then, set the EnablePaging property to True. If you do and more than the number of MaxResults are available, navigation aids help the site visitor view additional items.

  • MaxSearchResults (Integer)

    The maximum number of messages to return when performing a micro-message search.
    0 (zero) = unlimited.

  • Mode (ActivityFeedType)

    Specify the type of micro-messages you want to display. Choices are:

    • User—micro-messages for logged-in user with search option
    • Colleagues—micro-messages for logged-in user and colleagues of a specified user with search option
    • TimeLine—micro-messages from all site users whose Private Profile setting is set to Public; includes search option
    • Message—a single message

    See Also: Micro-messaging Display Modes

  • ProfileParamName (String)

    The parameter name to pass in the QueryString to the TemplateUserProfile page, if you want it to be anything other than id. For example, you may prefermessageid, because it is more descriptive.

  • SpamControlType

    Assigns a spam filter to the micro-messages. The control supplies 3 predefined spam filters, and the ability to define your own. Spam control is turned off by default. Filter choices are:

    • SameUserMessageDay—prevents a user from posting the same message to the board more than once per day
    • SameUserTimeDelay—prevents a user from posting another message for specified period of time. The amount of time is specified, in seconds, in the SpamTimeSpan property.
    • SameMessageTimeDelay—prevents a user from posting an identical message for a specified period of time. The amount of time is specified, in seconds, in the SpamTimeSpan property.
    • Custom—control uses custom spam filter code. See Creating a Custom Spam Filter.

    See Also: Filtering Micro-message Spam

  • SpamTimeSpan (Integer)

    Sets the amount of time, in seconds, for which the SameUserTimeDelay or SameMessageTimeDelay spam filter delays a user from posting. These values can be selected in the SpamControlType property.See Also: Filtering Micro-message Spam

  • Stylesheet (String)

    Specify the path to a style sheet for use with this server control. The location can be relative or absolute. Leave blank to use the default style sheet.

  • SuppressWrapperTags (Boolean)

    Suppresses the output of the span/div tags around the control.

    • True—Suppress wrap tags.
    • False (default)—Allow wrap tags.
  • TemplateMessage (String)

    The URL path to a page that contains another Micro-messaging server control. When this property contains such a path, and the destination page has a Micro-messaging control whose Mode property is set to Message, a user can click a micro-message’s time span on the first page to open a second page that contains just that message.See Also: Making a Hyperlink to a Single Page Version of a Micro-message

  • TemplateUserProfile (String)

    The URL path to the page that contains the UserProfile server control. The path can be relative or absolute. If you enter a path, a user can click any user’s name or avatar from the Micro-message server control and be forwarded to his profile page.

    Note that user templates can be defined in the Ektron Workarea > Settings > Community Management > Templates screen. However, if you assign a template in this field, this setting takes precedence over the setting on the Workarea Template screen.

  • WrapTag (String)

    Lets a developer specify a server control’s tag.

    • Span (default)—designate an inline portion of an HTML document as a span element.
    • Div—apply attributes to a block of code.
    • Custom—Lets you use a custom tag.