Ask a question
Thursday, 06 August 2009 16:19

Incorporating Blogs in liferay portals

Rate this item
(3 votes)

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

 

Last modified on Saturday, 15 August 2009 15:13
Vicky

Vicky

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