use*_*847 4 events startup liferay
我对Liferay Startup Events有疑问.
在Liferay文档中,它给出了:
启动事件
输入扩展的逗号分隔的类名列表
com.liferay.portal.struts.SimpleAction
.这些类将在指定的事件中运行.
有人可以告诉我和之间的区别是什么global.startup.events
,application.startup.events
并且任何机构可以告诉我在什么情况下我们需要覆盖它们?
并且这两个启动事件应该延伸com.liferay.portal.struts.SimpleAction
吗?SimpleAction
除了这个,我在里面找不到任何东西:
public abstract class SimpleAction {
public abstract void run(String[] ids) throws ActionException;
}
}
Run Code Online (Sandbox Code Playgroud)
我也想知道这个类什么都不包含,Liferay如何知道要读取和处理的XML文件?
谢谢
Mar*_*ark 15
global.startup.events
- 为全局服务器运行一次
application.startup.events
- 在启动时为每个门户网站实例运行.如果您的服务器上有一个门户网站实例(正常情况) - 这些属性之间没有区别.我用application.startup.events
.
扩展com.liferay.portal.kernel.events.SimpleAction
类和impliment run
-methode,将由liferay启动调用.为此,创建一个hook插件并在liferay-hook.xml中注册属性文件,例如:
<hook>
<portal-properties>portal-myext.properties</portal-properties>
</hook>
Run Code Online (Sandbox Code Playgroud)
portal-myext.properties
在类路径中创建并设置启动操作:
application.startup.events=com.my.actions.MyStartupAction
Run Code Online (Sandbox Code Playgroud)
该操作MyStartupAction
必须位于同一个类路径中,因此必须使用相同的hook-plugin.