Setting up the Guestbook Portlet

Before you begin developing the Guestbook app for Android, you must set up the Guestbook portlet in a Liferay Portal instance. To do this, follow these steps:

  1. Install JDK 8
  2. Install and Configure a Local Liferay Portal Bundle
  3. Deploy the Guestbook Portlet to the Local Liferay Portal Instance

Installing the JDK

To get started, you must have JDK 8 installed. You can download and install the Java SE JDK from the Java downloads page. This page also has links to the JDK installation instructions.

Installing and Configuring a Local Liferay Portal Bundle

First, download a Liferay Portal 6.2 Tomcat bundle from liferay.com. Then click here and follow the instructions to install the bundle. To follow best practices, you should create a bundles folder and unzip it there. The bundle’s root folder is referred to as Liferay Home and is named according to the version, edition, and specific Liferay Portal release. For example, if you downloaded Liferay Portal 6.2 CE GA6 and unzipped it to a bundles folder on your machine, that bundle’s Liferay Home folder path is:

bundles/liferay-portal-6.2-ce-ga6

Now you’re ready to start Liferay Portal! Start the bundle as described in the link above. If you’re on Mac or Linux you should also run tail -f ../logs/catalina.out immediately after the ./startup.sh command executes. This ensures that the server log prints to the terminal. This step isn’t necessary on Windows because the server log automatically opens in another window.

After a minute or two, Liferay Portal starts up and automatically takes you to its initial setup page at http://localhost:8080. On this page, you need to provide some basic information about how to set up your Liferay Portal instance. Enter a name for your instance, select the default language, and then uncheck the Add Sample Data box. Then enter the first name, last name, and email address of the default administrative user. For the purposes of this Learning Path, these don’t have to be real. If you want to connect Liferay Portal to a separate database such as MySQL or PostgreSQL, you can configure that connection here. Note that although the default embedded database is fine for development on your local machine, it isn’t optimized for production. Click Finish Configuration when you’re done. When the success message appears, click Go to My Portal. Then set a password and a password reminder query for your administrative user. Your Liferay Portal instance then takes you to its default site.

Great! Next, you’ll deploy the Guestbook portlet to your Liferay Portal instance.

Deploying the Guestbook Portlet

Now that your portal is set up, you can deploy the Guestbook portlet to it. Download the Guestbook portlet’s .war package from here and place it in the [Liferay Home]/deploy folder. You should see messages in your console indicating that the Guestbook portlet has been successfully deployed. On your portal’s default site, click the + icon on the left side of the screen and then click Applications at the top of the menu that slides out. Open the Sample category and drag Guestbook onto the page. The Guestbook portlet should now appear with the default Main guestbook. Add a new guestbook in the portlet and an entry or two to each. When you create the Guestbook Android app, this ensures there’s some content to display in it. The Guestbook portlet on your site should now look like this:

Figure 1: The Guestbook portlet, with a new guestbook and some entries.

Figure 1: The Guestbook portlet, with a new guestbook and some entries.

Stupendous! You’ve successfully set up a Liferay Portal installation and added the Guestbook portlet to it. Now you’re ready to get started with the Liferay Mobile SDK.

« Beginning Android Development for Your PortalBuilding the Guestbook Mobile SDK »
Was this article helpful?
0 out of 0 found this helpful