Before you begin developing the Guestbook app for iOS, you must set up the Guestbook portlet in a Liferay DXP instance. To do this, follow these steps:
- Install JDK 8
- Install and Configure a Local Liferay DXP Bundle
- 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
Follow these instructions to install and configure a local Liferay DXP instance:
-
Download a Liferay DXP Tomcat bundle from liferay.com.
-
Unzip the bundle to a new
bundles
folder. Note that 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 CE Portal 7.0 GA5 and unzipped it to abundles
folder on your machine, that bundle’s Liferay Home folder is:bundles/liferay-ce-portal-7.0-ga5
-
Now you’re ready to start Liferay DXP! Open a terminal and navigate to
[Liferay Home]/tomcat-[version]/bin
. Then run these commands:./startup.sh tail -f ../logs/catalina.out
The
tail
command ensures that the server log prints to the terminal. -
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, provide the following information to set up your Liferay DXP instance:
- Enter a name for your instance.
- Select the default language.
- Uncheck the Add Sample Data box.
- 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.
-
Accept the terms of use.
-
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 portal is set up, you can deploy the Guestbook portlet to it. Follow these instructions to do so:
-
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 () on the upper-right corner of the screen. Then click the Applications → Sample 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 () that appears in the top right of the portlet’s border when you mouse over the portlet. When you create the Guestbook iOS app, this ensures there’s some content to display in it. The Guestbook portlet on your site should now look like this:
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.