Fóruns

Início » Liferay Portal » English » 6. Portal Framework

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Abhi Ed
creating hook for StartupAction in liferay
7 de Novembro de 2012 22:02
Resposta

Abhi Ed

Ranking: Regular Member

Mensagens: 118

Data de entrada: 4 de Junho de 2012

Mensagens recentes

Hello friends ,

I have a requirement to create a hook for StartupAction for adding a custom field to User table in liferay .
But, i have only created hooks with jsp files. Can anyone tell me the steps for creating hook in this case ?
And where can I find that file StartupAction .java ?

Regards
Ed
Antoine Comble
RE: creating hook for StartupAction in liferay
14 de Junho de 2013 13:31
Resposta

Antoine Comble

Ranking: Regular Member

Mensagens: 201

Data de entrada: 7 de Setembro de 2012

Mensagens recentes

Hi,

You can override this properties in portal.properties :
 1
 2# Global startup event that runs once when the portal initializes.
 3#
 4global.startup.events=com.liferay.portal.events.GlobalStartupAction
 5
 6
 7# Application startup event that runs once for every web site instance of
 8# the portal that initializes.
 9#
10application.startup.events=com.liferay.portal.events.AppStartupAction

After doing this, you create a class like com.liferay.portal.events.AppStartupAction and when liferay starts up, your code will be executed.

To hook portal.properties, in your liferay-hook.xml add this :
1
2<portal-properties>portal.properties</portal-properties>


The, create a portal.properties file in project classpath and should be work.

Antoine