掲示板

Hook in portlets plugin Deployment order

9年前 に Morad Ahmad によって更新されました。

Hook in portlets plugin Deployment order

Junior Member 投稿: 71 参加年月日: 10/06/16 最新の投稿
Hello,

I have a hook within a portlets project. The hook refernces the portlets in the plugin to build the site. And It calls *LocalServiceUtil classes to add sample data.
However I can't ensure the portlets and permissions (in "resource-actions/default.xml") are already exists during the execution of the hook (SetupAction configured as application.startup.events=package.name.XXXSetupAction).

I then become a lot of "NoResource" Exceptions .... (#ADD_ENTRY, #ADD_TO_PAGE) .

The second deployment of the same plugin and reexecute of the SetupAction produces no exception because portlets and resources are already deployed!

Is there a way to enforce order 1. deploy portlets and resources, the run the SetupAction?

Thank you,
Morad.
thumbnail
9年前 に Andew Jardine によって更新されました。

RE: Hook in portlets plugin Deployment order

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
I would actually suggest moving the hook to a separate project and then in the hook project setting a context dependency in the liferay-plugin-package.properties -- that way the hook will delay until the dependencies are met.
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: Hook in portlets plugin Deployment order

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Liferay uses the startup action to test whether resources exist and, when they do not, will insert them.

You're letting the Liferay boilerplate code handle it, which is fine, but then you have to accommodate for it some other way.
9年前 に Morad Ahmad によって更新されました。

RE: Hook in portlets plugin Deployment order

Junior Member 投稿: 71 参加年月日: 10/06/16 最新の投稿
Thank you,

I must move the code to a separate hook plugin. But actually i expect portlets and resource should be deployed befor startup events fired.
thumbnail
9年前 に Andew Jardine によって更新されました。

RE: Hook in portlets plugin Deployment order

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Either way, using the plugin package dependencies, it won't actually deploy the hook until it sees that the portlet is present.