How to deploy portlets to Liferay?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 08:27:28

So, you make first a .war file let's say a portlet of name your_file.war. You wanna have it running on a glassfish domain under Liferay portal.

Steps to success:

1) Navigate to Control Panel -> Plugins Installation on Liferay
2) hit Install new portlets
3) hit Configuration
4) Fill in to Deploy Directory a new place for deployment let's say [your domain]/autodeploy2
5) Check that in the next line target is [your domain]/autodeploy (it is the Glassfish default deployment directory)
6) hit save

Now deployment will be done by copy pasting files to that new directory [your domain]/autodeploy2. The rest of it is handled automatically. Setting takes action imediatedly.

Done with deployment: Make a victory jig and enjoy :)

..you stop dancing and face a bug. You want a new revision to be deployed.. In this case, continue reading.

So, you have built your war again and want to re-deploy. Do the following:

1) undeploy old stuff from (your domain)/autodeploy folder by deleting the war file. Don't delete any other file.

2) result is that your_file.war_UnDeployed file will appear.

3) deploy new file by copying the newly built war in (your domain)/autodeploy2 folder.

4) result is that your_file.war_deployed will appear in (your domain)/autodeploy folder.

Make a dance again :)

There is several methods to deploy plugins (portlets, hooks, filters...) into your Liferay Portal.

If you're using Administration you can do it as Mico descripted. but if you're using Maven, Gradle, Ant, Ivi... you can configure their deployment descriptors and redirect their outputs (that are the wars) to the hotdeploy server folder (If you're using Tomcat, JBoss, Glassfish...).

This approach is quite better because you can create backup webapp folder and restore it whenever you want easily.

Below are not for Glassfish but common startup steps:

To install a portlet in lliferay portal

• first install liferay portal from below link http://www.liferay.com/en_GB/community/wiki//wiki/Main/Liferay+IDE+Getting+Started+Tutorial

this requires installation of
    liferay ide
    liferay portal bundled with tomcat
    add this tomcat as run server time and start it, it will start liferay portal 

• create a portlet application

• open liferay at localhost:8080 and goto Admin -> control panel

• goto Plugins Configuration

• goto Intall tab and give location of war file (some logging error might come at tomcat console, ignore it)

• again goto home page at localhost:8080 and click + button

• go at the bottom in the list and u will find ur portlet

• click add button present at the right side of it and ur portlet would be added to the page.

Modifying code of portel requires to uninstall and install again the portlet from war file. All existing added portlets would also be modified.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!