Foros de discusión

Reading portlet preference in Scheduler of the portlet

Liferay Question, modificado hace 12 años.

Reading portlet preference in Scheduler of the portlet

thumbnail
Shagul Khajamohideen, modificado hace 12 años.

RE: Reading portlet preference in Scheduler of the portlet

Liferay Master Mensajes: 758 Fecha de incorporación: 27/09/07 Mensajes recientes
Liferay Question:
Hi,

Can I get portletPreference of my portlet in the scheduler of the same portlet.

Regards,
Liferay Questions



As you may know , portlet preferences belong to the portlet (portletId) in a page (plid). If the portlet is instanceable then the portletId will be that of the portlet instance id. Portlet preferences are stored in the database and com.liferay.portal.util.PrefsPropsUtil.java can be used as an example on how to retrieve those preferences using the PortletPreferencesLocalServiceUtil.
Liferay Question, modificado hace 12 años.

RE: Reading portlet preference in Scheduler of the portlet

Andrew Millband, modificado hace 12 años.

RE: Reading portlet preference in Scheduler of the portlet

New Member Mensaje: 1 Fecha de incorporación: 22/11/11 Mensajes recientes
Clark - did you ever find a solution to this? I have a similar use case, and before I post a new question I'm hoping you might've found an answer emoticon
Mohamed Saleem, modificado hace 4 años.

RE: Reading portlet preference in Scheduler of the portlet

Junior Member Mensajes: 37 Fecha de incorporación: 16/12/15 Mensajes recientes
Hi Andrew,
Did you get solution for this case?emoticon​​​​​​​
thumbnail
Josef Šustáček, modificado hace 12 años.

RE: Reading portlet preference in Scheduler of the portlet

New Member Mensajes: 22 Fecha de incorporación: 5/10/09 Mensajes recientes
Hi,

I used portlet schedulers back in 5.2.3 and if it wasn't changed, you don't have access to such objects. The scheduler is run only once, not per portlet instance, right?

If I remember, the scheduler is defined for the portlet as a whole (you define one scheduler class in liferay-portlet.xml per portlet), that means one scheduler for all instances of the portlet in the whole portal, on all pages.

I'm not sure how this works with more companies in portal, but I assume this is not your case and you have only one company.

If you want to do some portlet preferences update for one portlet instance located on some page, you have to define plid (page's id, e.g. 10520) and portletId (instance id, e.g. _mybusinessapplicationportlet_WAR_myportlet_INSTANCE_FqL4) in some properties file and read this file from scheduler. Then you can load portlet preferences of such portlet instance via:


Layout layout = LayoutLocalServiceUtil.getLayout(plid);

javax.portlet.PortletPreferences prefs = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, portletId);
Abhay Chaware, modificado hace 10 años.

RE: Reading portlet preference in Scheduler of the portlet

Junior Member Mensajes: 36 Fecha de incorporación: 17/07/13 Mensajes recientes
Hello ..
Sorry to open up this old thread, but in my case I actually have multiple companies ( portal instances ) and need to run the same scheduler job on all the instances. I have a thread posted here. Any pointers ?

Thanks
Abhay