Ask a question
Vicky

Vicky

E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Thursday, 06 August 2009 16:19

Incorporating Blogs in liferay portals

Creating Blogs

The Blogs application allows you to add blogging functionality to your portal. To add blogging,follow the steps listed here:

1. Create a new public page called Community under the Fundamental Analysts community
that you already  created.
2. Select the Add Application menu.
3. Select the Blogs application under the Collaboration category.

Add the application to the currently selected portal page; you should see the

Add the application to the currently selected portal page; you should see the screen shownin Figure 6-1. Now that you have successfully added the application to a portal page, you will add a fewblog entries to it

 Figure 6-1. Adding the Blogs application to a portal page

Adding a Blog Entry

To add a blog entry, follow the steps listed here:

1. Select the Community page where you added the Blogs application.
2. Click the Add Blog Entry button. You will see the screen shown in Figure 6-2.
3. In the Title edit box, type Have Markets bottomed out?
4. In the Display Date fields, select the desired date for your blog entry. By default, this is
the current date and time. You can leave these fields to their default values.
5. In the Content field, type the body of your entry, expressing your views (and evidence)
on whether the markets are currently bottomed out.
6. Format your contents using the WYSIWYG (What You See Is What You Get) editor.
7. Leave the check mark in the Allow Incoming Trackbacks check box.
8. Leave the Trackbacks to Send field blank.
9. Enter some text in the Tags edit box if you wish to tag the current blog entry with some
index terms. (You learned about tags in Chapter 4.)
10. After you’re done composing the blog entry, click the Publish button to publish it. You
will now see your blog entry in the application’s client area as shown in Figure 6-3.

 Figure 6-2. Entering contents for a blog

Adding Multiple Entries

You can add as many entries to your blog as you wish. Each blog entry will generally have anew timestamp. When you have multiple blog entries on the application screen, they usuallyappear in reverse-chronological order (with latest blog entry at the top).You will now add one more blog entry. Make a new blog entry with the followinginformation:

• Title: Enter Market sentiments are very high.
• Display Date: Keep the current date and time values.
• Content: Enter Investor sentiments are now very high considering the current market
situation.
• Other fields: Leave these to their default values.
Click the Publish button to publish the current blog entry.

 

Viewing Multiple Blog Entries

After you publish your second blog entry, you will see both your blog entries listed on theapplication screen as shown in Figure 6-4.As you can see in Figure 6-4, the most recent entry appears at the top. Also, note the variousoptions that allow you to perform the following actions on each entry

• Edit
• Delete
• Share
• Rate
• Post comments
• Set user permissions

I will explain these actions in depth, but first I will discuss the Search facility that lets youlocate a desired blog

 Figure 6-4. Viewing multiple blog entries in a browser

Searching for an Entry

As the number of blog entries grows, the Search facility comes in handy when you want tolocate entries containing certain keywords. For example, you can search all blog entries for theword “market” by entering the keyword market in the Search edit box and clicking the SearchEntries button. You’ll now see all blog entries that contain your keyword (see Figure 6-5), andyou can click an entry’s title link to view its contents.

 Figure 6-5. Result of the “market” keyword search

Editing an Entry

To edit an entry, perform the following steps:1. Scroll to the desired entry.2. Click the Edit link shown below the entry title.3. Look at the selected entry in the WYSIWYG editor. This is the same editor you usedwhile creating the entry.4. Make any desired changes to the entry, such as formatting its contents, changing itstitle, changing the timestamp, or adding tags.5. Click the Save button to save your changes, which should be reflected in the Blogsbrowser display.

Deleting an Entry

To delete an entry, perform the following actions:1. Scroll to the desired entry.2. Click the Delete link below the entry title.3. Confirm whether you want to delete the entry. When you return to the browser display,note that the entry has disappeared.

Sharing an Entry

If you find a blog entry useful and you want to share it, you can choose from several sites thatlet you do that. Links to many such sites appear below each blog entry in the browser display:

• BlinkList
• del.icio.us
• Digg
• Furl
• Newsvine
• reddit
• Technorati

You need to register on these sites in order to share your discoveries with other users ofthe site. Once you share a blog entry on Technorati, for example, other Technorati memberswill be able to view your recommendation. Such sharing is a good way to popularize a blogentry.These sites also crawl the Internet and create an index of various blog entries so that thesites’ members can search the entire web for the indexed terms. This indexing, sometimesused by the press, proves useful for collecting public opinion on a particular topic.

Rating an Entry

No doubt you’ll like some blog entries better than others. The Blogs application allows you togive each entry a rating between one and five stars. Rating an entry is easy. Under the entry,
you will find five stars below the Your Rating label (see Figure 6-6).

 Figure 6-6. Rating an entry

If you want to give a three-star rating to the current blog entry, click the third star. The firstthree stars become red in color, and the Average stars change to reflect the average rating of allthe votes made on this article. Because this entry has only one vote, the average rating is thesame as your personal rating (three stars).

Posting Comments

In addition to rating blog entries, you will also be able to post comments on them. To commenton an entry, follow these steps:

1. Locate the entry on which you wish to comment.
2. Click the Comments link at the bottom of the entry.
3. Click the Post Reply link to open an edit box for your comment text (see Figure 6-7).

Figure 6-7. Posting a reply to a blog entry

4. Enter your reply message and click the Reply button.

You should see your reply below the original message in the browser (see Figure 6-8).

Figure 6-8. Displaying a user’s reply to a blog entry

Navigating Comments

If you examine Figure 6-8, you will notice that a navigation tree appears immediately underthe blog entry. Here you will find the hierarchy of all the replies on the original entry, with alink to each reply. A sample navigation hierarchy is shown in Figure 6-9.

 

Clicking any of the links will open the corresponding reply in your Blogs applicationbrowser.

 

Replying to a Comment

When you are looking at somebody else’s comment on a blog entry, you might want to addyour own comment to the existing comment, assuming you have been assigned permission todo so. To post a reply to a comment, perform these steps:

1. Click the Post Reply button at the bottom of the selected comment to pull up a text box(see Figure 6-10).

2. Enter your comment and click the Reply button.3. Verify that your message has posted under the selected comment by examining thenavigation tree.

 

Editing a Comment

If you wish to edit the comment that you posted (once again, assuming you have the requiredpermissions), follow the steps listed here:

1. Click the Edit link at the bottom of the comment to open the comment in the edit box.
2. Make the desired changes to the contents.
3. Click the Update button and view your changes in the browser window.

 

Deleting a Comment

To delete a comment, click the Delete link at the bottom of the comment display. The currentcomment will be deleted after your confirmation.

 

Setting User Permissions

When you add a blog entry, you will definitely want to set permissions to limit what otherusers can do with it. To set user permissions on a blog entry, click the Permissions linkunderneath it. You will see the usual permissions screen with the list of current roles and permissionsassigned to each role.By default, the guest user has only the View permission and the owner has all the permissions.You’ll now assign permissions to the portal’s power-user role by following these steps:

1. In the permissions display screen, select the Power User check box.
2. Click the Update Permissions button to get the screen shown in Figure 6-11.

3. On this screen, you will be able to assign permissions for adding, deleting, and updating
discussions. You can also allow the user to see the Permissions option itself.
4. Using the two arrows, assign or revoke the desired permissions.
5. Click the Finished button to save your changes and display them in the Power User tab.
I will now discuss the meanings of the various permissions.

Add Discussion

Assigning the Add Discussion permission allows the user to add a reply to the current messageor its replies. If you grant this permission, the user will see the Post Reply link at the bottom ofthe blog entry and its replies. This link is highlighted in Figure 6-12.

 

Delete Discussion

The Delete Discussion permission allows a user to delete any of the replies to the current blogentry. Such a user will have access to the Delete link at the bottom of the entry.

Update Discussion

The Update Discussion option lets a user modify the contents of any reply to the current blogentry. Such a user will see the Edit link at the bottom of the entry.

Delete

Granting the Delete permission allows the user to delete the original blog entry. Whenever ablog entry is deleted, all its replies will also be deleted. A user with this permission will see theDelete link at the bottom of the original blog entry.

 

Update

Granting the Update permission allows the user to edit the original blog entry. An Edit linkappears at the bottom of the original blog entry whenever this permission is granted.

View

By default, the View permission is granted to all users. However, if you explicitly deny thispermission for a certain blog post, users will not be able to see the entry. You should alwaysenable the View permission to encourage readership on your portal’s blog.

Permissions

If you deny a user the Permissions permission, the Permissions link that you see at the bottomof the blog entry will be removed from the display. This user cannot change permissions onthe current blog entry.

 

Configuring the Blogs Portlet

So far, you’ve seen how to use the Blogs portlet for setting up blogs, viewing blog entries,responding to blog messages, and so on. You’ll now look at how to customize the Blogs portletitself. Primarily, you will learn to

• Set what is displayed on the application browser while users view the blog entries
• Set permissions for the entire user base

 

Controlling Output

To configure how blogs are displayed, click the Configuration icon in the Blogs application.You will see the screen shown in Figure 6-13.

 

Here you will see two options for controlling the output display: Page and RSS. Let’s lookat the various settings under each heading.

 

Page Output Options

The Page output option allows the following settings:

 

• Maximum Items to Display: This option lets you control the number of blog entries you
display per page. This number can range from 1 to 100, as indicated in the drop-down
list. The default value is 1.
• Display Style: This option gives you three choices:
• Full Content: Displays the full contents of the blog; this includes both the abstract
and the title.
• Abstract: Displays only the abstract, which consists of the blog entry’s first few
lines. This view provides a Read More link at the bottom of each abstracted entry so
that the user can view the full blog contents when desired.
• Title: Displays only the entry’s title. This option is useful if you want to save the real
estate on your screen. This view also provides a link to the full content.
• Enable Ratings: This option is checked by default. Unchecking it will remove the starrating
display from the blog-entry view. The screenshot in Figure 6-14 shows the result
of disabling this option.

• Enable Comments: This option is also checked by default. Unchecking it removes the
Comments link from the display screen so that the user will not be able to add comments
to the posted blog entries.
• Enable Comment Ratings: Leaving this option checked allows users to rate the comments
made by other users.

 

 

RSS Output

Users can view the blog entries in RSS format. A typical view of a blog output in RSS format isshown in Figure 6-15.

In the RSS area of the Blogs application’s configuration screen, you can control thefollowing:

• Maximum Items to Display: This drop-down list resembles the one in the Page area of
the configuration screen. The default value is 20.
• Display Style: Like the option of the same name in the Page area, it offers full-content
display, abstract display, or title-only display.
• Format: This option lets you select the output format: RSS 1.0, RSS 2.0, or Atom 1.0.
The default is Atom 1.0.

 

Setting General Permissions

Now you’ll see how to set some general permissions for the users of our Blogs application.Click the Permissions tab to get the regular screen for setting application permissions. It displaysthe currently assigned roles for the application user. The Available tab displays all rolesthat are available for assignment. Use this tab to look up the permissions that you can assignto or revoke from a power user. You’ll now assign permissions to the portal’s power-user roleby following these steps:

1. Check the Power User role in the displayed list.
2. Click the Update Permissions button to see the screen shown in Figure 6-16.

3. Set the desired permissions using the two arrows. You can choose from three types of
permissions:
a. Add Entry: Allows the user to add a new blog entry.
b. Configuration: Allows the user to configure the blog.
c. View: Allows the user to view the blog; this is assigned by default.
4. Click the Finished button to save your changes and put the newly assigned permissions
into effect.


 

Using the Recent Bloggers Application

With luck, you’ll encounter many active bloggers after opening up the community page toyour portal users. Knowing who your most recent posters are can help you quickly identify new entries made by your favorite bloggers. Liferay provides an application called Recent Bloggersthat helps you get this information. In fact, the Liferay site itself, which runs on the LiferayPortal engine, has this application installed on its Community page. Open the URL http://www.liferay.com/web/guest/community/home in your browser and you will see the screen similarto the one shown in Figure 6-17.

In the screen’s top-left corner, you will see the Recent Bloggers application running. Itdisplays the photos of recent bloggers; hovering the mouse over a photo displays the blogger’sname underneath.I will now show you how to set up this facility on your ISI portal.

Installing the Application

To install the Recent Bloggers application, follow these steps:

 

1. Select the Community page created in the previous section. (You can select any other
page where you wish to add the new application.)
2. Select the Add Application menu.

3. Select Recent Bloggers under the Collaboration category.
4. Add the application to the page. You should get a screen like the one shown in Figure
6-18, and the application view should show the list of recent bloggers

Configuring the Application

You’ve just seen the Recent Bloggers application display the list of recent bloggers onscreen.However, you might want to configure this application by controlling the output display. Clickthe Configuration button in the application window to get the screen shown in Figure 6-19.

Here, you will find three options that you can configure to customize the output of theRecent Bloggers application: Organization, Display Style, and Maximum Bloggers to Display.I will discuss each of these.

 

Organization

You can choose the organization by clicking the Select button and selecting the desired organizationfrom the displayed list. Several organizations defined in your portal might use yourblog, especially in the case of multinational corporations with offices in different parts of theworld. Each office works as an independent organization, so you might have organizationalunits in the United States, the United Kingdom, Denmark, China, and so on. While definingthe portal, you will need to create organizations for each such unit.

 

By selecting an organization, you are choosing to display only the recent bloggers fromthat organization. We have only one organizational unit in our ISI portal, so all the portal’srecent bloggers will be displayed in the list.

 

Display Style

The Display Style option offers two choices: User Name and Image, and User Name. The firstchoice displays the user name along with an image, which the user provided when he createdan account. Generally, bloggers provide photos of themselves to use in the image display. If nophoto is provided, a default image is used. (Instead of a photo, a user might provide a cartoonimage or other picture.)The second choice displays only the user name. You might opt for this choice if you wantto display a large number of users, most of whom have not set up images on their profiles.

Maximum Bloggers

This option controls the number of bloggers to display on screen. This, once again, is a discretevalue in the range of 1 to 100. The default value is 10.

 

Using the Blogs Aggregator Application

Instead of viewing the full blog contents, you might find it more convenient to look at theaggregated view of the blogs and then retrieve the full blog entries only for the posts you findinteresting. Liferay provides an application called Blogs Aggregator for this purpose. In thissection, you will learn to install and use this application.

 

Installing the Application

To install an instance of the Blogs Aggregator application on your portal page, follow thesesteps:

1. Select the Community page you created earlier, or any other page where you want to
add the application.
2. Select the Install Application menu.
3. Select the Blogs Aggregator application under the Collaboration category.
4. Add the application to the portal page. You should get a screen like the one shown in
Figure 6-20, where you’ll see an aggregated view of blog entries.

 

Configuring the Application

Like all the applications discussed so far, Blogs Aggregator provides customization. To customizethe application, click the Configuration icon in the application window. You will see thescreen shown in Figure 6-21.

Here you will find four customization options:

• Organization
• Display Style
• Maximum Items to Display
• Enable RSS Subscription

I will now discuss each of these options

 

Organization

The Organization option allows you to filter blog entries for a desired organization. As you didwith the Recent Bloggers application, you can select the organization filter by clicking the Selectbutton and selecting the desired organization from the displayed list. Our ISI portal definesonly one organization, so this filter will not be useful in this case.Display StyleThe Display Style option provides several choices:

 

• Body and Image
• Body
• Abstract
• Abstract without Title
• Quote
• Quote without Title
• Title

 

The Body and Image option lets you display the blog entry’s body contents, the entry’stitle, and the blogger’s profile image. The difference between this view and the view providedin the Blogs application discussed earlier in this chapter is that the options for rating,commenting, editing, and so on are not displayed on the screen of the Blogs Aggregatorapplication. So you can read the entries quickly rather than get distracted with several linksand buttons on each blog entry. The screen output when this option is selected is shown inFigure 6-22.

 

Choosing the Body option displays the title and body of each blog entry without theblogger’s image. This saves some real estate on the screen and makes it easier to focus on thecontents.The Abstract view provides the title and the first few words of the body contents. A linkcalled Read More lets a user retrieve the full body contents. The Abstract without Title optionprovides the same view as Abstract, except that the blog title is not displayed.The Quote option displays the contents of the blog entry in double quotes. As the namesuggests, the Quote without Title option provides the same view as Quote, but without the title.Finally, the Title option displays only the title of each entry.

Maximum Items to Display

The Maximum Items to Display option lets you set the maximum number of posts to displayonscreen. As in the case of the Recent Bloggers application, this is a discrete number in therange of 1 to 100. The default value is 20.

Enable RSS Subscription

The Enable RSS Subscription option, which is enabled by default, displays a Subscribe to thisblog link at the bottom of the application window. A user can click the link to subscribe to this blog and receive updates regularly in RSS-feed format. (See Chapter 4 for instructions on customizingthe RSS feed and its format.)

 

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.

 Figure 5-1. Adding the Mail application


Figure 5-2. Configuring e‑mail accounts in the Mail application

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.

Figure 5-3. Adding a Gmail account in the Mail client

 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

Figure 5-4. Gmail account settings for incoming- and outgoing-mail servers

 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.

Figure 5-5. Mail application screen after setting up e‑mail accounts successfully

 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.

Figure 5-6. Gmail inbox display in Liferay’s Mail app

 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).

Figure 5-7. Composing a new e‑mail message in the Mail application

 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.

 Figure 5-8. Configuring your IMAP mail account

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.

 Figure 5-9. Setting permissions in the Mail application

 

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.

Figure 5-11. Sending SMS messages through the SMS Text Messenger application

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.

Figure 5-12. Searching for the Chat portlet in the Plugin Installer application

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.

Figure 5-13. Chat application information

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).

Figure 5-14. Label indicating the status of the Chat application

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.

Figure 5-15. The Chat application window showing the list of online users

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).

Figure 5-17. A message and its reply in the chat window

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).

Figure 5-18. Concurrent chatting with multiple users

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.

Figure 5-19. Directory application screen

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

Figure 5-20. Displaying the search results

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.

Figure 5-21. Specifying advanced search criteria

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).

Figure 5-22. List of organizations matching the search criterion

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.

 Figure 5-23. List of selected user groups

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.

Figure 5-24. The Invitation application

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.

Figure 5-25. Configuring the invitation-message format

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.

Figure 5-26. Archiving the current message format

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.

Figure 5-27. Entering e‑mail addresses to invite friends

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.

 

 

Thursday, 06 August 2009 14:56

Creating Discussion Forums using Liferay

Setting Up a Forum

The Message Boards application that you’ll use to set up the portal’s discussion forum is listedin the Collaboration category. To use this application, first set up a new page for the discussionforum:

1. Log in to our ISI portal using the Admin account.

2. Add a new page called Forum in the Fundamental Analysts community.

3. Use the Add Application menu to add the Message Boards application to the Forumpage.

The screenshot for adding Message Boards is shown in Figure 4-1.

 Figure 4-1. Adding the Message Boards application

The Message Boards application provides these tabbed menus:

• Categories

• My Posts

• My Subscriptions

• Recent Posts

• Statistics

• Banned Users

The Categories menu option allows you to define new categories and manage existingcategories. Generally, a discussion forum contains categories associated with different topicsor types of users. For example, in the securities portal you might want two categories: one forfundamental analysts and the other for technical analysts. Offering discussion-forum categoriesmakes it easier for users to find and focus on what they want.As a user, you might be posting messages to the forum. The My Posts menu option lets youview all your posts, monitor them, and edit them.You can also offer your users the ability to subscribe to a particular discussion on theforum. A subscribed user receives notification whenever new messages are posted or newchanges are made on the given topic. The My Subscriptions menu option allows you to viewand monitor all your subscriptions.The Recent Posts menu option displays all recent posts. This saves you the trouble of sortingthe posts by date and listing all the latest ones.The Statistics menu option provides information on the number of categories, posts, andparticipants in the forum, including a list of the top posters. These statistics help you understandhow users are participating in your discussion forum.Finally, the Banned Users menu option gives you details about users who have beenbanned from participating in the discussion forum. Administrators or users with appropriaterights are allowed to ban any unwanted user; they can later unban that user so the user canresume participation in the discussion forum.You’ll now study these various menu options in depth to understand how to set up, monitor,and administer a discussion forum.

Defining Categories

The first thing you need to do while setting up a discussion forum is create categories and setaccess rights to them. For the securities portal, you’ll initially create two discussion categories:Fundamental Message Bulletin and Technical Message Bulletin. Click the Add Category buttonin the Categories menu option to create these categories. You should see the screen shown in Figure 4-2.

 Figure 4-2. Adding a new category

Here, you will enter the category name and its description. To create the Fundamentalcategory, enter Fundamental in the Name box and Fundamental Message Bulletin in theDescription box.Before you save the new category, you might want to set permissions on it. You can assigndifferent permissions depending on the user type. Generally, there are two types of users:community and guest.

You can set the permissions for each type of user in the check boxes on the Categoryscreen (see Figure 4-2). For each category you create, you can enable or restrict a user’s rightsby specifying the actions they are allowed to perform. By default, a community user is grantedpermission to add a file, add a message, reply to a message, subscribe to a discussion, or viewposts. A guest user, on the other hand, only has the right to view posts. (I’ll delve further intopermissions in the “Permissions” section under “Category Actions,” and in the “Permissionson Categories” section after that.)

After assigning the desired rights to the two kinds of users, click the Save button. You’ll seethe screen shown in Figure 4-3 if your request processed successfully.

Figure 4-3. Listing all categories

You can now see the newly added Fundamental category in the list of categories. Likewise,you can add another discussion category called Technical (for the technical analysts); you willsee this second category appear below the Fundamental category in the list.

Category Actions

After adding categories, you might want to perform certain actions on them before makingthem available to the forum users. Click the Actions button that appears on the right side of thecategory name to pull up the following choices:

• Edit

• Permissions

• RSS

• Subscribe

• Delete


 

Edit:

Under the Edit option, you can modify the name and description of your category. Plus, youcan select the category’s parent category and even merge any category with its parent.

Permissions:

Under this option, you can add roles and permissions. As I mentioned when I discussed thecheck boxes in the Category screen, you can assign certain allowed activities to communityusers and guest users. Such activities include adding messages to the discussion forum, deletingmessages, replying to messages, and so on. A community user, who enjoys more privilegesthan a guest user, can be classified as an administrator, a member, or an owner.A user who creates a community is the owner of that community. The community ownercan appoint a user as the community’s administrator, and assign administrative rights tothat user accordingly. All other users belonging to that community are classified as ordinarymembers.The actions that a user is allowed to perform depend on his or her role in the community.You can control these permissions through the Permissions menu option; when you click it,you will see the screen shown in Figure 4-4.

 Figure 4-4. Updating user rights

You’ll see two tabs onscreen: Regular Roles and Community Roles. I’ve already listedthe possible community roles: owner, administrator, and ordinary member. A guest useris classified as a regular role. Other regular roles are ordinary user, power user, owner, andadministrator. For each type of user, you can assign different rights that allow various actionson the created category.Figure 4-4 displays a list of currently assigned permissions under Regular Roles. Note thatour guest user has only the View permission. If you want to change a guest user’s permissions,mark the check box in front of the Guest user listing and click the Update Permissions button.You’ll see the screen shown in Figure 4-5.

 Figure 4-5. Selecting permissions for assignment

The actions that a guest can perform are shown in the list on the left, and the actions aguest cannot perform are shown in the list on the right. Using the two arrow buttons, you canmove these actions into the desired lists. After you complete your changes, click the Finishedbutton to see the assigned actions on the main permissions screen. You can go through thisprocess for the community-role users as well as the regular-role users.

 

RSS:

Here’s another thing you might want to do to a discussion-forum category before making itavailable on your portal: generate an RSS feed based on posts to that category. An RSS feedproves useful in several situations, especially ones in which the feed is dynamic. The RSS viewof our Honda Motors thread1 in the Automotive Industry category is shown in Figure 4-6, asseen in IE (Internet Explorer).

 Figure 4-6. RSS feed view

You can sort the feed output by date, title, or author. You and your users can subscribe tothis feed by clicking the Subscribe to this feed link (see Figure 4-7).

Figure 4-7. Subscribing to a live feed

You need to enter the name and the folder for the feed. Once you subscribe to a feed, theportal displays a confirmation message. Clicking the View my feeds hyperlink that appears onthe next screen displays a list of all your subscribed feeds. You can then select any displayedfeed and set its properties by clicking the View feed properties link. The resulting Feed Propertiesscreen is shown in Figure 4-8.

 Figure 4-8. Setting feed properties

On this screen, you can set the feed’s update frequency. The default schedule is oneupdate per day, but you can modify this setting to receive updates as often as every 15 minutesor as rarely as once a week. (You can even specify that you never want updates.) Modifythe schedule by selecting the Use custom schedule radio button and choosing the desired frequencyfrom the drop-down list. You can also choose to automatically download the attachedfiles by marking the corresponding check box. In the Archive section of the screen, you canrestrict the number of feed entries to be archived if you want to save valuable real estate onyour hard drive. You can keep a maximum of 2,500 items or specify your own limit; the portalwill archive only the most recent entries up to that limit.

Subscribe:

Yet another action you can perform on a discussion-forum category is allowing your usersto subscribe and unsubscribe to it. After users subscribe, they will be notified of posts andchanges made by other members. Members who are already subscribed to a category have theoption of unsubscribing through the Actions button, as the Subscribe menu option automaticallychanges to Unsubscribe as appropriate.

Delete:

Access the Delete option through the Actions button to delete the currently selected discussioncategory. You’ll be asked to confirm before the entry is actually deleted.

Permissions on Categories

As I mentioned in the “Category Actions” section, you can use the Permissions action menu toset the various permissions for different types of users. Now I’ll provide details about the variouspermissions that you can assign or deny to users:

• Add File

• Add Message

• Add Subcategory

• Delete• Move Thread

• Permissions

• Reply to Message

• Subscribe

• Update

• Update Thread Priority

• View

Add File

If you grant the Add File permission to your users, they will be able to attach files while postingmessages or replies (see Figure 4-9).

Figure 4-9. Attaching files to a message

A user can attach as many as five files to a reply. If the user changes her mind before postingthe reply, she can remove the list of all selected files by clicking the Remove Files button.

Add Message

Posting messages to the forum is allowed only if the user has been granted the Add Messagepermission. Users with only the View permission will not be able to contribute to the forum.

Add Subcategory

I’ll discuss subcategories further in the next section. But for now, suffice it to say that the AddSubcategory permission allows a user to add subcategories under the existing categories. Creating categories and subcategories helps organize discussion threads logically and makes iteasy for users to search, locate, and read only the threads of interest to them.

Delete

With the Delete permission, a user can delete existing categories and subcategories. Over time,some discussion threads will become stale or will have only historical importance. Deletingcategories containing those threads will improve the forum experience for new readers, whomight not be interested in viewing those threads.

Move Thread

The Move Thread permission allows a user to move a discussion thread from one category toanother. This again helps organize threads into logical units. I’ll discuss how to move a threadin the more detailed “Moving Threads” section later in this chapter.

Permissions

The Permissions permission lets a user set the various permissions described in this section.Generally, only the owner and administrators will have this permission because they are theonly ones who should have the ability to grant or deny rights to other users.

Reply to Message

A community user will have the Reply to Message permission granted by default. With it, theuser can reply to any message on the forum. A guest user will not have this permission grantedby default, and thus will only be able to view messages without replying. Generally, you’ll wantto trace who has posted replies on the forum, so you don’t want to grant this permission to aguest user.

Subscribe

With the Subscribe permission, a user can subscribe to the feeds of his choice

Update

The Update permission allows a user to modify a message.

Update Thread Priority

With the Update Thread Priority permission, a user can modify the priority assigned to athread within the current category.

View

With the View permission, a user can view messages posted by all users.

Subcategories

So far you have created two discussion categories: Fundamental and Technical. You will nowlearn to create subcategories under these categories so you can organize your information inlogical units. For this example, you’ll create a subcategory called Automotive Industry underthe Fundamental category. (You were briefly introduced to this subcategory when I discussedRSS feeds earlier in the chapter.) All the discussion threads pertaining to the automobileindustry will appear under this subcategory in the forum. To create a subcategory under Fundamental, click the category in the list displayed onthe Categories screen of the Message Boards application. Your screen will show the full path tothe Fundamental category along with a button to add a subcategory. Click this button to bringup the familiar category-addition screen. Here, you can enter the subcategory’s name anddescription, and also set permissions. After you have finished making changes, click the Savebutton to create the subcategory and add it under the Fundamental category. You can create as many subcategories as you wish to organize all the discussions intological units.

Exploring Threads

A forum thread starts when an authorized user posts a message to initiate a discussion. Usersthen reply to the post, followed by other users, and so on. In this manner, a thread can growquite large. Here’s how to create a thread.

Creating a Thread

You’ll create a thread under our Automotive Industry subcategory to open a discussion aboutthe fundamentals of the corporations in the automotive sector. Click the Post New Thread buttonin the Threads tab to pull up a screen similar to the one shown in Figure 4-10.

 Figure 4-10. Creating a new thread

Do the following for the various fields:

• Subject: Enter Honda Motors.

• Body: Enter This thread discusses the fundamentals of Honda Motors.

• Anonymous: Leave this unchecked.

• Priority: Select Announcement from the drop-down list.

• Tags: Leave this blank for now.

• Permissions: You can configure permissions as discussed earlier or leave this fielduntouched.

Before saving your changes, you might want to set the look and feel of the body contents.You can set the font, color, text alignment, and so on using the various buttons at the topof the editor. Once you are satisfied with the design, click the Save button. This saves yourchanges and posts your message to the thread. Your newly posted thread should look like theone shown in Figure 4-11.

 Figure 4-11. A typical message post

Actions on Posts:

After you have posted a message to a thread that you started, you can perform various actionson it:

• Edit: This option allows you to modify your post’s subject, body text, priority, tags, andso on. You edit existing posts with the editor you used to create the post.

• Permissions:  While creating the category, you set up the permissions for users inregular and community roles. You can edit any of these permissions using this menuoption.

• Delete:  This simply allows you to delete the current post (you’ll first be asked toconfirm).

• Reply:  This option allows you to post a reply—yes, you can reply to your own message.Sometimes you might want to a post a reply rather than edit the message itself to drawother users’ attention to your changes. When you post a reply, the new reply messageappears under the original message, so that others can see your remarks on the existingmessage. You create the reply message in a screen similar to the one you used to createa new post.• Reply with Quote: This option puts the original message body in quote tags.

All your messages and replies appear in a hierarchy at the top of the screen that displaysthe threads. Using the links in the hierarchy, you can jump to any post to edit it or reply to it. Atypical message hierarchy is shown in Figure 4-12.

 Figure 4-12. Hierarchy of posted messages

Subscribing to a Category or Thread

So far you have learned to create categories and threads. How do you know when somebodyposts a message to a thread? To get an automatic update when new posts are made or existingposts are modified, you need to subscribe to the desired category or thread.

To subscribe to a particular category, perform the following steps:

1. Click the Categories tab and locate the desired category in the displayed list.

2. Click the Actions button.3. In the displayed menu, click the Subscribe option.

You are now subscribed to the currently selected category. The menu changes accordingly,showing an Unsubscribe option instead.To subscribe to a particular thread, follow the steps listed here:

1. Select the appropriate category to which the desired thread belongs.

2. Locate the desired thread in the list of displayed threads for the selected category.

3. Click the Actions button.

4. Click the Subscribe menu option.

You are now subscribed to the currently selected thread. The menu changes accordingly,showing an Unsubscribe option that you can use to terminate your subscription to thecurrent thread.The purpose of subscribing to a category or thread is to receive notifications wheneverchanges or new posts are made. Liferay sends such notifications to all the subscribers throughe‑mail. The notification messages are automatically generated and dispatched. As an administrator,you get an opportunity to set up the format and the text of these notification messages.You will learn to set up these notification messages in the “Configuring Message Boards” sectionlater in this chapter.

Moving Threads

Sometimes you’ll want to reorganize discussion threads by moving them from one categoryto another. To do this, first navigate to the desired category to get a list of its threads (see Figure4-13) and then select the thread that you want to move.

Figure 4-13. Moving a thread to another category

At the top-right corner of the screen, you will notice the Move Thread button. Click thisbutton to get the Category selection screen as shown in Figure 4-14.

Figure 4-14. Selecting a destination for your thread

Click the Select button to get a list of categories and choose the category where you wantto move your thread. The selected category name appears after the Category label. Click theMove Thread button to complete the move operation. You will see the moved thread under thenew category.

Managing Message Boards


On the Categories screen shown in Figure 4-15, you will notice the Search Messages button.

Figure 4-15. Searching for posts

To the left of the Search Messages button, you’ll see an edit box where you can entersearch terms. When you click the button, the application searches all the messages in theforum for the search terms and displays the results. You can navigate to a particular messagefrom that display.

Now you’ll explore the other menu options in Liferay’s Message Boards application to seehow they help you manage your message boards.

My Posts

When you select the My Posts menu option, you will see a list of all your posts. This list consistsof all the threads you started as well as your posts to threads that other users started.For each thread, the application displays the identity of the thread’s originator, the numberof posts, and the number of views, in addition to the date, time, and author of the mostrecent post. A typical output screen displaying the list of posts for our administrator Anita isshown in Figure 4-16.

 Figure 4-16. Viewing your posts

You can perform various actions on each displayed thread using the Actions button, whichI discussed toward the beginning of the chapter in the “Category Actions” section. To recap,such actions include editing, setting permissions, subscribing to the thread, viewing it inRSS format, and deleting the thread. The actions available to you depend on the permissionsyou’ve been granted for the selected thread.

My Subscriptions

The My Subscriptions menu option allows you to view all your subscriptions to various categoriesand threads (see Figure 4-17). You can perform actions on your subscriptions using theActions button, just as you did with threads in the My Posts screen.

 Figure 4-17. Viewing all your subscriptions

Recent Posts

The Recent Posts option allows you to view all the recent posts made by various users. It providesinformation on each thread, including the date and author of the last post made to it (seeFigure 4-18).

Figure 4-18. Listing all recent posts

You can take advantage of the Actions button here as well, and you also get a choice tosubscribe to recent posts through an RSS feed.

Statistics

The Statistics option shows you statistics on the discussion-forum posts. It gives you bothgeneral statistics and statistics about the forum’s top posters. General statistics include theforum’s number of categories, number of posts, and number of participants. This statisticaldata helps you better monitor and manage your forum. Statistics about top posters include thenumber of posts they have made, their joining date, and the date when they last posted to theforum. You might find it useful to know who your most active users are.

 

Banned Users

You might find occasion to ban a user from your forum. The Banned Users menu optiondisplays information on all the users who are no longer allowed to participate. The screendisplays the user ID of the banned user, the name of the administrator who implemented theban, and the date the ban started (see Figure 4-19). You’ll also notice that the date on which auser can be unbanned is displayed in the list. Liferay will automatically unban the user on thegiven date unless an administrator manually specifies otherwise.

 Figure 4-19. List of banned users

To ban a user, first display a list of posts through the Categories tab or the Recent Posts tab.Then navigate to the post that has violated the rules of your forum. Under the author’s name,you will find a link to ban the user (see Figure 4-20).

Figure 4-20. Banning a user

Clicking this link will prevent the user from posting to the forum. Also, observe that thelink has changed to Unban this User. Clicking this would unban the user so that she canresume posting to the forum.

Working with Tags

As the number of your forum’s community users increases, searching through their postsmight become strenuous. The use of tags proves handy in such circumstances. You can giveusers the ability to tag their postings with important keywords. You can then search the entireforum for tagged keywords.

Tagging Contents


Tagging the contents is an easy task. When creating a message earlier, you might have noticedthe Tags edit box at the bottom of the message-editor dialog (see Figure 4-21).

Figure 4-21. Tagging messages

Adding Tags

To add new tags, use the following steps:

1. Type the desired tag name in the Tags edit box.

2. As soon as you type one or more characters, you’ll see a list of existing tags that startwith those letters.

3. You can select the tag name from the displayed list or enter a new name.

4. Click the Add Tags button.

5. The tag name will appear above the Tags label.

Tag Suggestions

If you can’t decide on the tag names for the message, Liferay provides help by suggestingsome. To get the suggestions, follow these steps:

1. Click the Suggestions button. A list of names will be displayed onscreen; Liferay getsthese names from the message contents.

2. Mark all the names you want to add to your list using the corresponding check boxes.

3. Click the Save button. This adds all selected tag names to the list of tags.

4. Note that the tags also appear above the Tags label indicating that the current messageis tagged with these keywords.

Removing Tags

Sometimes, you might wish to remove a tag applied to a message. To remove a tag, simplyclick the “x” displayed in front of the tag name. The selected keyword will disappear from thetag list.

Selecting Tags

Follow these steps to tag the current message with a preexisting tag:

1. Click the Select Tags button to pull up a list of existing tags. (I’m assuming you havealready added a few tags.)

2. Select the desired tag for the message. You can select multiple tags.

3. Click the Save button.

4. The selected tag(s) appear above the Tags label

Configuring Message Boards:

In previous chapters, you learned to configure the portlet applications that you added to yourportal pages. Similarly, you can configure the Message Boards application by creating some ofthe application’s default settings. When you click the configuration icon in the Message Boardsapplication, you will see these tabbed options onscreen:

• Email From

• Message Added Email

• Message Updated Email

• Thread Priorities

• User Ranks

• RSS

• Anonymous Postings

• Ratings

Let us now look at these options in depth.

Email From

The Email From option allows you to configure the e‑mail settings of your notification messages.The corresponding tabbed screen is shown in Figure 4-22.

 Figure 4-22. Configuring the e‑mail format for the Email From notification

Here, you need to enter the name and e‑mail address of the message sender. Mark theHTML Format check box if you want to format the message in HTML. The screen also displaysthe list of definitions used in your message.

Message Added Email

The Message Added Email option allows you to set the default format for the notification messagethat goes to subscribers when a new message is posted to the forum.You can define the Subject, Body, and Signature for the message. Liferay offers some predefinedterms you can use for these three fields, but you can choose to exclude them from your custom-formatted message. You can also type arbitrary text around the defined terms tofurther customize the message.

Message Updated Email

The Message Updated Email option functions like the Message Added Email option. It allowsyou to set the default format for the notification message that goes to subscribers when anexisting forum message has been updated.

Thread Priorities

The Message Boards application defines three priorities in the Thread Priorities screen: Urgent,Sticky, and Announcement (see Figure 4-23).

 Figure 4-23. Setting priority levels for threads

Depending on importance, priority levels are set from 1 to 3. Urgent is assigned the highestpriority level (3.0) while Announcement has the lowest priority level (1.0). For each priorityname, a URL for an image is assigned. This image gives users a visual clue regarding the messagepriority.

You are free to redefine these priority levels. For example, you might decide to createmore priority levels ranging from 1 to 5, or even 1 to 10. Edit the displayed boxes to modify thepredefined priority levels and to add new ones. You can also select the localized language ofyour choice from the drop-down list and perform the additional step of translating the text forthe thread-priority levels into that language.Once you are done with your editing, click the Save button to save your changes. You andyour users will then be able to apply these priorities to newly created messages.

User Ranks

It is always a good practice to rank the users who post to your forum. Such ranking is typicallyassigned based on the number of postings made by the user.The Message Boards application provides a set of predefined ranks, which include these:

• Youngling=0

• Padawan=25

• Jedi Knight=100

• Jedi Master=250

Each rank name is listed with the number of postings required to achieve that rank. Forexample, a newbie is assigned the Youngling rank. When a user makes 25 postings to theforum, he achieves the Padawan rank. After 100 postings, the Jedi Knight rank is assigned, andso on. You can modify the rank names as well as the number of required postings to createyour own ranking system. You can also add more ranking levels of your own.In addition to the ranks for community users, Message Boards also supplies several predefinedranks for forum moderators. As you can do with thread priorities, you can select alocalized language and translate the ranking text into this newly selected language.

RSS

In the “Category Actions” section toward the beginning of this chapter, you saw that it waspossible to view forum postings in RSS format. The RSS tabbed menu allows you to set defaultsfor your RSS feed, such as the maximum number of items to display, the display style, and theformat.You can display between 1 and 100 items in your RSS feed by making the appropriateselection from the drop-down list. The numbers initially increment by a factor of 1, then by 5,and finally by 10.For your RSS-feed display style, you have three choices: full content, abstract, and title. Ifyou decide to use a small number as your maximum, you’ll have space to display full contentin the feed. If you use a large number, you might want to display the title only. For in-betweencases, display the abstract.Finally, you have three choices for the feed format: RSS 1.0, RSS 2.0, and Atom 1.0.

Anonymous Postings

The Anonymous Postings option lets you specify whether to allow anonymous postings to yourforum. Enabling anonymous postings will allow users to post messages without signing on tothe forum. If you wish to associate each post with the identity of the post’s author, uncheck thecheck box on this screen.

Ratings

The Ratings option lets you enable or disable message ratings for the forum via a single checkbox.

 

Thursday, 06 August 2009 14:04

Managing Portal Users for Liferay

Setting Up an Organization:

We’ll call our portal International Security Investors (ISI), and we’ll define an organization withthe same name. We’ll assume that ISI has acquired the domain isi.com, and that it’s based inthe United States with offices in other countries (see Table 3-1).

 Proposed Organizational Map of ISI

We’ll create locations for the cities listed in Table 3-1, and user groups for the locationswith large user bases. You’ll learn to add user groups, assign users to those user groups, andassign roles to those users. You’ll also accommodate guest users, who will have restrictedrights on our portal.You will use Liferay’s Enterprise Admin application to define an organization and performother user-management tasks. The Enterprise Admin application allows you to create usergroups, roles, password policies, and so on. In general, if you are creating an intranet portal foryour enterprise that is distributed worldwide, this application will help you define the organizationalstructure. Use the Add Application menu to add the Enterprise Admin applicationto the Welcome page or any other portal page you’d like. (See Chapter 2 for details on creatingportal pages.)

Creating a New Organization

To define a new organization, click the Organizations tab in the Enterprise Admin application.You will see a screen similar to the one shown in Figure 3-1.Figure 3-1.
 

Figure 3-1. List of currently defined organizations

List of currently defined organizationsHere, you will find several organizations already defined in your installation. The Searchoption in the upper portion of the dialog allows you to search for an organization with a particularname. If you perform a search, all the organizations matching that search criterion willappear in the bottom portion of the screen.Alongside the Search Organizations button, you will find a button entitled Add Organization.Click this button to pull up a dialog box for creating a new organization (see Figure 3-2).

 Figure 3-2. Defining a new organization

On this screen, enter ISI in the Name edit box and select Regular from the Type dropdownbox. You have two choices for the Type setting: Regular and Location. You should assignRegular to the organization’s headquarters and Location to any of its satellite offices. SelectUnited States as the Country and Illinois as the Region. Don’t worry about assigning the organizationa unique ID; Liferay automatically does that for you.The Select button near the Parent Organization label allows you to define the parentorganization for the organization being created. Because our ISI organization is itself a parentorganization, do not click this button. After entering the information, click the Save button tosave your changes. This creates the ISI organization in your Liferay portal installation. Next,you will add some other organization details.

Adding Organization Details

After your request for creating a new organization is processed successfully, Liferay opensa dialog asking you to enter further details about the newly created organization. It displaysthree sections for adding addresses, services, and comments underneath the organizationdefinition (see Figure 3-3).Every organization has e‑mail and snail-mail addresses, web sites, phone numbers, and soon. Under the Save button, you will find four tabs:

• Email Addresses

• Addresses

• Websites

• Phone Numbers

You use these tabs to add the corresponding details to the organization.

 Figure 3-3. Dialog for entering organization details

Email Addresses

To add the organization’s e‑mail addresses, select the Email Addresses tab and click the Addbutton shown underneath. You will see the screen shown in Figure 3-4.Figure 3-4. Setting up the organization’s e‑mail addresses

 Figure 3-4. Setting up the organization’s e‑mail addresses

You’ll see an Address text box and a Type drop-down list box. You have three Type choices:E‑mail, E‑mail 2, and E‑mail 3. Enter This e-mail address is being protected from spambots. You need JavaScript enabled to view it as the e‑mail address and set its type toE‑mail; make it a primary e‑mail address by marking the corresponding check box. You canadd as many addresses as you’d like, but note that you can have only one primary address.After entering an address and its type, save your edits by clicking the Save button.

Addresses

Next, you will enter the snail-mail address of our organization. Select the Addresses tab andclick the Add button. In the resulting dialog, enter your organization’s street address andspecify whether it will serve as your mailing address and/or your primary address by selectingthe corresponding check boxes. After entering the details, save your changes. The details youentered will appear immediately on the Organization screen under the Addresses tab. If youwish to edit or delete a listed address, click the Actions button next to it and choose the appropriateoption (see Figure 3-5).

Figure 3-5. Edit and Delete options for modifying organization details

Web Sites and Phone Numbers

To enter the web site for our ISI organization, select the Websites tab, click the Add button, andenter the URL http://www.isi.com in the resulting dialog. Select its type as Public. (The otheroption for the type is Intranet.) Mark the Primary check box.To add phone numbers for your organization, select the Phone Numbers tab and click theAdd button. In the resulting dialog, add the number, the extension, the type, and whether it isa primary contact number. You can choose from several predefined types, such as fax, local,toll-free, and so on. You can enter multiple phone numbers and change them any time bygoing into the Edit option of the Actions menu.

Services and Comments

After adding the organization’s primary details, you can add a list of services that it offers. Youwill find the Services tab underneath the series of tabs for contact information. Click the Addbutton to pull up the screen for adding services offered by your organization (see Figure 3-6).

 Figure 3-6. Setting the organization’s service details

Figure 3-6. Setting the organization’s service detailsThe Type drop-down box lists several predefined services such as Administrative, Contract,Training, and so on. You can add multiple services for your organization. For eachservice, you can specify the hours of availability for different days of the week. Because we arecreating a portal that will be available to our users around the clock, we will not list any servicesfor our organization.Lastly, you can add any comments to your organization definition in the multiline editcontrol at the bottom of the Organization screen. Save all your changes. This completes theorganization definition.

Defining the Organization’s Locations

We will now add the information about our organization’s worldwide locations (see Table 3-1).Each ISI location will have its own organization that’s a child of the parent ISI organization.I’ll show you how to create the locations for the offices in India: Mumbai (formerly known asBombay), New Delhi, and Kolkata (formerly called Calcutta).To create a new child organization, click the Add Organization button in the EnterpriseAdmin application. Enter ISI-Mumbai as the organization name, select Location (rather thanRegular) as the type, and enter India as the country (see Figure 3-2). Now you need to selectthe parent organization. Click the Select button next to the Parent Organization label, thenselect ISI from the resulting list. Save your changes by clicking the Save button and return tothe organization definition screen. Here you can add details specific to the ISI-Mumbai organizationas you did for the main ISI organization.Add two more organizations called ISI-Delhi and ISI-Kolkata under the main ISI organization.Make sure that you enter the relevant details for each organization under its organizationdefinition.

Creating Users

Now we will add users to our organization. Select the Users tab in the Enterprise Admin applicationscreen and click the Add User button to get the screen shown in Figure 3-7.Figure 3-7.
 

Figure 3-7. Creating a new user

You’ll first create the Admin user to whom we will assign the administrative rights formanaging our entire portal. Provide the following information for the Admin user:

1. Screen Name: Enter Admin.

2. Email Address: Enter This e-mail address is being protected from spambots. You need JavaScript enabled to view it .

3. Prefix: Enter Ms.4. First Name: Enter Anita.

5. Last Name: Enter Thomas.6. Birthday: Provide the birthday of your choice using the drop-down boxes.

7. Gender: Choose Female.

8. Organizations: Click the Select button and choose ISI.

9. Job Title: Enter Administrator.

Save your edits. You now have a new user in your ISI organization. After you save thechanges, you’ll get a screen that lets you enter further details (see Figure 3-8).

 Figure 3-8. Entering user details

Figure 3-8. Entering user detailsNote that the image displayed in Figure 3-8 is not set automatically. I created this pictureand uploaded it for this Admin user. You can easily change the picture by clicking the Changelink under the picture and selecting the desired image file.From the User screen shown in Figure 3-8, you can set various details including the user’swelcome message, password, and roles. Let us look at these options one by one.

Display Options

Under the Display tab, you can set the user’s default language, time zone, and greeting message(see Figure 3-8). Select the default language from the Language drop-down list and thetime zone from the Time Zone list. We will set this to UTC +05:30 for our Admin user Anita,who resides in India. In the Greeting message, Liferay has already added a welcome messageincorporating the username you entered while creating the user on the previous screen. Donot forget to save your edits by clicking the Save button.

Password Settings

Select the Password tab to set the password for the newly created user—enter admin as thepassword, in this case. Note that you’ll need this password the next time you sign in using theAdmin account. If you mark the Password Reset Required check box on this screen, the userwill be required to change the password during the first login. Remember to save your changesby clicking the Save button.

User Roles

Each user assumes a particular role while using the portal. Depending on the role, the user willbe assigned a certain set of permissions. The three predefined roles are:

• Regular Roles

• Community Roles

• Organization Roles

Click the Regular Roles tab and locate the Assign Regular Roles button. Below the button,you will find the two default roles that Liferay has already assigned: Power User and User. Ifyou want to assign an additional role, click the Assign Regular Roles button. This opens up ascreen that displays the list of current roles. Click the Available tab to get a list of all availableroles (see Figure 3-9).
 

Figure 3-9. Assigning roles to a user

Because we are creating an Admin user with administrator privileges, you should assignthe Administrator role. Mark the check box near the Administrator role and click the Update

Associations button above the role names. This associates the new role with the current user.Now go to the Current tab to verify that our Admin user now has three roles listed onscreen:Administrator, Power User, and User. After logging in to her account, Anita Thomas will nowenjoy administrator privileges as Joe Bloggs does. So we don’t need to log in to Joe’s accountfrom now on. We can log in to Anita’s account to create and manage our ISI portal.nTip You can now delete the default Welcome page that Liferay provided in your portal. From this pointforward, you can use the Admin account to create new pages and manage the entire site.In addition to the Regular roles, you can set the user’s Community and Organization roles.In fact, Liferay allows you to create new roles under these categories and assign them to anyuser. Click the Back button to see the tabs for Community Roles and Organization Roles. Clickingthese tabs will enable you to assign the respective roles.

User Addresses

Underneath the Display tab on the User screen, you will find a list of tabs that allow you to setthe various types of addresses for the user:

• Email Addresses

• Addresses

• Websites

These tabs allow you to enter a user’s e‑mail and snail-mail addresses, as well as a URL.The default address is the organization address. The screen for entering these details resemblesthe screen for entering the details for your new organization.

 

Phone Numbers and IDs

Under the Addresses section of the User screen, you will find a tabbed page with options forentering several IDs and phone numbers for the created user. Here are the options you can work with:

• Phone Numbers

• OpenID

• SMS Messenger ID

• Instant Messenger IDs

• Social Network IDs

• Alerts and Announcements

Adding a user phone number is similar to adding a phone number for the organization.(The default number is the organization phone number.) Likewise, adding the OpenID andSMS Messenger ID is straightforward. Just click the respective tabs and enter the requestedinformation.The Instant Messenger IDs screen allows you to add several IDs pertaining to different IM(Instant Messenger) service providers. These are AIM, ICQ, Jabber, MSN, Skype, and Yahoo!Messenger. Under the Social Network IDs, you can enter the user IDs for Facebook, MySpace,and Twitter.Finally, under the Alerts and Announcements tab, you will find the delivery-modeoptions for different types of alerts and announcements (see Figure 3-10).
 

Figure 3-10. Setting delivery options for alerts and announcements

You can choosefrom e‑mail delivery, SMS delivery, and web-site delivery, the latter of which is the default.You can opt for one delivery mode or multiple delivery modes for each type of message—General, News, or Test.Figure 3-10. Setting delivery options for alerts and announcements

Signing In As an Administrator

In the previous section, you created an Admin user with administrator privileges. Now you willlog off from the current test user and sign in using the new Admin user account. Go to the Welcomemenu and click Sign Out to sign off from the test-user account. Click the Sign In menu tolog on using the new account. Enter the following username and password:

Login: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Password: admin

If you set the user correctly in the previous section, your login will succeed and you willsee the message with “Anita Thomas” displayed in the Sign In application of the Welcome page(see Figure 3-11). Of course, the first time you sign in, you will need to accept the terms of use.

Figure 3-11. Welcome screen for the new Admin user

If you didn’t already do so in the section “Setting Up an Organization,” add the EnterpriseAdmin application to your Admin page. Note that the Enterprise Admin application is enabled,indicating that the current user has privileges to use this application. These privileges aregranted only if the user is authorized to play the Administrator role.

Adding More Users

Using your Admin account, you will now add a few users to the portal. The process of creatingan additional user is the same as creating the Admin user (see the “Creating Users” section).Under the Users tab in the Enterprise Admin application, click on the Add User button toadd a new user. As you did with the Admin user, enter the appropriate details and select theappropriate organization. Then you’ll be prompted to enter the additional information aboutphone numbers, addresses, and IDs.You can use the default roles for the new users, or assign some of them only the Guest role.Later on, you will be able set the privileges for each role to control which pages and applicationsare available to a given user under a certain role. For the time being, create a few users atdifferent organizational locations. (Read more about roles and permissions in the section “SettingPermissions over a User” under “Performing Actions on Users.”)For this example, let’s create users with usernames consisting of two letters followed byfour numbers. The first letter designates the user’s location: m for Mumbai, d for Delhi, or k forKolkata. The second letter designates whether the user is a fundamental analyst (f) or a technicalanalyst (t); later we’ll assign those users to corresponding groups. The four-digit numberindicates the order in which the user was created. So your first few fundamental analysts inMumbai would be named mf0001, mf0002, and so on. Your first few technical analysts in Kolkatawould be kt0001, kt0002, and so on.

Creating User Groups

Now, we will create two user groups: the Fundamental Analysts and the Technical Analysts.Select the User Groups tab in the Enterprise Admin application screen; you’ll have the optionto search for an existing user group or to create a new user group. Click the Add User Groupbutton to create a new user group. Your screen should look like the one shown in Figure 3-12.
 

Figure 3-12. Defining a new user group

On this screen, enter the name and description of the user group you want to create. Forthe first group, enter the name Fundamental Analysts and this description: This group meetsthe requirements of fundamental analysts. For the second group, enter the name TechnicalAnalysts and this description: This group meets the requirements of technical analysts.Saving your edits brings you back to the Enterprise Admin screen, where you will find thenewly added groups listed at the bottom.

Assigning Members to User Groups

Your next task is to assign members to the user groups you just created. Select the UserGroups tab in the Enterprise Admin application again. You will see a list of available usergroups. Click the Actions button associated with the group to which you wish to add members.You’ll see a menu that shows the different actions you can perform on the selectedgroup (see Figure 3-13
 

Figure 3-13. Permitted actions on user groups 

Click the Assign Members option. The resulting screen shows a list of currently assignedmembers, which in our case is empty. Click the Available tab to see which users are availableto add to the list (see Figure 3-14).Figure 3-14.

 

Figure 3-14. List of users available for assignment

Select users such as kf0001, mf0001, and mf0002 by marking the corresponding checkboxes in the list. Or you could use the Search Users facility to locate the desired users. Clickthe Update Associations button to add these users to the currently selected group. If younow select the View Users option under the group’s Actions menu, you will see all membersof the group.The other actions you can take on a user group include setting permissions by assigningroles, managing pages belonging to a group, editing the group information, and deleting thegroup itself. Some of these options closely resemble the actions you can perform on individualusers, which we’ll discuss in the “Performing Actions on Users” section.

Organization Structure

If you have followed all the steps for creating the ISI organization, creating users, defining usergroups, and assigning members to those groups, your organization structure should look likethe one shown in Table 3-2

 Table 3-2. ISI Organization Structure

Performing Actions on Users

Clicking the Actions button associated with an individual user on the Enterprise Admin application’sUsers screen yields these options:

• Edit• Permissions

• Manage Pages

• Impersonate User

• Deactivate

You will now study each of these options.

Editing User Information

If you select the Edit action on a user, you can edit the user’s details in the same screen thatyou used to create the user. You can assign new values to the fields Screen Name, EmailAddress, First Name, Last Name, and so on. In addition to the basic details, you can also editthe password settings, roles, addresses, and web sites, phone numbers, SMS IDs, and IM IDs.Save your changes when you’re done.

Setting Permissions over a User

With the Permissions option in the actions menu, you can assign various permissions regardinghow other users can manipulate a selected user’s account. For example, you can determine whether other users can view a selected user’s details. You can also remove a user’s ability todelete his own account or edit his own details.To work with the permissions over a user, click the Available tab under Regular Roles. Anedit-permissions screen for a typical user is shown in Figure 3-15
 

Figure 3-15. Assigning permissions to a user

Select the Power User role and click the Update Permissions button. You will see thescreen shown in Figure 3-16.On this screen, you will see the various privileges available to the Power User role over theselected user. The list on the left displays what users under that role can do with the selecteduser’s account; the list on the right displays what those users can’t do. Using the two arrowbuttons shown between the lists, move the actions from one list to another to achieve thedesired permissions. After completing the changes, click the Finished button to return to theedit-permissions screen.

You will find the new set of permissions listed to the right of theselected role.When a user in this role signs on to the portal, she will have the permissions over theselected user as you defined on this edit-permissions screen.

 Figure 3-16. Updating permissions for the Power User role

Managing Pages

The Manage Pages option in the actions menu allows you to manage a list of pages for theselected user. You can add new pages, arrange their hierarchy, set the display order, apply differentpage templates, and so on. These options are the same as the ones offered by Liferay’sManage Pages menu option that we discussed in Chapter 2.

Impersonating a User

With the Impersonate User option, you can impersonate the selected user. So if you have currentlylogged in as our administrator, Anita Thomas, and if you select this menu option onanother user named Funda User0002, you will find yourself logged in as Funda User0002 ina new browser window. You’ll also see a message that clearly states you are impersonatinganother user. The message displays a link allowing you to return to your own user account (seeFigure 3-17).Figure 3-17. Impersonating a user

Deactivating a User

Clicking the Deactivate option deactivates the selected user (after you confirm the deactivation,of course). After the user is deactivated, he will be removed from the list of users.

Establishing Password Policies

By this time, you have created an organization and added several users to it. Each of theseusers will log on to our portal using the username and password supplied by the administrator.It is important that the user set her own password—she shouldn’t use the administrator assignedpassword forever. In fact, you saw earlier (in the “Password Settings” section under“Creating Users”) that the administrator can force the user to change her password during herfirst login. However, we need better password policies than this to ensure the safety and securityof our portal. Liferay provides a default password policy and also allows you to create yourown policies for securing your portal.To edit the existing password policy or to create a new policy, select the Password Policiestab in the Enterprise Admin application. You will find the Default Password Policy in the list ofavailable policies. By default, this is the only policy available to you, so you will now create apolicy of your own. To do so, click the Add Password Policy button to open the screen shown inFigure 3-18

Figure 3-18. Creating a new password policy

 

Enter a name and description of your choice for this new policy. If you want a forcedchange on the password, enable the Changeable check box. Also mark the Change Requiredcheck box and select the Minimum Age to one of the values displayed in the drop-down list.Your users will now be forced to wait until the indicated time period elapses before they areallowed to change their password.In addition to a forced change in password, you can set several features on your passwordpolicy:


• Syntax Checking Enabled: If this option is enabled, the entered password would bechecked for its length and/or compared against certain words.

• History Enabled: If this is enabled, the portal maintains a history of passwords and preventsthe user from repeating previous passwords.

• Expiration Enabled: When this is enabled, the user’s password expires after the specifiedtime period elapses.

• Lockout Enabled: When this option is selected, the portal automatically locks out theuser after a certain number of login failures.

 

When you select any of the preceding options, the application displays further optionsthat allow you to fine-tune the selected feature (see Figure 3-19).Figure 3-19. Available options for a new password policy

 Figure 3-19. Available options for a new password policy

Changing Default Settings

In the process of creating an organization, defining its structure, and adding users, you probablynoticed that Liferay assigns default values to several fields. You can actually change thesedefault settings and assign your own values to certain fields. Here are the settings you canchange:

• General Settings: You can specify name, ticker symbol, mail server, and so on.

• Authentication: You can control how a user is authenticated on the portal.

• Default User Associations: You can set the default communities, roles, and user groups.

• Reserve Screen Names: You can reserve screen names and e‑mail IDs so that nobodyelse can use them.

• Mail Host Names: You can set the mail-host names.

• Email Notifications: You can set the default e‑mail addresses and templates for notificationmessages.

You will now study each of these options in detail.
 

General Settings


The General settings screen is shown in Figure 3-20

Figure 3-20. Default general settings

You will change the default values and use values specific to the organization. Enter thefollowing information in the General settings dialog:

• Name: ISI

• Legal Name: ISI Ltd.

• Ticker Symbol: ISI

• Industry: Finance

• Type: Securities

• Mail Domain: isi.com

• Time Zone: EST

Leave the rest of the fields at their default values. Save your edits by clicking the Savebutton.In the Display subscreen, you will find the Liferay logo. You will now set your own logohere. Click the Change link underneath the displayed logo. In the file-selection dialog, enterthe path and file name of the ISI enterprise logo. Save your changes. The modified screen isshown in Figure 3-21.
 

Figure 3-21. Modifying general settings

When you return to full-page view, you will find the new logo displayed on the page.nNote Not all page themes display the logo. Figure 3-21 uses the Classic theme, which displays the logo,but themes such as Jedi and Transparentia do not.

Authentication

On the Authentication screen, you will find several settings pertaining to different types ofauthentication:

• General

• LDAP

• CAS

• NTLM

• OpenID

• Open SSO

• SiteMinder

General Settings

The General settings screen for authentication is displayed in Figure 3-22.Figure 3-22. General settings for authenticating a user

 

Figure 3-22. General settings for authenticating a user

Here, you can select the mode of authentication. This can be any of the following threevalues:

• By Email Address

• By Screen Name

• By User ID


Depending on this value, the user will be required to enter her e‑mail address, screenname, or user ID while logging in to the portal. You can then mark the desired check boxes tochange other authentication settings. For example, you can allow the user to log in automaticallyusing her previously entered credentials. And if the user forgets her password, she canrequest the password by e‑mail. You can also allow strangers to create accounts.

LDAP

Liferay supports several LDAP servers for user authentication. On the LDAP settings dialog,you will find a list of several servers:

• Apache Directory Server

• Fedora Directory Server

• Microsoft Active Directory Server

• Novell eDirectory

• OpenLDAP

• Other Directory Server

 Select the directory server that your organization is using and enter its relevant details (see Figure 3-23).

 

Figure 3-23. Directory-server settings

Here, you will be required to enter the server-connection details, specify search filters foruser authentication and mappings, specify search filters for groups and their mappings, selectthe password policy, and so on. Note that these details depend on the particular server and itsinstallation. Liferay facilitates the verification of details by providing several test buttons onthis screen.

Others

Other tabs listed on the Authentication screen include CAS, NTLM, OpenID, Open SSO, andSiteMinder.On the CAS settings screen, you will have to enter the login/logout URLs, the server name,the service URL, and other details. On the NTLM settings screen, enter the IP for the domaincontroller and the domain name. On the OpenID screen, there are no additional settings. Yousimply need to enable this option by marking the Enabled check box. On the Open SSO screen,enter information such as the login/logout URLs and service URL, as well as attributes forscreen name, e‑mail address, first name, and last name.

 

Default User Associations

You can set the default associations for the newly created users in the Default User Associationsscreen under the top-level Settings tab in the Enterprise Admin application (see Figure 3-24).

 

Figure 3-24. Setting default associations for a new user

Here, you can enter the default community names in the top multiline edit control. In thecase of multiple community associations, you enter each community name on a separate line.The newly created users will be automatically associated with the communities listed here.In the second multiline edit control, enter the roles to be associated with the newly createduser. The two default roles are Power User and User. You also saw two Liferay-definedroles, Administrator and Guest; you can add these roles here if you wish to associate them withthe new user.In the third multiline edit control, enter the names of the groups that a new user willbelong to.

Reserved Screen Names

On the Reserved Screen Names screen, you can reserve one or more screen names and e‑mailaddresses to prevent new users from setting up accounts with those values.

 

Mail Host Names

Click the Mail Host Names tab to list additional mail-host names. Note that you already set themain Mail Domain in the General subscreen within the Settings screen (see Figure 3-20).

 

Email Notifications

The Email Notifications screen has three subscreens: General, Account Created Notification,and Password Changed Notification. Click the General tab to set the sender’s name and e‑mailaddress for account-related messages generated by your portal. In the other two subscreens,you’ll find Liferay’s default notification templates for messages confirming that a user hascreated an account or changed a password. The Account Created mail-notification templateis shown in Figure 3-25. You can modify the message using the various terms defined underneaththe text editor.

 Figure 3-25. E‑mail template for Account Created notification

Suppose that our administrator, Anita, creates a new user. That user will receive an e‑mailnotification as shown in Figure 3-26. You can modify the Password Changed template in asimilar manner.

Figure 3-26. E‑mail notification message about a new account

Editing Settings for Default Plugins

Finally, you can configure the default plugins that will be available to your portal users.Remember that plugins are basically the portlet applications that the user can install on herpages. Using the Plugins tab, you can configure what portlets, themes, layout templates, andother plugins your portal users are allowed to use depending on their roles. Here, for example,you can determine that power users can access only certain themes and add only certain portletsto their pages.Under the Enterprise Admin application’s Plugins tab, you have five secondary tabs:

• Portlet Plugins

• Theme Plugins

• Layout Template Plugins

• Hook Plugins

• Web Plugins

Figure 3-27. List of default portlet plugins

Here, you will find a list of portlet plugins arranged alphabetically. These are Liferay CorePlugins, so you should leave them as Active. However, you can set the roles under which theseapplications will be made available to our users; these roles are listed in the third column ofthe table. Click a plugin name to access a screen that lets you change the plugin’s default settings.For example, when you click the Activities portlet link, you will see the screen shown inFigure 3-28.In the multiline edit control, you will find the list of roles under which this plugin is available.Change this list to meet your requirements. To deactivate the plugin, uncheck the Activecheck box.Similarly, you can repeat this same process to change the default settings for other typesof plugins such as themes and layout templates.
 

Figure 3-28. Assigning roles for access to a plugin

 

Creating Communities

So far, you have created users and user groups within an organization. The Fundamental Analystsand Technical Analysts user groups are classified according to the respective users’ area ofinterest. But the portal administrator controls user-group membership. If you want to create adifferent kind of group that the users themselves can control, you should create a community.A community can be of three different types:

• Open

• Restricted

• Private

An open community allows the user to join and leave at any time. In the case of arestricted community, an administrator must admit the user requesting a membership. A privatecommunity is equivalent to a restricted community, but it’s not listed in the Communitiesportlet, which you use to create and manage communities. I’ll discuss this portlet next.

Installing the Communities Portlet

To install the Communities application on your portal page, follow these steps:

1. Navigate to the portal page where you wish to add the Communities application.

2. Select the Add Application menu from the Welcome drop-down list

3. Locate the Communities application under the Community category.

4. Add the application to the portal page. Your screen at this stage should look like theone shown in Figure 3-29.

 Figure 3-29. Adding the Communities application

Creating a Community

To create a new community, follow the steps listed here:

1. Click the Add Community button in the Communities portlet.

2. Perform these steps in the resulting screen:

a. Name: Enter Fundamental Analysts.

b. Description: Enter A community for fundamental analysts.

c. Type: Select the Open category.

d. Active: Leave this box checked.

3. Save your edits by clicking the Save button.

Repeat those steps to create another community called Technical Analysts. Now that you’ve created two communities, you’ll need to associate users with them.

Associating Users with Communities

Individual users, users belonging to an organization, and users who are part of a user groupcan also be associated with any community. To associate a user with a community, followthese steps:

1. Click the Available Communities tab on the Communities application’s main screen.You will see the list of all available communities (see Figure 3-30).

Figure 3-30. Displaying available communities

2. Click the Actions button associated with the Fundamental Analysts community.

3. Select the Assign Members menu option.

4. Select the Available tab under the Users main tab to see a list of all available members.Members already associated with the specified community have a checked box displayednear their usernames.

5. Mark the check boxes associated with the users whom you wish to add to thecommunity.

6. Click the Update Associations button to associate the selected users with the specifiedcommunity.

7. If you wish to add all the members of an organization to a community, click the Organizationsmain tab and click the Available tab underneath it to see the list of availableorganizations. If you want to skip this step, proceed to step 10.

8. Select the organizations that you wish to associate with the specified community.

9. Click the Update Associations button to create the new associations.

10. To associate an entire user group with a community, click the User Groups main tab,click the Available tab underneath it, select the desired group(s), and click the UpdateAssociations button.

 

You will be using these communities in later chapters to perform certain common tasks.

Thursday, 06 August 2009 13:29

Creating Portal Pages using liferay

Creating the Securities Portal

You have installed and tested the Liferay installation on your machine. Now, open Liferay Portal by typing this URL into your web browser:

http://localhost:8080.

You need to log in before you create your first portal page. At the top-right corner of the screen, you will find a Welcome! drop-down menu. Click the down arrow to see the list of menu choices, and select Sign In to pull up a sign-in screen (see Figure 2-1).

Figure 2-1. The sign-in page

Enter the following login information:
Login: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Password: test

After successful login, Liferay displays the Terms of Use on your screen. If you tested yourinstallation earlier (as described in Chapter 1), you will not get the Terms screen again.When you accept the terms, you will see the Welcome page. You’ll see a Welcome tab at the top-left corner of the page and an Add Page hyperlink at the top-right corner. You will use the latter to add pages to your portal.

Adding a Page

Clicking the Add Page menu adds a blank page to your portal and asks you to name the correspondingtab. Enter the name Home in the tab and click the Save button next to it. You now have a new page with the tab name Home (see Figure 2-2). Click this newly created tab to switch to your Home page, which is just a blank page right now. You need to add applications to it to make it meaningful.Figure 2-2. A blank Home page

Figure 2-2. A blank Home page

Deleting a Page

Before you add more pages to your web portal, you should understand how to delete a pagefrom the portal. If you accidentally add a page that you don’t want, deleting it is simple. To gothrough the process, you’ll delete the newly created Home page. First deselect the Home pageby selecting another page—the Welcome page, in this case. Now place the mouse cursor onthe Home tab. You will notice that a red button appears on the top-right corner of it. This is thebutton for deleting the page.

When you click this button, both the Home tab and Home page disappear from your portal.Of course, before deleting the page, Liferay asks you for confirmation. The page is deletedfrom the portal only when you confirm that you want it removed.

Changing the Page Name

If you want to change the name of an existing page during portal development, you can simplyclick the tab name of the desired page. When you hover the mouse cursor over the name, thecursor becomes a text-insertion icon. Clicking the tab at this point pops up an edit box withthe current tab name. You can now edit the displayed name. Click the Save button next to theedit box or simply hit the Enter key to save your changes. The new name now appears in thetab. If you decide to discard the changes, click any other tab to deselect the current page or hitthe Esc key. Doing this discards your changes and retains the old name in the display tab.Now that you’ve seen the process of creating and deleting a web page in your portal alongwith changing the name of an existing page, you should add several more pages.

Adding Multiple Pages

Because our portal will cater to the needs of both fundamental and technical analysts, you’llcreate portal pages to meet the requirements of both groups. The page for those who believemore in fundamental analysis will aggregate the corporations’ fundamental information andprovide analysis by experts. The page for technical analysts will contain technical informationsuch as charts, tickers, and so on.In addition to the fundamental and technical pages, you’ll also create a page for communitycollaboration. You’ll host several community-related activities on this page such asmessage boards, blogs, calendars, wikis, and so on.Finally, you’ll need a page for the portal administrator. So you’ll create these new pagesfor your portal, following the previous instructions on adding pages:

• Home
• Fundamentals
• Technicals
• Community
• Admin

Adding Child Pages

So far you have created the portal’s main pages, whose names appear in their page tabs. Mostof the time you’ll find it sufficient to create only the main pages, but in certain situations youmight want to create child pages for the main pages. The user will access these child pagesthrough submenus of the main pages’ tab names. You’ll now add a few child pages to theCommunity page.

To add a child page, click the Welcome drop-down box shown on the top-right corner ofthe screen. Select the Manage Pages menu option from the displayed list (see Figure 2-3).Figure 2-3. Menu options available under your login

Figure 2-3. Menu options available under your login

Clicking the Manage Pages menu option opens the application that lets you manage yourweb pages (see Figure 2-4).

Figure 2-4. The Manage Pages application screen

Here, you will find options for editing a page, changing its look and feel, and exportingand importing page data. By default, the application opens in page-edit mode and displays theinformation on the currently selected page. On the left side of the page, you will see the hierarchyof all the pages currently defined in the portal.To add a child page under the Community page, first click Community from the list ofpages on the left and then click the Children tab. This changes the screen to child-page mode(see Figure 2-5).

Figure 2-5. Child-page entry screen

Enter Fundamental Analysts as the name for the new page. Leave the other values as theirdefaults and click the Add Page button to add the page under the Community main page. Addtwo more child pages under the Community page with the names Technical Analysts andGeneral Investors. Each time you add a child page, the hierarchy on the left side of the screenupdates to show you the newly added page.nNote You will be required to expand the node hierarchy to see the child pages. Initially, before any childpages are defined, the nodes don’t display expansion icons. Once you add child pages, you can access theirnodes using the new expansion icons in the tree.After you add the three child pages, your page hierarchy should look like the one shown inFigure 2-6.

Figure 2-6. The complete hierarchy of the main and child pages

Now, return to the main screen by clicking the Return to Full Page link at the top-rightcorner of the screen.Changing the Page’s Display OrderSo you’ve added several pages to your web portal. But perhaps you are not satisfied with theorder in which the pages are arranged in the display tabs. To modify the order, click the Pagestab in the Manage Pages application and select the top node in the displayed list. Select theDisplay Order tab on the right side of the page to bring up the list of child pages in a list box.Alongside the list box, you will find up and down arrow buttons. Select one of the childpages in the list box and use the arrow buttons to move it up or down in the list. Once you aresatisfied with the new list order, click the Update Display Order button. Click Return to FullPage to examine your changes.To set the display order of any other node’s child pages, select the node in the tree hierarchyand follow the same steps. Figure 2-7 shows how the screen looks when you select theCommunity node and access the Display Order tab.

Figure 2-7. Editing the page’s display order

Editing a Page

You can edit a page to change its tab name, HTML title, and so on. In the Manage Pages application,select the top-level Pages tab, then the Page tab underneath. Select the page you wantto edit from the hierarchy; let’s do the Fundamentals page first (see Figure 2-8).If you wish to change the page name, type it in the Name edit box. In the HTML Title editbox, type the title for the page. Leave the type as Portlet. In the Friendly URL edit box, changethe default URL to /Fundamental. By default, Liferay assigns a URL to every page that you create.It would be difficult to remember all the machine-generated URLs, so it’s a good idea toassign a URL of your choice to each created page using the Friendly URL edit box.You can set the page’s icon using the Browse button to populate the Icon field. Once youare satisfied with your edits, click the Save button to save your changes.Likewise, select other pages in the hierarchy to edit them. After you complete the edits onall the desired pages, click the Return to Full Page link to return to your portal and verify your changes.

Figure 2-8. Edit options for a page

Applying Themes

So far, you have learned to add, delete, and customize pages in your portal. A page added tothe portal is displayed in the tab list.

Clicking any tab brings the corresponding page to the forefront. But how do you changethe look of your entire portal? In other words, how do you change the header, footer, pagelogo, placement of tabbed menus, and so on? Liferay allows you to change the look and feel ofyour entire portal by providing themes. A theme basically defines the look of your web page.Liferay provides some default themes, and many more themes created by Liferay user communitiesare available to you.You will now learn to apply a new theme to our web portal. Start the Manage Pages applicationand select the Look and Feel tab from the top-left corner of the page (see Figure 2-9).The changes you make here will apply to all the pages you have created.

Figure 2-9. Theme selection page

On this screen, you will find a list of themes provided in the Liferay installation. Each itemon the list also shows a thumbnail image of how your screen will look after applying the correspondingtheme. The currently applied theme for our portal is Classic. Select the Liferay Jeditheme instead. Observe the changes by returning to full-page view and navigate to differentpages to verify the application of the new theme.The Welcome page of our web portal after the Liferay Jedi theme is applied is shown inFigure 2-10.

Figure 2-10. The Liferay Jedi theme

Individual Page Themes

It is also possible to apply a different theme to each page in your portal. To do so, once againstart the Manage Pages application. Select the page to which you want to apply a new theme.You will see several options for editing the page; click the Look and Feel tab. You will see thelist of available themes as you did when applying a theme to the entire portal. Select a differenttheme for the chosen page. Likewise, select different pages from the page hierarchy and applya new theme to each one. Once you have completed the changes, return to the portal. Nowview the pages by clicking their respective tabs. You will find that each displayed page has adifferent look depending on the applied theme.

Installing New Themes

Liferay provides many themes beyond what’s included in the basic product. You can downloadand install these themes from the web portal that you have created so far. The themesare packaged in .war files as web applications. You will need to download and deploy theseon your web server using the Plugin Installer application that Liferay provides. As the namesuggests, Plugin Installer allows you to install new themes, portlets, and layout templates. I’llshow you how to add this application to the web portal’s Admin page.

Click the Admin tab to activate the administration page. This page is currently blank; itdoes not contain any applications. To add an application to this page, select Add Applicationfrom the Welcome menu (see Figure 2-11).

Figure 2-11. Add Application menu choice

Clicking the Add Application menu displays the list of available applications on the leftside of the screen (see Figure 2-12).

Figure 2-12. List of applications you can add to your page

The applications are arranged by category. Click the Admin menu item, select the PluginInstaller application, and click the Add button next to it. You will find that the application hasbeen added to your Admin web page (see Figure 2-13).

Figure 2-13. The Plugin Installer application screen

Caution You must be connected to the Internet while performing these steps.

In the Plugin Installer application, you will find theme plugins, portlet plugins, layouttemplateplugins, and web plugins. Click the Theme Plugins tab to see the list of availablethemes and select the Envision 5.1.1.2 theme as an example.

Selecting the theme displays the product information on the next screen (see Figure 2-14)

Figure 2-14. Product information on the selected application

Click the Install button to download and install the theme. After the theme downloadssuccessfully, you will get a Done message at the bottom of the screen, after which Liferayperforms the installation. It takes a few seconds to install the theme on the server; you canmonitor the installation process on the web-server console. Once the theme has deployed successfully,return to the full-page view of your portal.You can now apply the new theme to a page of your choice. When you drill down to theThemes option in your Manage Pages application, you will see the newly added theme asshown in Figure 2-15.

Figure 2-15. Updated theme-selection page

Select the new theme to apply it to your web page. If you’re using the Envision theme,your page will look like the one shown in Figure 2-16.

Figure 2-16. A page with the Envision theme applied

The Plugin Installer application makes it easy to download and install themes directlythrough your Liferay portal. But you’ll need to follow a different process to use themes fromLiferay’s user communities. I’ll discuss that next.

Downloading Community Themes

You can download the community themes from the Liferay web site (http://www.liferay.com).Under the Downloads menu option, you will find the Official Plugins and Community Pluginsmenu options. Select Community Plugins to display a product list that includes portlet plugins,layout-template plugins, and theme plugins. The list runs across multiple pages, but I’veincluded a partial screenshot of one of the pages (see Figure 2-17).

Figure 2-17. Community Plugins download screen

Scroll down the list on the first page and select the Transparentia theme for our portal.(If you do not find this theme listed on the first page by the time you read this book, usethe search facility to locate it.) This takes you to the product description page as shown inFigure 2-18.
 

Figure 2-18. Product description screen of a typical community plugin

At the bottom of the screen, click the Actions button associated with the most recent versionof the plugin. Then click Direct Download to start downloading the plugin’s .war file. Savethe file to a desired location.

Installing Community Themes

To install the Transparentia theme you just downloaded from the Liferay web site, start thePlugin Installer application and click the Upload File tab. You will see the screen shown inFigure 2-19.

Click the Browse button to select the previously downloaded .war file corresponding to thedesired theme, then click the Install button to install the new theme on the application server.You can verify that the theme is installed by viewing the available themes in the Manage Pagesapplication, and you can apply the new theme from there.

Figure 2-19. Uploading a new theme to the server

By this time, you have learned to add portal pages and delete them, edit individual pages,set page themes, and so on. Now for the most important part: adding content to your portalpages.

Aggregating Content

In this section, you will learn to add applications and aggregate their contents for display ona single page. You’ll be aggregating Java portlets from Liferay and its community sites. In general,you should study the functionality of the available portlets to see whether they suit yourportal’s requirements. In this case, you’ll initially focus on applications that fulfill the businessrequirements described in the section “Defining the Securities Portal.”Begin by customizing the Home page: activate the Home page on the portal by clickingthe respective tab. To display the list of available applications, select the Add Applicationmenu item from the Welcome drop-down list. (You saw this list earlier while adding the PluginInstaller to your Admin page.) Let’s now examine the different categories and applicationsavailable for use:


• Admin
• CMS
• Collaboration
• Community
• Entertainment
• Finance
• News• Polls
• Religion
• Sample
• Shopping
• Tools
• Undefined
• Wiki

 

Setting Up the Home Page:

Adding an Introduction

To put a portal introduction on the Home page, add the Journal Content application fromthe CMS category. After you’ve done this, your screen should look like the one shown inFigure 2-20.Figure 2-20.
 

Figure 2-20. The Journal Content application screen

The Journal Content application screenAt the top of the application screen, you will find links that allow you to set the look andfeel and to configure the application. Next to the Configuration link, you will find the Closelink. Clicking this link removes the application from the web page (after you confirm you’dlike to delete it, of course). At the bottom of the application screen, you will find two icons: oneallows you to select an existing article for display; the other allows you to add a new article.You don’t have any articles yet, so select the option to create a new one.

Creating an Article

Click the Add Article icon to bring up the screen shown in Figure 2-21. Here, you will be able tocreate a new article for display.Figure 2-21. Adding contents to a new journal articleIn the article editor, enter the following information:Welcome toInernational Security Investors PortalAre you a small investor or a big investor? Do you invest in domestic markets or worldmarkets? Are you a short-term investor or a long-term investor? Do you trust technicalanalysis or fundamental analysis? It doesn’t matter. As long as you trade in securities,this portal is for you.

 Figure 2-21. Adding contents to a new journal article

After entering the information, select and format the text as you wish. (I’ll show you sometypical sample output later in this section.) After you are done with the text editing, enter thearticle name as Welcome Journal and click the Save and Approve button at the bottom of thescreen. This returns you to the portal Home page, where you’ll be able to see the journal-articleentry as you formatted it.

Adding an Image

You will now add an image to the journal article. Open the main Journal Content applicationscreen to display your article list. Select an article and click the Edit Article icon to open it inthe editor. Place the cursor at the top-left corner of the article where you would like to add theimage, and click the Insert/Edit Image icon in the editor toolbox to open the Image Properties dialog (see Figure 2-22).
 

Figure 2-22. Selecting an image for the journal article

Selecting an image for the journal articleIn the Image Properties dialog, you need to enter the URL of your image. You haven’tloaded the image on the server yet, so click the Browse Server button to see the list of availableservers. Select the Guest folder and create a new subfolder called Images where you will storeyour uploaded image documents. The corresponding screenshot is shown in Figure 2-23.

Figure 2-23. Selecting a folder for uploading images

 

Selecting a folder for uploading imagesSelect the Images folder and click the Browse button to locate the image file you want toupload. After selecting the file, click the Upload button to upload the image file to the server.After the image is uploaded, you will return to the Browse Server screen where you can selectthe recently uploaded file. The URL of the file now appears in the edit box in front of theBrowse Server button on the Image Properties screen.

Stay in the Image Properties screen and enter some Alternative Text in the correspondingedit box, such as ISI Logo. When you hover the mouse cursor over the image, thealternative text you just entered will appear as a tool tip. At this stage, you should be ableto see the image along with the rest of the text in your Image Properties window. Click theOK button in the image-selection dialog, then click the Save button in the editor window toreturn to the Home page and view the changes. You should be able to see both the text andimage in the journal entry.

Setting Look and Feel

You will now add some design elements to the article. Click the Configuration button (the firstbutton on the left in the group of four buttons displayed in the right-hand corner) and selectthe Look and Feel menu item from the displayed list. You will see the configuration dialog asshown in Figure 2-24.

 Figure 2-24. Journal Content portlet-configuration screen

Here, you will be able to set the text, background, border styles, margins, and paddings.Click the Background Styles tab to set the background color for the article (selectblue, in this case).

Now set the margins and paddings using the Margin and Padding tab. Set the Padding to20 px and leave the Margin setting as is. Now set the portlet title by clicking the Portlet Configurationtab. You’ll opt for a blank title, so remove any contents from the Portlet Title edit box.Check the Use Custom Title check box and uncheck the Show Borders check box next to it. Thelatter action will remove the application border when it is displayed on the portal page.

Click the Save button to save all the changes you have made to the Journal Content portlet.Close the dialog to return to the Home page, where all your changes should be reflectedin the displayed journal entry. At this stage, your Home page should look similar to the oneshown in Figure 2-25. (The appearance might differ, depending on the colors you chose andthe picture you uploaded.)

 Figure 2-25. The customized Home page

Now you’ll add a few more applications to your Home page, starting with the News applicationthat lets the user see the latest stock-related news when visiting the portal.

Adding News

Liferay provides a portal application for an online news feed. You will find this News portletlisted under the News category of the Add Application list. Add this News application to yourHome page and view the changes (see Figure 2-26)

 Figure 2-26. The News application

As in the case of the Journal Content application, you will find icons for setting the lookand feel of the application and configuring it. In addition to these two icons, you will find twonew icons called Preferences and Guest Preferences, which let you set the news feed. Use thePreferences option to get news related to equities markets. After clicking the Preferences icon,you will find the News Selections dialog with several news categories displayed in it. By default,two news feeds are already selected for you:


• International relations under the Society category
• Top stories under the Top Stories category


Deselect these default options by clicking their respective links and unchecking the correspondingcheck boxes. Click the Save button to persist your changes and the Back button to goback to the previous screen. Now click the Finance category to see its various news feeds (seeFigure 2-27).Figure 2-27.
 

Figure 2-27. News feeds available under the Finance category

News feeds available under the Finance categorySelect the Securities and Stock Exchanges options. Save your changes and return to fullscreenmode. You will find that the news related to the selected choices is displayed in theNews portlet. You can select different news feeds by returning to the Preferences dialog.

Adding an RSS Feed

Now you’ll add an RSS feed to your Home page. You will find the RSS application listed in theNews category of the Add Applications menu list. Add this application to your Home page. Asyou did with the News application, you will need to customize this application by selecting thesource for the RSS feed. To select a new URL for the RSS feed, click the Configuration icon. Youwill find three URL sources listed on this page. Remove these sources by clicking the deleteicon next to each one. Add these two new URLs by clicking the URL icon and entering the followinginformation in the URL text boxes:


http://www.nyse.com/audience/systemstatus/TraderUpdates.xml
http://www.nyse.com/audience/systemstatus/flooralerts.xml

After you make the changes, your screen should look like the one shown in Figure 2-28.

Figure 2-28. Setting the RSS feed source

 

Figure 2-28. Setting the RSS feed sourceThese URLs provide news on the NYSE (New York Stock Exchange). Feel free to add anyRSS feed of your choice. You can add multiple URLs for different RSS feeds. Once you completeyour edits, save your changes and return to the Home page. You will find the news relatedto your selected topics displayed in the RSS portlet on your Home page.

Using the Sign-In and Site-Navigation Portlets

Finally, you will add two more applications to your Home page: Sign In and Site Map. The SignIn portlet, listed under the Tools category, allows the user to log in to the portal and displaysthe user information after she logs in. The Site Map application, listed under the CMS category,displays the map of the entire portal site and allows the user to navigate to any page easily.Add both applications to your Home page. The use of these applications is self-explanatory.As an alternative to the Site Map portlet, you can use the Breadcrumb portlet or the Navigationportlet under the CMS category to display site-location information on your page. TheNavigation portlet allows you to set the display and bullet styles for the displayed map path,whereas the Breadcrumb portlet allows you to set only the display style. These two portlets arealso context-sensitive. For instance, the Navigation portlet shows only navigation options tochild pages of the page where it is being shown. The Breadcrumb portlet allows you to view acontext-sensitive list of your navigation history.Now that you have added a few applications to the Home page, you’ll rearrange their positionson the page to get the look you want and improve usability as a result.

 

Changing Page Layouts

Liferay provides several templates you can use to customize your page layouts. To apply anew template to your page, select the Layout Template menu option under the Welcome dropdownmenu. You’ll see a dialog box displaying several layout options (see Figure 2-29).
 

Figure 2-29. Layout-selection dialog

Layout-selection dialogHere, you will find several layouts containing different combinations of columns androws. If you apply the Freeform template to your page, for example, you will be able to setthe absolute position for each application on the page. But for the time being, select the 1-2Columns (30/70) layout template for the Home page. Saving your selection returns you to theHome page with the new template applied to it. Now, you will need to rearrange your applicationsbased on this template .To move an application to a new location on the page, move the cursor to the application’stitle bar. Notice the pointer changes into a hand-like icon. Click and drag the applicationto the desired location. As you drag the application on the screen, Liferay displays the layoutscreen in the background. This makes it easy for you to identify and set the new position foryour application. The application width automatically adjusts to the new width of your layoutrow or column.Move all the applications to rearrange the page in a way that is most convenient for youruse. A typical layout result is shown in Figure 2-30.

 

Figure 2-30. Completed Home page

.If you are not satisfied with Liferay’s official layouts, you can always download third-partylayouts from the community-downloads section of the Liferay site. The procedure for downloadingand installing the additional layouts is similar to the process for downloading andinstalling themes, as described earlier. When you download and install a layout, it gets addedto the layout-selection dialog automatically. Simply select the new layout of your choice toapply it to your page.

Thursday, 06 August 2009 13:19

Installing Liferay

Installing Liferay on your machine is easy. The Liferay portal comes bundled with manypopular web and application servers that are free for distribution. Liferay also supports manycommercial servers, which you would have to obtain separately. If you are using any of thecommercial servers, you will need to install and configure Liferay for these servers by followingthe instructions in the Liferay installation guide. 

Some of the popular free servers bundled with Liferay are:

• Geronimo
• GlassFish
• JBoss
• Jetty
• JOnAS
• Pramati
• Resin
• Tomcat

It is easy to set up a bundled installation. Liferay recommends the use of Tomcat as abundled option because it’s lightweight and popular among developers. We’ll use Tomcat forthe examples in this book.

Downloading Liferay

You can download the Liferay installation from the official Liferay site (http://www.liferay.com/web/guest/downloads). On this page, you will find several bundles for download. Under“Liferay Portal Standard Edition,” download Liferay Portal Bundled with Tomcat 6.0 (at presstime, the current Liferay version was 5.1.2 and the current Tomcat version was 6.0).After you select the Tomcat 6.0 option, the browser redirects to Sourceforge.net andbegins the download automatically. The name of your downloaded file is liferay-portaltomcat-6.0-5.1.2.zip.

Setting Up J2SE

Before you set up Liferay, you need to download and install Java on your machine. If you haveJava 2 Platform, Standard Edition (J2SE) 1.5 or above already installed, you can skip this step.You can download the latest J2SE version from http://java.sun.com/javase/downloads/index.jsp (Java SE 6 Update 10 RC, at press time). The name of the downloaded file isjre-6u10-rc2-bin-b31-windows-i586-p-05_sep_2008.exe.To set up Java on your machine, simply double-click the installer. The setup wizardguides you through the entire installation procedure. After the installation completes successfully,you will need to set the following environment variables.Create a new system variable called JAVA_HOME and set its value to your installation folder.For example, if you selected C:\Java\jdk1.6.0_02 as the installation folder, use this completepath as the value for the JAVA_HOME environment variable. You will then need to modify the systemPATH variable. Add the value %JAVA_HOME%\bin to the beginning of the path.

Setting Up Liferay

Setting up Liferay on your machine is easy: simply extract the contents of the downloadedfile to any folder on your machine. For the purposes of this book, I’ll assume that the files areextracted to the root folder of the C partition. When you extract the files to C:\, you will noticethat the installation creates a folder called liferay-portal-tomcat-6.0-5.1.2 in C:\. That’s allyou need to do to set up Liferay.

If you examine the contents of the installation folder, you will find several subfolders. Thebin subfolder contains the binaries for starting and stopping the server, whereas the webappssubfolder contains the installed web applications. The lib subfolder holds the various runtime libraries. You will be examining the contents of these folders when you deploy your custommadethemes and portlets for your portal. Even the third-party themes and portlets providedby Liferay user communities are deployed to these folders. You will need to navigate to the binfolder to start and stop the Tomcat server. When you start the Tomcat server, Liferay automaticallystarts and is ready to use.

Testing the Liferay Installation

To start Liferay, navigate to the c:\ liferay-portal-tomcat-6.0-5.1.2\bin folder and doubleclickthe startup batch file. This opens a console window and starts Tomcat server. The serverstartup messages are displayed in the console window. When the server completes its startup,you are ready to use Liferay.Open the browser and type the following URL:

http://localhost:8080.

You will see the page shown in Figure 1-17 displayed in your browser.

Figure 1-17. Liferay startup page

You can now log in to the portal using the following information:

Login: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Password: test

Accept the Terms of Use on the next page. Upon logging in successfully, you will see the
page shown in Figure 1-18.

 Figure 1-18. Liferay portal page upon successful login

Note the welcome message shown in the top-right corner. The default user for this portalis Joe Bloggs, whose name also appears in the Sign In portlet. The Hello World portlet showsanother welcome message along with the current build version of the Liferay portal. At thisstage, you have set up Liferay on your machine and are ready to explore further and createyour own portals.To shut down Liferay, you will have to shut down the Tomcat server. You can do so byrunning the shutdown batch file provided in the bin folder of the Liferay installation.

 

Thursday, 06 August 2009 12:38

Liferay Features

Liferay offers several benefits over similar frameworks in the market:

• Ease of use
• Support for a wide variety of applications
• Liberal licensing and open source code
• Extensibility
• Scalability
• Internationalization support
• Integration with other tools
• Adherence to industry standards

Ease of Use

Like the Yahoo! portal, portals created using Liferay are easy to use. You can add variousapplications to portal pages by using Liferay’s drag-and-drop feature, and you can move themaround by clicking and dragging. You can remove an existing application from the page with asingle click on the close icon, and you can easily change the page layout by applying a differentpage template. You can also change the look and feel of a page by applying a theme providedby Liferay or third parties. So you can create a portal easily and allow the user to configure it asdesired. You can take advantage of all these features without writing a single line of code.

Support for a Wide Variety of Applications

Liferay provides a wide range of applications or portlets that you can use, including wikis,blogs, chat, and discussion forums, to name a few. In addition to these, you can incorporateapplications made available by user communities. You will be using several of these applicationsas you work through the examples in this book.

Liberal Licensing and Open Source Code

The use of Liferay on your servers is entirely free. The company has a liberal licensing policy:you don’t need a license to use the product, even for commercial purposes.

Plus, Liferay has made the portal’s entire source code available to the developer community.The ability to modify the source has the following implications:

• You can add features to your portals by modifying the code.
• Contributors can improve Liferay itself
• Developers can add features to Liferay by creating plugins.

Extensibility:

Liferay is easily extensible. You can add new features to it without making any changes to thesource code. This makes it easy to migrate to newer versions of Liferay upon their release.

Scalability

Liferay is highly scalable. It can handle a large user base.

Internationalization Support

Liferay provides excellent support for internationalization. If your portal boasts many usersfrom non-English-speaking countries, you can extend it to use other languages. You do not need to do any coding to accomplish this; you simply use the appropriate resource bundles.You can easily support languages such as German, Spanish, French, Italian, Japanese, andmany more.

Integration with Other Tools

Liferay integrates easily with many third-party tools. For example, Liferay has its own contentmanagement system (CMS), but it also supports the more powerful Alfresco (http://www.alfresco.com). Liferay can also integrate with third-party Lightweight Directory Access Protocol(LDAP) servers. You’ll find this integration useful when your existing data is storedin LDAP. In addition, Liferay supports several popular databases such as Oracle, IBM DB2,Apache Derby, MySQL, Informix, SQL Server, Sybase, and others.

Adherence to Industry Standards

Liferay is based on standard technologies, so it easily integrates with other standards-basedtechnologies. For example, it easily integrates with the following:

• Apache ServiceMix: A popular open source ESB (Enterprise Service Bus
• Mule: A lightweight messaging framework and highly distributable object broke
• Ehcache: A distributed cache for general-purpose cachin
• Hibernate: A relational persistence service for Java and .NET
• ICEfaces: An open source Asynchronous JavaScript Technology and XML (Ajax)framework
• jBPM: A platform for executable process languages ranging from business processmanagement (BPM) over workflow to service orchestration
• Intalio/BPP: Open source BPM and SOA (service-oriented architecture) software
• JGroups: A toolkit for reliable multicast communication
• jQuery: A JavaScript library that simplifies HTML document traversing, event handling,animating, and Ajax interactions for rapid web development
• Apache Lucene: A full-featured text search engine library written entirely in Java• PHP: A general-purpose scripting language especially suited for web development; youcan embed it into HTML
• Ruby: A dynamic, open source programming language
• JBoss Seam: An application framework for building next-generation Web 2.0 applicationsby unifying and integrating technologies such as Ajax, JSF (JavaServer Faces),EJB3 (Enterprise JavaBeans), Java portlets, and BPM
• Spring and aspect-oriented programming (AOP): A leading Java/J2EE applicationframework
• Apache Tapestry: An open source framework for creating dynamic, scalable web applicationsin Java
• FreeMarker: A generic tool to generate text output based on templates

In addition to its integration with the preceding technologies, Liferay itself is writtenentirely in Java, a standard programming language. So you can easily modify, extend, andmaintain Liferay.

Page Internal Structure

The internals of a typical portal page are illustrated in Figure 1-14.As Figure 1-14 shows, a portal page runs a portlet container that embeds several portlets.Each portlet has its own decoration and controls. Using these controls, you can customize thecorresponding portlet. For example, you can easily change a portlet’s look and feel by settingits border and background colors, width, text style, window title, margins, and so on. You willexplore several of these features as you read the book and develop your own portals.With the configuration control, you can set permissions on each individual portlet so thatonly designated users are authorized to use it. You can import or export data, and you caneven share the entire portlet by giving its code to other users.You can customize the location of each portlet on the displayed page by applying a templateto change the layout. You can also create your own custom layouts and apply them toyour pages. You can add and remove portlets to and from a web page at any time.Portlets can communicate with other portlets on the same page, irrespective of the technologiesthey’re using. The portlet container is responsible for providing all the features I just described.

Figure 1-14. Internal structure of a portal page

Page Creation Process

When you display a portal page in your browser, certain activities take place in the portalserver and container. These are illustrated in Figure 1-15.

 Figure 1-15. How a portal page gets generated

Assume that the portal page is to be rendered as six portlets embedded on the page (seeFigure 1-15). Here’s the process that occurs during page generation:1. Each portlet—A, B, C, D, E, and F—generates the contents for the user. The contentsmight be static or generated dynamically, depending on the logic of the portlet application.Note that each portlet is basically a Java application that runs some code whenactivated.2. The container receives the contents generated by several portlets.3. The container hands over the contents to the portal server.4. The portal server creates the portal page, which is essentially a sequence of HTML codethat the browser can use. During page creation, the portal server applies the designatedpage layouts to place each portlet at the appropriate location.5. The server sends the created page to the client device (the browser).6. The browser displays the contents to the user.At this stage, the portal is ready for further interactions with the user. The user looks at thepresented contents and can decide to fetch further information by clicking one of the items onthe displayed page. Let’s examine what actions take place in the portal server and portlet containerwhen a user requests additional data.

Request Handling

Examining the sequence (object interaction) diagram of a typical user action is the best way tounderstand the actions that take place in the portal server, portlet container, and portlets inresponse to a user request.

Suppose the portal page contains three portlets: A, B, and C. The user initiates an actionon the portal page that requires the contents of portlets A, B, and C to be modified. The eventsthat take place during this interaction are illustrated in the sequence diagram presented inFigure 1-16.

Figure 1-16. Sequence diagram for user request

Here are the events in the order they take place:

1. The user requests a data update by clicking the portal page.

2. The user request generates an action event on the portal server.

3. The portal server generates an event on the portlet container.

4. The container determines that the user request requires data in portlets A and C to beupdated.

5. The container makes an Action request to portlet A to perform the data update.

6. Portlet A performs the requested action and returns the result, if any, to the container.

7. The container makes an Action request to portlet C

8. Portlet C performs the action and sends the result, if any, to the container.

9. At this stage, the Action phase of the user request is completed. The container has allthe data that it needs to render the page for the user.

10. The rendering phase of the user request starts.

11. The container fires a Render event to all three portlets—either sequentially or inparallel.

12. The container gathers the responses of all three portlets.

13. The container returns the updated page to the server.

14. The server displays the page on the user’s browser.

15. At this stage, the user request is fully processed.

16. The server now awaits another interaction from the user.

You’ve now studied Liferay’s internal architecture.

Thursday, 06 August 2009 10:03

Portals and Creating Portals with Liferay

What Is a Portal?

You have already encountered a web portal if you’ve used Yahoo!—one of the world’s bestknown and most-used portals. Yahoo! Sports, Yahoo! Finance, Yahoo! Movies, and Yahoo! Music each aggregate the contents provided by their partners. This is exactly what a portal does: it provides a single point of entry to widely distributed information on the web, and itoffers a unified way to access that diverse information.Some portals allow users to decide what they want to display on their portal pages. Inmany of these cases, the portal designer will customize the user’s page contents and generate them dynamically. Regardless of whether the customization is done by the portal designer orthe user, portals provide an easy way to configure desired content on a personal web page.Plus, portals provide a consistent look and feel. Users can take advantage of diverse applicationsin the same manner, making it easy for them to access information from various sources.Now let’s look at the formal definition of a “portal.” If you search for “portal definition”on Google, you’ll pull up several definitions that all convey the same meaning. Wikipedia(http://en.wikipedia.org/wiki/Web_portal), the popular free encyclopedia, provides thefollowing definition:


A web portal is a site that provides a single function via a web page or site. Web portalsoften function as a point of access to information on the World Wide Web. Portals presentinformation from diverse sources in a unified way. Apart from the search enginestandard, web portals offer other services such as e‑mail, news, stock prices, infotainment,and other features. Portals provide a way for enterprises to provide a consistentlook and feel with access control and procedures for multiple applications, which otherwisewould have been different entities altogether.

 Here’s another definition from Sun Microsystems, which defines “portal” in its JavaPortlet Specifications (JSR 286) as follows:A portal is a web-based application that commonly provides personalization, authentication,[and] content aggregation from different sources and hosts the presentationlayer of information systems.

 This definition states that a portal is a kind of web application that aggregates contentfrom different sources—web sites or web applications. The content generated by these websites can be static or dynamic. For example, a sports-related portal might generate a web pagethat aggregates and presents information from several sports web sites. If a user decides togather further information from one of the displayed web sites, she can simply visit that website by navigating to it from the portal page. After doing that, she can return to the portal pagewith ease and continue navigating to the other web sites if desired.

 

Some of the displayed web sites might require the user to sign on, in which case a portalcan offer the capability of single sign-on. Single sign-on means that once the portal authenticatesthe user, it applies the same credentials to all the applications displayed on the portalpage so that the user can access them. In some cases, a portal simply communicates to anaggregated application that the user is authenticated, and the application trusts that.As stated in the Sun Microsystems definition, a portal provides personalization,whereby the user can decide what applications should be initially displayed on the personalportal page. The user can configure this page any time by adding and removing differentapplications.Different web sites offer several other definitions, all of which describe portals as usercustomizableweb sites that serve as gateways to diversified content arising from varioussources. However, these definitions neglect to describe an important feature of today’s portals:

Generally, these new types of portals give users tools and applications to create sites forsocial networking and collaboration. I’ll describe one such portal, uPortal, later in this chapter.The Liferay portal that we’ll explore also falls into this new category of portals.Now that I’ve defined what a web portal is, I’ll discuss two real-life examples: Yahoo! andGoogle.

Example Portal: Yahoo!

To understand what a portal is and how to customize its contents, look at what Yahoo! providesto a user. When you open the Yahoo! web site, you see a screen similar to the one shownin Figure 1-1, assuming that you are in the United States (http://us.yahoo.com).

 Figure 1-1. Yahoo! home page

On the right-hand side, you will see the Page Options drop-down menu. One of theoptions in the drop-down list is Try My Yahoo!, which allows you to customize your Yahoo!page (see Figure 1-2).

Figure 1-2. My Yahoo! portal page

Aggregating Contents

At the top of the page, you will find a toolbar that allows you to add content to the page andchange its appearance. When you click the Add Content menu option, you will see a list ofoptions as shown in Figure 1-3.

 Figure 1-3. Content-selection menu option

Click the desired item in the displayed list to add it to your page. Before adding an item,you can preview it by hovering the mouse over it and clicking the Show Preview link that’s displayed.You can add multiple items to the page.Once you’ve added an item, you can relocate it on the page simply by selecting it anddragging it to the desired position. You can remove any of the added or existing items from thepage by clicking the “x” symbol shown in the top-right corner of each. After deleting the undesireditems, you can relocate the remaining items to your liking.Once you’ve finished adding items to your page, click the I’m Done button to return tofull-page view. You’ve just configured the entry-point page that provides easy, uniform accessto several distributed applications on the web.Now, you’ll change the page’s appearance—its look and feel.

Changing Look and Feel

Clicking the Change Appearance menu option opens the screen shown in Figure 1-4.

 Figure 1-4. Changing the look and feel of a page

Here, you will find options for changing the color, layout, font size, and search-boxsize. Select the color of your choice from the displayed colors. You can also select textures,environments, and so on from the displayed menu choices. To change the layout, click theChange Layout option and select the size and number of columns from the choices offered.After selecting a different column layout, you might want to rearrange the display items toyour liking. Likewise, you can configure font size and search-box size by clicking the respectivemenu choices.Try out the other configuration options. If you want your changes to persist, you shouldsign on before making them.You’ve used a portal that lets the user aggregate desired home-page content and you’veset the page’s look and feel. Now consider Google, another popular portal in the market.

 

Kinds of Portals

Wikipedia classifies portals into several different types:

• Personal portals

• Academic portals

• Regional web portals

• Government web portals

• Corporate web portals

• Domain-specific portals

• Sports portals

These classifications are essentially based on the use of each portal type.

 

Personal Portals:

A personal portal is a portal that an individual can customize to meet his or her requirementsand suit his or her tastes. Examples of these include My Yahoo! and iGoogle, whichyou saw earlier in this chapter. These portals are easily customizable, and the customizationinformation is stored in the individual’s user account. A user needs to log on to the accountto regenerate the personalized page. A personal portal generally aggregates the contents providedby several distributed applications hosted by various worldwide sources, but it doesn’tnecessarily meet business-driven requirements such as support for various kinds of inputdevices like PDAs, cell phones, and so on.These kinds of portals are best if you are not satisfied with the preconfigured portals onthe web and you’d like to create customized pages with the look and feel of your choice.Academic PortalsAn academic portal addresses the needs of academicians. An example of a typical academicportal is uPortal (http://www.uportal.org/), a sharable portal under development. UnlikeYahoo! and Google, uPortal is portal software. Whereas Yahoo! and Google provide customizableportal sites, uPortal provides a platform for collaboration. Several institutions of highereducation have joined together to create uPortal, which is freely downloadable and based onstandard technologies such as Java, XML, JSP, and J2EE. It supports collaboration with thehelp of several community tools such as chat, forums, surveys, and so on. It basically provides“an abridged and customized version” of the campus web presence.Another example of an academic portal is the Austrian Academic Portal (http://www.portal.ac.at/index-en.html). This portal—a straightforward portal site like Yahoo! andGoogle—is a gateway to Austrian institutions that teach science and humanities, research,education, and culture. Anybody wishing to pursue studies in Austria in the specified fieldswould find this portal useful.You’ll find several such academic portals for each country. For example, if you wish toget information on education in Switzerland, you can visit the education portal SWITCH (http://www.switch.ch/).

Regional Web Portals

A regional web portal provides information pertinent to a specific geographic location. Suchinformation might consist of weather forecasts, street maps, local news, and shopping. Onesuch popular regional web portal in India is Rediff (http://www.rediff.com). It providesregional information related to travel, local news, stocks, matrimony, Bollywood, and so on.A similar regional portal for China is SINA (http://www.sina.com), which is availablein both Chinese and English. It offers information about business, sports, lifestyle, andentertainment. Other countries and regions within countries offer portals, such as Greece(http://www.in.gr) and the South East of England (http://www.southeastofengland.com/).The former targets only users who read Greek.Government Web PortalsMany governments worldwide provide portals for their citizens. One such portal is TheNational Portal of India (http://india.gov.in), which provides useful government-relatedinformation to its residents, information for entrepreneurs who are setting up businesses inIndia, and tourist information for visitors and students.A portal hosting government-related information for the United States is USA.gov(http://www.usa.gov). This portal provides information for citizens, businesses and not-forprofitorganizations, government employees, and visitors. Because the United States is a largecountry, many of its states have set up their own regional portals, such as Clark County Now,A Regional Portal for East Central Illinois (http://www.clarkcountynow.com) and the State ofIllinois Business Portal (http://www.business.illinois.gov).Corporate Web PortalsCorporate web portals, also known as intranet portals, have become a widely accepted standardamong corporations. These corporate intranets provide a consolidated view of thecompany’s information to its employees and often allow employees to personalize and customizethe site’s content display.Today’s corporate portals also allow the creation and publication of workflows thatfacilitate better collaboration among the company’s divisions. They permit the creationof wikis that allow the users to share knowledge, thereby increasing the company’s overallproductivity. Generally, these portals provide single sign-on to its employees; once a user isauthenticated at the entry point, he can navigate the organization’s departments using theprivileges assigned to the specific login role.Such corporate web portals might expose part of their contents to external users throughthe Internet. In such cases, these portals are called extranet portals.Corporate web portals for big companies are likely hosted on the company’s internalservers; portals for smaller organizations might be hosted on external servers supplied by serviceproviders.

Domain-Specific Portals

Portals geared toward a particular industry are called domain-specific portals. For example,a portal for real-estate agents brings a region’s agents to a single site and allows consumers to buy and sell their properties. A single real-estate agent could even create a portal for facilitatingthe buying and selling of real estate.Examples of real-estate portals in the U.S.A. include HomesWEB (http://www.homesweb.com/) and RealEstateBig (http://www.realestatebig.com/), and the U.K.offers SeLoger (http://www.seloger.co.uk). Examples of such portals in India includeMagicBricks (http://www.magicbricks.com/), Makaan (http://www.makaan.com/), andPropertymart (http://www.propertymart.co.in/).

Sports PortalsSeveral portals cater to the needs of sports lovers. A typical example of a sports portal is ESPN STARSports (http://www.espnstar.com), which covers tennis, hockey, international cricket, and motorsports.Other popular sports portals, to name a few, are Sky Sports (http://www.skysports.com/),Sportal (http://sportal.nic.in/), and Sify Sports (http://sify.com/sports/). The last two specificallycater to sports in India. All these portals cover various aspects of different sports, such as livescores, live matches, replays, game analysis, and so on.Now that you’ve seen the classifications of web portals depending on their use and application,consider some of the advantages offered by portals over conventional web sites.

Portal Advantages

I’ve mostly discussed portals in terms of content aggregation and page-layout customization.But I also hinted at extended functionality that portals can offer: collaboration amonguser communities. In fact, a portal designer can create different user communities on a singleportal and ask users to register for each of them. The designer can present different content, adifferent look and feel, and different collaboration features that depend on the community towhich the user belongs. You might find these kinds of collaboration features in a portal:

• Group discussions: You can host group discussions on your portal, whereby the userscan discuss a topic in a message board that you establish. This kind of collaborationoffers several advantages over conventional group e‑mail discussions. Users can join orleave the discussion at any time without affecting others who have currently logged in,and they can archive discussion threads for later viewing.

• Blogs: A portal can allow the user to publish opinions in a blog, just as users cando on Blogger (http://www.blogger.com) or Windows Live Spaces (http://home.spaces.live.com/). The blogs can be made public for others to view, so general userscan read the views of senior-level users who offer insight into industry and markettrends, for example.

• Document sharing: A portal can allow sharing of existing documents and other mediasuch as photographs. This feature would require proper document management.

• Wikis: Your portal can host wikis, which enable users to create web pages, edit them,and link them together. Wikis function like a shared notebook whereby users can sharetheir ideas collaboratively.

• Shared calendars: A portal can also host shared calendars, which can prove useful inmanaging both company-hosted and user-hosted events. This feature lets users schedulemeetings and send invitations.

As you can see, a portal can provide several features to facilitate collaboration among itsusers, thus providing a richer user experience than conventional web sites can offer.

Creating a Portal with Liferay

Now that you’ve seen what a web portal is and what benefits it offers over conventional websites, I’ll show you how to create one. A portal, as I mentioned earlier, consists of a wide varietyof applications that might or might not relate to one another: blogs, document managementapps, wikis, calendars, and so on. Obviously, no single vendor can provide all the necessarytools to integrate those features into your web portals. You will thus need to incorporate toolsfrom different vendors. These tools might use diverse technologies, which could pose an integrationchallenge because the portal’s applications need to work together.Many vendors provide tools for creating portals and servers to host the portals. Some ofthe popular tools and servers are Oracle WebLogic Portal, IBM WebSphere Portal Server, SunJava System Portal Server (also known as GlassFish Web Space Server), and Microsoft OfficeSharePoint Server. Among open source technologies, Liferay is a popular portal server.Liferay Portal essentially provides a framework for creating any of the types of portalsthat I’ve discussed. Think of it like a web application that’s hosted on a web server of yourchoice. It supports many servers in the market because it complies strictly with standards.Liferay provides a complete development environment you can use to create a portal. Itprovides a runtime environment for hosting Java-based portal applications, also known asportlets. It offers a container where you assemble the portlets, configure them, and set theirlook and feel.A typical portal page running in a Liferay portal is shown in Figure 1-13.The Liferay web site shown in Figure 1-13 is itself based on the Liferay Portal product.As you can see, it resembles other web portals you’ve seen. Perhaps the next web portal youencounter will be running on Liferay.

 

Figure 1-13. A sample Liferay portal page

Page 12 of 12