Fórumok

Reading portlet preference in Scheduler of the portlet

Liferay Question, módosítva 12 év-val korábban

Reading portlet preference in Scheduler of the portlet

thumbnail
Shagul Khajamohideen, módosítva 12 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

Liferay Master Bejegyzések: 758 Csatlakozás dátuma: 2007.09.27. Legújabb bejegyzések
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, módosítva 12 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

Andrew Millband, módosítva 12 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.11.22. Legújabb bejegyzések
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, módosítva 4 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

Junior Member Bejegyzések: 37 Csatlakozás dátuma: 2015.12.16. Legújabb bejegyzések
Hi Andrew,
Did you get solution for this case?emoticon​​​​​​​
thumbnail
Josef Šustáček, módosítva 12 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

New Member Bejegyzések: 22 Csatlakozás dátuma: 2009.10.05. Legújabb bejegyzések
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, módosítva 10 év-val korábban

RE: Reading portlet preference in Scheduler of the portlet

Junior Member Bejegyzések: 36 Csatlakozás dátuma: 2013.07.17. Legújabb bejegyzések
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