简体   繁体   English

如何将Portlet部署到Liferay?

[英]How to deploy portlets to Liferay?

I have faced problems in trying to install new portlets to Liferay running on Glassfish domain. 在尝试将新的portlet安装到在Glassfish域上运行的Liferay时遇到了问题。 I figured out the flow very lately and want to share it with others also. 我最近很清楚流程,也想与他人分享。 So, please read the answer and hope this helps someone :) 因此,请阅读答案,希望对您有所帮助:)

(Pre requisites for the problem is that I knew that adding projects running on Glassfish is done with a autodeploy folder, but making them visible on Liferay was another story.) (此问题的先决条件是,我知道添加在Glassfish上运行的项目是使用autodeploy文件夹完成的,但是使它们在Liferay上可见是另一回事了。)

So, you make first a .war file let's say a portlet of name your_file.war. 因此,您首先创建一个.war文件,让我们说一个名为your_file.war的portlet。 You wanna have it running on a glassfish domain under Liferay portal. 您想让它在Liferay门户下的glassfish域上运行。

Steps to success: 成功步骤:

1) Navigate to Control Panel -> Plugins Installation on Liferay 1)导航到Control Panel -> Plugins Installation on Liferay
2) hit Install new portlets 2)点击Install new portlets
3) hit Configuration 3)点击Configuration
4) Fill in to Deploy Directory a new place for deployment let's say [your domain]/autodeploy2 4)填写要Deploy Directory的新位置,例如[您的域] / autodeploy2
5) Check that in the next line target is [your domain]/autodeploy (it is the Glassfish default deployment directory) 5)检查下一行目标是否为[您的域] / autodeploy (这是Glassfish的默认部署目录)
6) hit save 6)点击save

Now deployment will be done by copy pasting files to that new directory [your domain]/autodeploy2 . 现在将通过将粘贴文件复制到该新目录[您的域] / 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. 1)通过删除war文件从(您的域)/ autodeploy文件夹中取消部署旧内容。 Don't delete any other file. 不要删除任何其他文件。

2) result is that your_file.war_UnDeployed file will appear. 2)结果是your_file.war_UnDeployed文件将出现。

3) deploy new file by copying the newly built war in (your domain)/autodeploy2 folder. 3)通过在(您的域)/ autodeploy2文件夹中复制新建的war来部署新文件。

4) result is that your_file.war_deployed will appear in (your domain)/autodeploy folder. 4)结果是your_file.war_deployed将出现在(您的域)/ autodeploy文件夹中。

Make a dance again :) 再次跳舞:)

There is several methods to deploy plugins (portlets, hooks, filters...) into your Liferay Portal. 有几种方法可以将插件(portlet,hook,过滤器...)部署到Liferay Portal中。

If you're using Administration you can do it as Mico descripted. 如果您正在使用管理,则可以按照Mico所述进行操作。 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...). 但是,如果您使用的是Maven,Gradle,Ant,Ivi ...,则可以配置其部署描述符,并将其输出(即战争)重定向到hotdeploy服务器文件夹(如果使用的是Tomcat,JBoss和Glassfish。 )。

This approach is quite better because you can create backup webapp folder and restore it whenever you want easily. 这种方法比较好,因为您可以创建备份webapp文件夹并随时轻松恢复它。

Below are not for Glassfish but common startup steps: 以下不是Glassfish的步骤,而是常见的启动步骤:

To install a portlet in lliferay portal 在lliferay门户中安装Portlet

• first install liferay portal from below link http://www.liferay.com/en_GB/community/wiki//wiki/Main/Liferay+IDE+Getting+Started+Tutorial •首先从下面的链接http://www.liferay.com/zh_CN/community/wiki//wiki/Main/Liferay+IDE+Getting+Started+Tutorial安装liferay门户

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 •创建Portlet应用程序

• open liferay at localhost:8080 and goto Admin -> control panel •在localhost:8080打开liferay,然后转到Admin->控制面板

• goto Plugins Configuration •goto 插件配置

• goto Intall tab and give location of war file (some logging error might come at tomcat console, ignore it) •转到Intall选项卡并提供war文件的位置(tomcat控制台可能会出现一些记录错误,请忽略它)

• again goto home page at localhost:8080 and click + button •再次转到位于localhost:8080的主页,然后单击+按钮

• go at the bottom in the list and u will find ur portlet •在列表底部,您将找到您的portlet

• click add button present at the right side of it and ur portlet would be added to the page. •单击右侧的添加按钮,您的portlet将被添加到页面中。

Modifying code of portel requires to uninstall and install again the portlet from war file. 修改portel的代码需要从war文件中卸载并重新安装portlet。 All existing added portlets would also be modified. 所有现有添加的Portlet也将被修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM