Fórumok

how to use PortletPreferences in a hook?

asdsad asdadasd, módosítva 8 év-val korábban

how to use PortletPreferences in a hook?

New Member Bejegyzések: 23 Csatlakozás dátuma: 2015.07.23. Legújabb bejegyzések
I am creating a hook where I customize the login portlet. I need to get the portlet preferences from the hook. How I can do it?
I am trying like this but the result is null

PortletPreferences preferences = actionRequest.getPreferences();
String emailFromName = preferences.getValue("emailFromName", null);
thumbnail
Olaf Kock, módosítva 8 év-val korábban

RE: how to use PortletPreferences in a hook?

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
What kind of hook do you write? Struts Action? JSP? In a JSP I'd expect a renderRequest to work better than an actionRequest.

Also: (I haven't looked at the code): Are you sure that there is such a preference? Where did you get that name from and what do you intend to do with it?

On a related note, you might want to edit your profile's name to look more human and not trigger our (well, my) mental spam filter that always kicks in seeing a post by "asdsad asdadasd". If you want to stay anonymous, pick any name. It doesn't need to be your own.
Adrian Perez, módosítva 8 év-val korábban

RE: how to use PortletPreferences in a hook?

New Member Bejegyzések: 23 Csatlakozás dátuma: 2015.07.23. Legújabb bejegyzések
here is the code I copied in my hook just to change it a little. Its I think Struts Action. The code I mansion in my previous post is from sendPassword(...) .
In this function I think its used the portletPreferences of the login portlet which I cannot see anywhere.... ( I mean this preferences) . My question is also teoritical. How I get portletPreferences from a hook with StrutsAction when I extend a portlet and is it at all possible?