Setting up the Guestbook Portlet

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

  1. Install JDK 8
  2. Install and Configure a Local Liferay DXP bundle
  3. Deploy the Guestbook Portlet to the Local Liferay DXP 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 DXP Bundle

First, download a Liferay DXP Tomcat bundle from liferay.com. Then click here and follow the instructions to install the bundle. To follow Liferay DXP 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 DXP release. For example, if you downloaded Liferay Portal 7.0 CE GA4 and unzipped it to a bundles folder on your machine, that bundle’s Liferay Home folder path is:

bundles/liferay-ce-portal-7.0-ga4

Now you’re ready to start Liferay DXP! 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 DXP 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 DXP 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 DXP 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. Then accept the terms of use and set a password and a password reminder query for your administrative user. Your Liferay DXP instance then takes you to its default site.

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

Deploying the Guestbook Portlet

Now that your Liferay DXP instance is set up, you can deploy the Guestbook portlet to it. First, click here to download the Guestbook portlet’s modules:

  • com.liferay.docs.guestbook.api-1.0.0.jar
  • com.liferay.docs.guestbook.portlet-1.0.0.jar
  • com.liferay.docs.guestbook.service-1.0.0.jar
  • com.liferay.docs.guestbook.service-wsdd-1.0.0.jar

Place these modules in your Liferay DXP instance’s [Liferay Home]/deploy folder. You should then see console messages indicating that the modules have successfully deployed and started. On your Liferay DXP instance’s default site, click the Add button (Add) on the upper-right corner of the screen. Then click the ApplicationsSample category and drag Guestbook onto the page. The Guestbook portlet should now appear with the default guestbook (Main). In the portlet, add a new guestbook and an entry or two each from the Add menu (Add) that appears in the top right of the portlet’s border when you mouse over the portlet. 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 DXP instance and added the Guestbook portlet to it. Now you’re ready to get started with the Liferay Mobile SDK.

« Beginning Android Development for Your Liferay DXP InstanceBuilding the Guestbook Mobile SDK »
Este artigo foi útil?
Utilizadores que acharam útil: 0 de 1