Forums de discussion

Importing a journal lar programmatically

Dirk Gomez, modifié il y a 15 années.

Importing a journal lar programmatically

New Member Publications: 4 Date d'inscription: 13/11/08 Publications récentes
Hi there,

I am trying to automatically import a journal lar file on system startup.

For this I have patched StartupAction.java and have added my startup extensions there - after the call of the doRun method.

My import call is simple:

LayoutLocalServiceUtil.importPortletInfo(
DirksConstants.ADMIN_USER_ID, 10132, "15", paramMap,
templateFile);

The whole thing seems to fail when PortletPreferencesUtil.findByO_O_P_P is called in PortletImporter.PortletDataContext - the NoSuchPortletPreferencesException is thrown but nothing happens in the catch section.

Is it possible to import a journal lar file non-interactively? What is wrong with my approach?

Thanks a lot

-- Dirk
thumbnail
Aritz Galdos, modifié il y a 14 années.

RE: Importing a journal lar programmatically

Expert Publications: 416 Date d'inscription: 15/05/07 Publications récentes
Hi Dirk:

It may be to late but anyway I wold sugest you to create a Hook to be launched everi time app server is started or to triggered with an event.

Here an usefull link

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Portal+Hook+Plugins


Hope it helps