Facilitating Collaboration in Liferay Portals
-
font size
decrease font size
increase font size
In the previous chapter, you set up discussion forums to let your portal users collaborate withone another by participating in different discussion threads. You can think of this collaboration method as “offline” in that users might not get responses to their postings immediately. You can facilitate several other kinds of collaboration in your portal. Some of these allow realtime communication, meaning the users would be able to participate in live discussions.
Integrating Mail
Almost all computer users rely on e‑mail as their primary means of communication, so you’llintegrate a mail client into your portal. Through Liferay’s Mail application, you will be ableto retrieve your mail without leaving the portal and e‑mail other people from the applicationitself. This lets you go on working in the same environment and helps you avoid the overheadof switching to another mail client.
Adding the Mail Client
Liferay version 5.1.1 comes with the Mail application, but version 5.1.2 (the current version atthe time of this writing) does not. So you’ll need to download this mail-client application fromthe Liferay web site.
To add the Mail application, follow these steps:
1. Log in as Administrator to your ISI portal.
2. Create a new page called Collaboration. You’ll use this page to add and test all the
applications I’ll discuss in this chapter. 3. Select the Add Application menu from the Welcome drop-down list.
4. Locate the Mail application under Collaboration.
5. Add the application.
You will see the screen shown in Figure 5-1 after adding the application to the Collaborationpage.The Mail application serves as a client to both your regular IMAP accounts and yourGmail accounts. You need to configure the client for each type of e‑mail account that you wishto use on your portal. Click the Configure email accounts link to configure the accounts. Youwill see the two choices displayed in Figure 5-2.


Adding a Gmail AccountFirst, you’ll set up a Gmail account (see Figure 5-3):
1. Click the Add a Gmail Account button.
2. Enter your e-mail ID in the User Name edit box.
3. Enter the password in the Password field.
4. Click the Save button.

After you save your changes, the Mail application attempts to connect to the Gmail serverto validate the entered account information. If all goes well, you’ll see a message indicatingthat the connection is successful and that your account will be ready for use in a few minutes.You now need to set up the information for incoming- and outgoing-mail servers in the configurationscreen that automatically pops up on your screen.Adjusting Gmail SettingsYou’ll need to enter your Gmail account ID and password in the User Name and Passwordfields on this screen (see Figure 5-4), but the rest of the fields have already been populated bythe application:
• Incoming IMAP Server: imap.gmail.com
• Incoming Port: 993
• use-secure-incoming-connection: Checked
• Outgoing SMTP Server: smtp.gmail.com
• Outgoing Port: 465
• use-secure-outgoing-connection: Checked

Click the Save button to save your settings. If you make any errors while entering theconfiguration, click the Configure email accounts link on the Mail application’s main page tore-enter or modify the required fields.
Retrieving Mail
After you configure and save the settings for your Gmail accounts, you will see the screenshown in Figure 5-5.

At this time, you are all ready to use your Gmail accounts. First, we will look at how toretrieve your mail in the Mail client application.Click the Check your email link. The mail from the default account will be retrievedand displayed in the client area. This screen (see Figure 5-6) resembles your regular Gmailaccount’s inbox screen.

On the left side of the client, you will see the usual menu options for navigating to differentfolders such as Drafts, Sent Mail, and so on. In the center of the screen you will see a listof all retrieved mail in your inbox. When you click the desired folder on the left, the mail fromthe selected folder will appear in the center. You can perform other operations as you can withyour Gmail account in your browser: you can click any of the message headers to view themessage body, you can mark and delete messages, and so on.
Sending E‑mail
Just as you can retrieve your mail without leaving the portal, you can send mail withoutleaving the portal. To compose and send mail to others through the Mail application, clickthe Compose Email link. You will see the familiar screen for composing a new message (seeFigure 5-7).

Enter the appropriate information in the From, To, CC, BCC, Subject, and body-text fields,and include an attachment if desired. Once you are satisfied with the composed message, clickthe Send button to send it. The Gmail outgoing-mail server will dispatch the message.
Setting Up IMAP Accounts
As I mentioned in the section “Adding the Mail Client,” the Mail application allows you to setup mail accounts other than Gmail. To set up your other mail accounts, follow these steps:
1. On the main screen of the Mail application, click the Configure email accounts link.
2. Click the Add a Mail Account button.
3. Enter the requested details of your mail account (see Figure 5-8), as you did with your
Gmail account.
4. Save your changes.

Once you set up your mail account, you can retrieve your mail in the client area or evencompose and send mail, just as you did for your Gmail account.
Extending Mail Functionality to Other Members
Note that what you’ve done so far applies only to a portal administrator—remember that youlogged in as an administrator while adding the Mail application to your portal page. Now I’llshow you how to extend this functionality to other members of your portal. You’ll learn howto assign rights to other community members so that each member can set up her own e‑mailclient using her private mail configuration.Follow these steps to extend the Mail application to other portal members:
1. Add a new public page under the desired community.
2. Add the Mail application to the public page you created in the previous step.
3. Click the Configuration button to set permissions. You will see the screen shown in
Figure 5-9.
4. Select the Power User role from the Available tab and click the Update Permissions button.
You will see the screen shown in Figure 5-10.
5. Assign all three displayed permissions to the Power User role: Configuration, Preferences,
and View.
6. Click the Finished button to save your changes. Note that the Power User role now has
the newly added permissions displayed in the roles listing.




You have now successfully set the public page for the community users. When a communityuser logs on to her account and opens this public page, she will be able to configure themail-client application with her own private e‑mail configuration.
Using SMS:
E‑mail messages are asynchronous, which means the recipient might not see them immediately.With the advent of mobile phones, many people prefer SMS (Short Message Service)messaging because they can often get quicker responses to their messages. Liferay provides anapplication called SMS Text Messenger that allows you to send SMS messages.
You’ll find SMS Text Messenger under Liferay Portal’s Collaboration category. Add thisapplication to your Collaboration page. After successfully installing the application, you cansend SMS messages to your friends. In the application’s client area, enter the To, Subject, andMessage information (see Figure 5-11). Note that your message cannot contain more than 500characters.

After you populate the fields, click the Send Text Message button. The screen displays anappropriate message if the transmission was successful.So far, you’ve seen methods of collaboration in which the communication between theusers might not be live. Now you’ll look at a Liferay application that allows live communicationbetween users.
Adding Chat Functionality
Liferay provides a Chat portlet that facilitates instant communication among users who arelive on the portal. In the case of discussion forums and e‑mail applications, the sender neverknows whether the recipient is currently online until he sees her reply to his message.With the Chat application, every logged-in user knows which other portal members arecurrently online. All live users can intercommunicate through the Chat application.
Installing the Chat Application
The Chat application, although supplied by Liferay, does not come in the installation package.You must download the application from the official-plugins area of the Liferay web site andinstall it on your machine. Accomplish this by following these steps:
1. First add the Plugin Installer application to your Admin page (or any other page you’dlike).
2. Select the Portlet Plugins tab.
3. Type chat in the Keywords text box and click the Search Plugins button. The outputscreen of the search result is shown in Figure 5-12.

4. Select Chat 5.1.1.3 from the displayed list of applications.
5. The Plugin Installer app now displays the application information for the selected Chatapplication (see Figure 5-13).
6. Click the Install button to install the application on your machine. After a while, youshould see a success message.

If you check out the bottom-right corner of the portal screen, you will notice a small labelthat reads Chat (0). This indicates that the Chat application is currently active and has zeroonline users (see Figure 5-14).

Testing the Chat App
As Chat obviously requires more than one participant, you will not be able to test the applicationuntil another user logs on to the portal. For testing, you will need to use another machineconnected in the same network as your portal-server machine.To test your Chat application, take the following steps
1. Log in to your portal account on your machine.
2. Log in to another portal account on another machine.
3. Note that the label on the bottom-right corner of your screen now reads Chat (1),
indicating that one Chat user is online. This number will change as the number of live
users grows and shrinks.
4. Click the Chat label to see who is currently online (see Figure 5-15). Again, the list will
grow and shrink depending on who is logged in to the Chat application.

5. To initiate a chat with an online user, click the desired user name. A small window
pops up on the top of the displayed user name (see Figure 5-16).
6. Type a greeting into the edit box and press Enter. This delivers the message to the
selected user.
7. Type a reply from the other machine where the selected user has logged in.
8. Go back to your own screen to see the reply from the other user in the text area (see
Figure 5-17).

Chatting with Multiple Users
With the Chat application, you are allowed to chat with multiple online users concurrently. Tochat with multiple users, click the desired user names. For each selected user, a new chat windowpops up on your screen (see Figure 5-18).

You can now send messages to multiple users in their respective chat windows, andreceive messages from them as well.
Searching and Inviting
You have seen different ways to allow communication and collaboration among your portalusers. In most of the cases shown so far, one user initiates a discussion and other users participatein it. But you might find occasion to invite certain users to join a discussion. Liferayprovides applications that allow you to search the users in the entire portal directory andinvite selected users to join discussions. In this section, you will study the two applicationsthat offer search-and-invite functionality: Directory and Invitation.
Searching Users
The Liferay application that allows you to search the user database is called Directory. Followthese steps to set up the application:
1. Select the Collaboration page (or any other page where you’d like to add the new
application).
2. Click the Add Application menu.
3. Select the Directory application under the Community category.
4. Add the Directory application to the page. The application screen should now look like
the one shown in Figure 5-19.

5. The application provides three tabs: Users, Organizations, and User Groups. As the
names suggest, you can use these tabs to search for a desired user, organization, or
user group.
6. In the Search edit box, enter the search criterion funda.
7. Click the Search Users button.
8. Note the resulting list of users matching your search criterion (see Figure 5-20). The
first name, last name, screen name, job title, and organization are listed for each user

9. If the list is too large, you can narrow down your search by clicking the Advanced link to
the right of the Search edit box. Clicking the Advanced link displays the screen shown in
Figure 5-21.

10. Here, you can enter one or more of the following search criteria: first name, middle
name, last name, screen name, or e-mail address.
11. Select All or Any from the Match drop-down list.
12. Click the Search Users button to perform the directory search with the new search
criteria.
Searching Organizations
In certain situations, you might want to invite members of certain organizations to participatein your discussions. In such cases, it is easier to search the portal directory for an organizationrather than for individual users. To locate an organization that matches a particular criterion,perform the following steps:
1. Click the Organizations tab in the Directory application.
2. Enter your search criterion (ISI) in the Search edit box.
3. Click the Search Organizations button. You’ll see the resulting list at the bottom (see
Figure 5-22).


4. Click the View Users link on the right side of each organization to see the list of users
belonging to that organization.
5. If desired, perform an advanced search by clicking the Advanced link near the Search
edit box (as you did when searching for individual users). You can fill in criteria such as
the organization’s name, address, type, country, and region.
6. You can choose to match all the entered search criteria or any of the entered fields by
selecting the corresponding option in the Match drop-down list.
7. Clicking the Search Organizations button will display the list of organizations matching
your search criteria.
Searching User Groups
In addition to searching individual users and organizations, you can also search user groupsusing the Directory application. To locate a desired user group, carry out the following steps:
1. Click the User Groups tab in the Directory application screen (see Figure 5-23).
2. Enter the search criterion in the Search edit box.
3. Click the Search User Groups button to perform the search. A list of matching user
groups appears at the bottom.

Inviting Friends
After you have searched and located the desired users, you can send them invitations to joinyour discussion forums or person-to-person discussions. Liferay provides an applicationcalled Invitation for this purpose.
Adding the Application
To add the Invitation application to your portal page, follow the steps listed here:
1. Select the Collaboration page (or any other page where you’d like to add the Invitationapplication).
2. Select the Add Application menu.
3. Select the Invitation application from the Community category. Adding the applicationbrings up the screen shown in Figure 5-24.

Configuring the Invitation Message
Before you send an invitation message to your friends, you must configure it first. To configurethe message, follow these steps:
1. Click the Configuration icon in the Invitation application. You will see the screen
shown in Figure 5-25.

2. Compose your message by typing the desired Subject and Body text. (The various terms
used in the Subject and Body text are explained right below the message body.)
3. Click the Save button to save your changes.
4. Click the Archived tab to archive the current message format for future use. You will see
the screen shown in Figure 5-26.
5. Type the desired name for the current message format and click the Save button.
You will now be able to use the archived message format in the future by clicking theActions button and selecting Restore.

Sending Invitations
After composing the delivery message, you can start sending the invitations to your friends.Here’s how:
1. Click the Invite Friends link in the Invitation application. You will see the screen shown
in Figure 5-27.

2. Enter the e-mail addresses of the desired friends in the displayed edit boxes.
3. Click the Invite Friends button.
You will see an onscreen message saying that the invitations have been dispatched to the
friends you listed.