ShowTable of Contents
Introduction
Using the IBM® Connections 4.0 Discuss This feature, you can easily share topics and news in Connections Forums from any Web site and discuss it with your own Communities. Moreover, if any other pages follow the “Discuss This” data collection rules, users can also share the contents using this tool.
Enabling and using Discuss This
There are two ways to use Discuss This, and thus you can enable it via two methods.
Enabling Discuss This
Enable using the plugin
1. Click the tools page "Bookmarking Tools" link in the bottom of the Connections page (see figure 1).
Figure 1. Bookmarking Tools link
2. Follow the steps on the “Discuss This Button” page, to install the Discuss This plugin.
After enabling the plugin, you will see a bookmark named “Discuss This” in your browser, as shown in figure 2.
Figure 2. Discuss This bookmark
Enable using the link
1. Open the {Dm.root}/config/cells/{local.cell}/LotusConnections-config/forum-config.xml file, and edit the “discuss this” section as shown in listing 1.
Listing 1. Edit the discuss this section
<!-- Define weather "discuss this" enabled and remote deployment information -->
<discussThis enabled="true">
<targetBookmarklet>http://example.cn.ibm.com/connections/bookmarklet</targetBookmarklet>
</discussThis> |
2. Restart IBM WebSphere® Application Server; you will see a link named “Discuss This” inside each topic (see figure 3).
Figure 3. Discuss This link
Using Discuss This
Now we demonstrate the two ways to use the feature.
Use the plugin
- Open any Web page supported by Discuss This, for example, the news on www.yahoo.com.
- Click the Discuss This button that you just added to your browser; a window pops up containing the following fields (see figure 4):
Topic: Shows all info of the original topic, like title, contents, attachments.
Forums drop-down list: Helps users to find a target forum easier by choosing “I'm an Owner,” “I'm a Member,” “I'm Following,” or “Public.”
Forum name: Supports type-ahead to help users to find a target forum quickly.
Title: The target topic title
Mark this topic as a question check box: Supports enabling the target topic as a question.
Pin this topic check box: Supports pinning the target topic directly.
Add a comment: Allows users to add more comments to the target topic.
Figure 4. Discuss This plugin pop-up
3. After filling in all the fields, click Save; the target topic is created, and the browser page will redirect to it.
4. In the target topic, you can see all info, including an original topic link that helps other users to check all (see figure 5).
Figure 5. Target topic page
Use the link
1. Open a Connections topic and click the Discuss This link under the topic; a pop-up window displays containing all the fields defined above in the Use Discuss This plugin section (see figure 6).
Figure 6. Discuss This link pop-up
2. After inputting the fields, click Save; the target topic is created and the browser page will redirect to it.
3. In the target topic, you can see all info, including an original topic link and forum link, which helps other users to check it all.
Figure 7. Target topic window
Understanding the Discuss This process
Here is the process for how the feature works:
(1) When you click a Discuss This button, the Discuss This bookmark inserts a js resource into the current page.
(2) The "Discuss This" JavaScriptTM collects the topic’s data according to the data collection rules and then encapsulates it into a JavaScript Object Notation (JSON) object.
(3) A pop-up window opens with the collected data, which you can change. Once you click the Save button, JavaScript will collect all data from FORM, organize it as a topic Feed, and then post the feed to the Forum Atom API via an Ajax call.
(4) If the Ajax call succeeds, the window closes itself and redirects to the newly created topic page.
Data collected by Discuss This feature
Table 1 lists the types of data that are collected when using Discuss This.
Table 1. Data collected
Data | Description | Note |
topicLink | Topic URL |
|
name | Content title |
|
author | Content author | May be empty |
date | Published date of this content | May be empty |
description | Content of current page | May be empty |
image | Image URL found in current page | May be empty |
video | Video URL found in current page | May be empty |
favicon | The Favicon link of current page | May be empty |
parentName | Container Site name, Container Forum name, or Container Community name | May be empty, |
ParentImg | Image icon of the container | May be empty, |
attachments | Attachments' link of the content | May be empty,
Only used in DF data rule |
communityId | Community UUID if the topic is in a Connections community | May be empty,
Only used in DF data rule |
communityTitle | Community Name if the topic is in a Connections community | May be empty,
Only used in DF data rule |
Data collection rules: What kind of Web page can be discussed?
Any kind of Web page can be discussed, as long as it has title and link. This is the most fundamental data rule of the feature, which attempts to collect data from the Document Object Model (DOM) tree of the current Web page. There are three rules when collecting the data: DF, META, and SIMPLE, as explained below:
(1) DF (Discussion Forums)
Discuss This first checks if the data is a Connections Forum topic. DF is the data rule for this, and we can use it to get the most detailed information of the discussed topic, including attachments, forums, communities, etc.
In a Connections topic, we have micro-formats, which are virtual Cascaded Style Sheets (CSS) classes that that mark the structure of the page content (see table 2).
Table 2. Connections topic micro-formats
Data | CSS class | Description |
post | .hentry | Every post is wrapped by hentry class. Retrieve first hentry to find topic post. |
name | .entry-title | Topic title |
author | .fn | Content author |
date | .published | Topic published date |
description | .entry-content | Content of current page |
attachments | .dfAttachment | Attachment list. |
parentName | .forumLink | Forum name and Forum Link |
communityId | window.ic_comm_communityUuid | JS object, stands for community uuid. Supported from Connections 4.0. |
communityId |
| use special XPATH to find community information in Connections 3.0 |
(2) META
If we are not in a Connections Forum topic, "Discuss This" will check if there are meta data for the current Web page. Many Web sites providing news, for example Yahoo, use meta data to abstract the main content of the Web page, so we can construct the news by using the value of corresponding meta data.
This is the most useful rule for collecting data in mainstream Web sites. Any Web page containing the meta data (not necessarily needed for all) in table 3 can be filled in with the correct value when using Discuss This.
Table 3. METAs available in Discuss This
Data | Meta data | Description |
topicLink | <meta property="og:url"> | Topic url |
name | <meta property="og:title"> | Content title |
description | <meta property="og:description"> | Content of current page |
description | <meta name="description"> | topic description. Overwrites description above. |
image | <meta property="og:image"> | Image URL found in current page |
video | <meta property="og:video"> | Video URL found in current page |
videoWidth | <meta property="og:video:width"> | Video width |
videoHeight | <meta property="og:video:height"> | Video height |
parentName | <meta property="og:site_name"> | Site name |
For instance, if you check the page source of the Yahoo news page, you can easily find some of these meta tags (see figure 8).
Figure 8. Example meta tags
(3) SIMPLE
If the data is neither a Connections Forum topic nor has any needed meta data, which means it's fit for neither data rule DF and META, then Discuss This will use the SIMPLE rule to get the data. Since every Web page has a document object, it is easy to get the title element and the href (see table 4).
Table 4. Simple data collection list
Data | DOM | Description |
topicLink | document.title | Topic URL |
name | document.location.href | Content title |
This is the most fundamental rule and, with it, any Web page can be discussed using Discuss This.
Conclusion
Using the Discuss This feature, we can spread information from other applications to Connections Forums much easier. Also, we can easily build our own Web pages to match the Discuss This data collection rules, which can help us build a more social application.
Tell us what you think
Please visit this link to take a one-question survey about this article:
Resources
About the authors
Rui Qi Shi is a Software Engineer working on the Connections Development team based at IBM's China Development Lab (CDL). He helped develop the Homepage Activity Streams and Discuss This for Connections 4.0 and has rich experience in Web and Java EE development. You can reach him at
shiruiqi@cn.ibm.com.
Zhang Yue is a Software Engineer based at IBM's CDL working on the IBM Connections team since version 3.0.1.1. She is the Lead for the Functional Verification Test Team of Forums for Discuss This testing. You can reach her at
zhyuecdl@cn.ibm.com.
Yu Jia Feng is a Software Engineer working on the Connections Development team based at IBM's CDL. She is the core developer of the Forums Team, helping to develop Discuss This for Connections 4.0, and has rich experience in Web and Java EE development. You can reach her at
fyjfeng@cn.ibm.com.