以编程方式登录liferay [英] liferay login programmatically

查看:73
本文介绍了以编程方式登录liferay的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为liferay创建一个自定义的登录portlet,因为我还需要做其他一些事情,例如日志记录.但是我偶然发现的问题是portal-impl.jar似乎被屏蔽了,所以我不能使用loginutil类. 现在,我不想修改实际登录的工作方式,因此实在太可惜了. 我已经读过一些关于能够使用ext之类的东西(解释很模糊),但这似乎不是最干净的解决方案.

I'm trying to create a custom login portlet for liferay because I also need to do some other things such as logging. However the problem I've stumbled on is that the portal-impl.jar seems to be shielded off so I can't use the loginutil class. Now I don't want to modify how the actual login works so this is quite a bummer. I've read something about being able to use something like ext(the explanation was quite vague) but that didn't seem like the cleanest solution.

我在开发portlet方面有一些经验,但是我是为liferay开发的新手.

I've got some experience at developing portlets, but I'm new at developing for liferay.

推荐答案

创建所谓的"ext插件"是解决问题的最佳方法. 文档的这部分应为您的第一步.

creating an "ext plugin", as it is called, is the best way to solve your problem. This part of the documentation should be your first step.

首先,您应该在portal.properties中标识要修改的属性:是管道中的另一个自动登录,还是由登录操作触发的操作.我经常将第一个用于自定义SSO操作,将第二个用于审计目的.

First, you should identify in the portal.properties the properties to modify : be it another autologin in the pipeline, or an action triggered by the login action. I often use the first one for custom SSO actions, and the latter for auditing purposes.

然后使用您的自定义类(例如,扩展loginutil)创建一个ext插件,并创建引用它所需的portal-ext.properties.

Then create an ext plugin with your custom class (extending loginutil, for example) and create embed the portal-ext.properties needed to reference it.

这样,您应该能够拥有一个干净的程序包以进行部署和取消部署;自定义登录portlet的jsps也可以完成.

That way, you should be able to have a clean package to deploy and undeploy ; customizing the jsps of the login portlet can also be done.

Arnaud

这篇关于以编程方式登录liferay的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆