KNOWLEDGEBASE

We pride ourselves on bringing a fresh perspective and effective insight knowledge of each technology.

  • Creating Portlet In Liferay 7 DXP

    Creating Portlet In Liferay 7 DXP

    Creating Portlet In Liferay 7 DXP

    To Create Portlet in liferay 7 DXP we must have a liferay workspace if we are using gradle as a build tool. If you are using maven as a build you don't need to have a liferay workspace. If you are not familiar on creating liferay workspace please refer my previous post Liferay 7 DXP Setup In Eclipse


    Environment
    Liferay IDE Milestone 3.0.1 M2
    Liferay CE Portal Tomcat 7 GA3
    JDK 8
    MySql 5.7

    Step 1 : Create Module Project

    After creating a new liferay workspace right click on the liferay workspace created, in my case the workspace name is 'LiferayWorkspace' if you want to create a new portlet click on the 'New Liferay Module Project' option as shown in the below.


    Liferay 7 Create Module Project

    Step 2 : Select Project Template 

    After selecting the above option a new wizard window will be shown for giving the Portlet module details as shown below.

    Liferay 7 Module Project Template

    Give the Project Name, select build type as grade and project template as mvc-portlet then click next.

    Step 3 : Provide Component Class Name and Package Name

    Enter the portlet class name and package name then click on finish, a new portlet project will be created in the modules folder of the Liferay Workspace folder.

    Liferay 7 Component Class Name and Package


    Step 4 : Add Portlet Module To Server

    Add the portlet to server using the 'Add and Remove' option. you can build and deploy the portlet module using the Gradle Task Tab available in eclipse as shown below.

    Liferay 7 Add Module to server


    Step 5 : Deploy The Portlet Module Using 'Gradle Tasks

    You can build, deploy and clean the created modules using the 'Gradle Tasks' view in the eclipse as shown in the below image.

    Liferay 7 Deploy Module to server


  • Liferay 7 DXP Setup In Eclipse

    Liferay 7 DXP Setup In Eclipse

    Liferay 7 DXP Setup In Eclipse

    Setting up Liferay 7 is straight forward if we follow some of the basic steps as defined below. In this tutorials we'll see how we can setup Liferay 7 in our local machine for Liferay 7 DXP Installation.

    Environment
    Liferay IDE Milestone 3.0.1 M2
    Liferay CE Portal Tomcat 7 GA3
    JDK 8
    MySql 5.7

    Once you are done with downloading the above files, extract the tomcat and liferay ide to the desired place or extract them as shown below and create a workspace for eclipse let's say "eclipseWorkspace". [Not to be confused with workspace of liferay 7].
    Liferay 7 Eclipse Tomcat and Workspace Folder Structure

    Start your liferay eclipse ide, eclipse will prompt you to give your eclipse workspace folder, give the complete path of the "eclipseWorkspace" folder in prompt. then click ok. now the liferay eclipse IDE will start.

    Step 1: Setting up Tomcat in Liferay Eclipse IDE

    click on the "click this link to create new server" in the server tab as shown in the image below.


    Select the liferay tomcat version as "Liferay 7.x" then click next. Give the path of the extracted tomcat server as shown in the figure then click finish.

    Liferay 7 Configure server tab

    Step 2 : Configuring Database In Liferay 7

    Lets start our Tomcat server which we configured in the eclipse. it will take a while for the tomcat server to start. Visit localhost:8080 from your favorite browser.

    Liferay 7 DXP Database Configuration on Startup

    Here you can configure your database, site name administrator configuration, we need to specify the database name which already created, database URL and credentials.

    Liferay 7 DXP Database Configuration on Startup

    After providing the required information click on "Finish Configuration". It will ask you to restart the portal. Your Liferay Tomcat is ready with Eclipse!

    Step 3 : Creating Workspace In Liferay 7

    Select the 'New Liferay Workspace Project' option from the Liferay Wizard menu as shown below.

    Liferay 7 DXP Create new Workspace

    Provide the liferay workspace name, i am giving 'LiferayWorkspace' in my machine and click on finish.

    Liferay 7 DXP Create new Workspace

    That's all, a new liferay workspace will be created. Using This Workspace we can create different modules such as portlets, theme, layout, activators etc, I will be covering them in future blogs.