Friday, July 31, 2015

Liferay : Deployable template and structure

Liferay uses template and structure for major built in portlets. It gives us freedom to design and mange the content of the site(Webcontent , DDL - Dynamic data list  , ADT - Application Display template , Page template, Site Template). These portlet are very useful when designing the quick sites. Hot deploy able feature make it cool.

Major problem what we are facing is on the side of migration. There are LAR import / export features are available by default. But when you need to be make automatically in all the environment. That's were the deploy able template and structures serves us good features.

Required dependencies :

1) Enable markeplace in your local liferay from the control panel
2) Go the liferay.com marketplace and purchase the resource-importer. (Its free)
Note : Choose EE / CE for your own environment
3) Deploy the lpkg of the resource-importer in local liferay

Create plugin project:

1) Creating portlet plugin project
2) Replace this below content in top of the liferay-plugin-package.properties file
-------------------------------------------------------------------------
name=
required-deployment-contexts=\
    resources-importer-web
resources-importer-developer-mode-enabled=true
module-incremental-version=1
-------------------------------------------------------------------------
Note : name should be empty, so that this portlet will not be listed in the available apps.

3) Remove display-name in the portlet.xml
4) Create a folder called template-importer in the project src folder. where you always create package and java class file.
5) Copy your templates in the respective folders. Refere the github project shared in the bottom of this post.
6) Deploy the portlet
7) Test your templates from the control pannel

Refer the template file this project repository location, or use this as sample project.
Source code:
liferay/sample-templates-importer-portlet

No comments:

Post a Comment

Merging two sorted arrays - Big O (n+m) time complexity

 Problem :  Merge the two sorted arrays. Edge case :  Array can empty Arrays can be in different size let getMaxLength = ( input1 , input...