Liferay 7 plugin SDK tutorial

In this tutorial, we will see  “How to configure Liferay 7 plugin sdk and create sample MVC portlet”.   Liferay 7 adopted OSGI framework and follows modules which are  OSGI bundles. Liferay 7  extends support plugin SDK development, that you most of you know the plugin sdk is extensively used liferay lower versions.

What is Plugin SDK? 

Plugin SDK is used to develop plugins portlets, theme, hooks, layouts,ext and web.  All developed source code will reside in Plugin SDK.

What is Liferay workspace?

Liferay workspace is used in Liferay 7 to hold modules and themes only. Liferay 7 doesn’t support creating theme. Liferay used NodeJS theme generator to create, build and deploy the themes. but still you can used Liferay 7  Plugin SDK to develop themes,

Installations used in tutorial:
  • Liferay7 IDE  
  • Liferay 7  Tomcat Community Edition
  • Liferay 7 Plugins SDK

Liferay 7 Plugin SDK setup:

  • Download liferay7 plugins sdk and extract into local file system
  • Create build.{username}.properties file
  • set app.server.parent.dir to Liferay 7 Home directory
    • app.server.parent.dir = D:\\programming\\Lifera7Ce\\liferay-ce-portal-7.0-ga3
      app.server.type = tomcat
      
      
  • In this step, we will Import Liferay7 plugin SDK into eclipse. Click on File->Import->Liferay->Select Liferay Plugin SDK Directory and click on Next.
  • Liferay 7 Plugin SDK installation
    Liferay 7 Plugin SDK installation
  • Provide the SDK Directory path in “SDK Directory” field. you must need to create build.{username}.properties with app.server.parent.dir to Liferay 7 Home directory. Click on Finish

    Liferay 7 Plugin SDK tutorial
    Liferay 7 SDK selection
  • Now you can see Liferay Plugin SDK directory as folder

    Liferay 7 Project Directory
    Liferay 7 Project Directory
  • We can develop Liferay modules and portlet plugins parallaly
  • All OSGI module projects will go in liferay-ce-workspace folder
  • All Plugin Projects will go in com.liferay.portal.plugins.sdk directory.
  • Now, we are done with liferay plugin SDK setup  and will create a sample portlet plugin project and will deploy in Liferay 7 server.

 

 

 

Liferay 7 Plugin SDK Portlet Creation

In this step, we can create the liferay 7 Plugin sample portlet.

  • Click on File->New->Project->Liferay Plugin Project
  • Select Liferay Plugin Project and this open New Liferay Plugin Project Wizard which same as liferay 6 versions. Give Project name as Leave system and click on Next
    Liferay7 Plugin SDK tutorial
    Liferay7 Plugin SDK tutorial

     

  • Select Liferay MVC Portlet framework and click on Next
  • In this step, probably you will get  ivy settings errors and will not allow to create plugin. Ivy takes lot of time to download all jar.
  •  Ant Process will stopped  at loading ivy-settings. Fix the  Liferay Plugin SDK ivy issue,.so Click here to see the post explained on this.
  • After changing ivy settings, Create portlet plugin again and below is the project structureliferay-7-portlet-project-struture
  • just edit view.jsp and add some content
  • Deploy the portlet as you do in Liferay lower versions and notice  in the logs that Liferay Plugin portlet is being deployed on Liferay 7 server
  • Now login to Liferay 7 portal and add the leave-system portlet (Click on Add ->Applications->Sample ->add Leave system) Liferay 7 Plugin SDK Portlet tutorial.
3 thoughts on “Liferay 7 plugin sdk tutorial”

Comments are closed.