留言板

Suggestion to implement servlet event Hooks

thumbnail
Nithin KV,修改在7 年前。

Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Hi,
Which Event is better to customize using Hooks ? Can anybody explain me the advantages and disadvantages of hooking these servlet service events ?
ServicePostAction or ServicePreAction
I need to get themeDisplay object during login.
thumbnail
David H Nebinger,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
The only difference between the two is when they are called, either before the service or after.

The ThemeDisplay object is available in the request, you shouldn't have to go after those in service pre or post action.
thumbnail
Nithin KV,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Thanks for the suggestion but i do not get themedisplay object from request or from any attribute in my postlogin hook.
thumbnail
Olaf Kock,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Liferay Legend 帖子: 6396 加入日期: 08-9-23 最近的帖子
When you need to do stuff during Login, note that there's a PreLogin and PostLogin Action as well. It makes sense to take the most specific one for this purpose. Also, I doubt that you need themeDisplay - you probably need at least one of the values that it provides access to. May I ask which one that is?
thumbnail
Nithin KV,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Hi , yes i want to get themename and theme settings from theme display object of the theme applied to login page at the time of login !
thumbnail
Nithin KV,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Pls Suggest !
thumbnail
Olaf Kock,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Liferay Legend 帖子: 6396 加入日期: 08-9-23 最近的帖子
If I'm translating the business requirement "applied to login page at the time of login" to technical language, I don't really understand how to do this:

"during log in" technically means either just before or just after validating the name/password of the user. Just showing the login page has nothing to do with the log in process, you'll have all the information for the login page while displaying that page. It's a page like any other page.

You might need to implement a customization for the login portlet, but that depends on what you actually want to do. We don't know anything other than that you want to access some data to do something. Maybe you should let us know of these actual requirements instead of your proposed solution.
thumbnail
David H Nebinger,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Nithin KV:
Hi , yes i want to get themename and theme settings from theme display object of the theme applied to login page at the time of login !


I'm trying to understand what the theme name and theme settings have to do with completing a login. Login success is binary - either you are logged in or you are not. The theme info doesn't really play a part in that decision.
thumbnail
Nithin KV,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Hi,
I have a requirement to load custom theme settings of login page from theme display object during login so that I can use these settings to perform some action in the different theme after login. I have different login pages for different sites. Hope you got it.
thumbnail
David H Nebinger,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
but your different site will have a different theme assigned, so again the login doesn't really play any role?

If I understand correctly, it sounds like you want the login to actually affect change to the theme that is applied to a page - that's not really going to be possible and honestly those changes will not flow forward as the user navigates around in the site.

The theme styles a page, but the user does not style the theme.
thumbnail
Nithin KV,修改在7 年前。

RE: Suggestion to implement servlet event Hooks

Junior Member 帖子: 56 加入日期: 12-7-23 最近的帖子
Hi , I agree what you said but here the requirement is different. currently I am using one theme for login page of all sites with different look and feel and one theme after login with different color schemes for each site ! So like I said earlier I have a login page in each site with the same theme and settings.. I want to load these settings at the time of login so that when I go to the actual theme after login I can use these settings to perform some actions ! Here when I say settings , it means like to hide or show few portlets , to hide or show footer for each site, to change site title etc. !