Forums de discussion

Web service update portlet preferences

Luca Andreatta, modifié il y a 10 années.

Web service update portlet preferences

Junior Member Publications: 33 Date d'inscription: 16/02/09 Publications récentes
Hi all,
I wanted to update portlet preferences using web service in Liferay 6.1.1.
There is a local service to do it (PortletPreferencesServiceWrapper.updateArchivePreferences), but it isn't exposed.

What is the best way to do it? Using a Hook or build a new webservice through service builder which calls the internal service?

Thank,
Luca
thumbnail
Antoine Comble, modifié il y a 10 années.

RE: Web service update portlet preferences

Regular Member Publications: 232 Date d'inscription: 07/09/12 Publications récentes
Hi Luca,

In my opinion, you should create a new service using service builder.

Regards,

Antoine
thumbnail
David H Nebinger, modifié il y a 10 années.

RE: Web service update portlet preferences

Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
In my opinion, you should forget about it...

The portlet prefs allow a portlet instance to update it's own prefs, typically as a result of the user tweaking the prefs dialog. It's also bound to the instance of the portlet on the page, not every single portlet of a type...

So why on earth would you want remote users to be able to change portlet instance prefs?
Luca Andreatta, modifié il y a 10 années.

RE: Web service update portlet preferences

Junior Member Publications: 33 Date d'inscription: 16/02/09 Publications récentes
I still don't understand why on earth Liferay gives you the remote services to add sites, users, groups, pages, portlets but don't gives you the opportunity to configure these portlets?!?

And why a so called Liferay Legend suggest me to forget about it? I don't think my request is so awkward, I only want to create sites remotely in Liferay!
David H Nebinger:
In my opinion, you should forget about it...

The portlet prefs allow a portlet instance to update it's own prefs, typically as a result of the user tweaking the prefs dialog. It's also bound to the instance of the portlet on the page, not every single portlet of a type...

So why on earth would you want remote users to be able to change portlet instance prefs?
Luca Andreatta, modifié il y a 10 années.

RE: Web service update portlet preferences

Junior Member Publications: 33 Date d'inscription: 16/02/09 Publications récentes
Hi,
I wanted to create sites in Liferay from a Portlet. I want to use web services to be more adherent to the rest of the application, because it will create some folders also in Alfresco and a project in JIRA, just to clarify why on earth I want to do it...

I'm not sure to use the service builder, because I don't need all the chain from database to web service, but only to extend an internal service and then expose as a web service.
Luca Andreatta, modifié il y a 10 années.

RE: Web service update portlet preferences

Junior Member Publications: 33 Date d'inscription: 16/02/09 Publications récentes
I found that I cannot use a portlet plugin to expose the method PortletPreferencesServiceUtil.updateArchivePreferences(long userId, long groupId, String name, String portletId, PortletPreferences preferences) because I cannot use the Object com.liferay.portlet.PortletPreferencesImpl that resides in porta-impl.jar and if I add it to my portlet I get this error:
Detected inclusion of portal-impl.jar in WEB-INF/lib.

portal-impl.jar is designed with a large number of singleton classes which are
instantiated on the basis that they will exist alone in the application server.

While compile time issues may be resolved, portlets cannot be made to work by
simply adding portal-impl.jar, because doing so violates the above assumption,
and the resulting problems will be extremely difficult to debug.

Please find a solution that does not require portal-impl.jar.


So I tried to usa a Hook, but apparently it is not possible to do it in a Hook:
LPS-30487
Forum Message 17048822

How can I do it? Can I do it using an ext plugin?