Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
6.2 IDE Hook project
I have been away from Liferay for a while, probably 6.0 and I downloaded the new set, the 6.2 IDE, 6.2 Bundle with tomcat, 6.2 SDK.
I created a plugin project for a Hook.
I created a new class as follows...I implemented all methods but I am not showing them all because they are all the same...
I did a right click on the project Liferay->SDK->All and everything seemed fine.
But when I run Liferay and login as admin and add an organization or update its details, I don't see the System.out.println("..");
I went to the Hook Tutorial and the example clearly shows the same thing...although the tutorial isn't using the IDE.
Do I need to configure log4j in my Hook and change all my System.out.println to loggers?
I created a plugin project for a Hook.
I created a new class as follows...I implemented all methods but I am not showing them all because they are all the same...
public class OrganizationHook extends OrganizationLocalServiceWrapper {
/**
* @param organizationLocalService
*/
public OrganizationHook(OrganizationLocalService organizationLocalService) {
super(organizationLocalService);
// TODO Auto-generated constructor stub
System.out.println("MuleCAREHook -OrganizationHook");
}
@Override
public void addGroupOrganization(long groupId, long organizationId)
throws SystemException {
System.out.println("MuleCAREHook -addGroupOrganization(long groupId, long organizationId)");
super.addGroupOrganization(groupId, organizationId);
}
...
I did a right click on the project Liferay->SDK->All and everything seemed fine.
Mar 14, 2014 2:43:19 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
02:43:19,902 INFO [localhost-startStop-1][HookHotDeployListener:687] Registering hook for MuleCAREHooks-hook
02:43:19,904 INFO [localhost-startStop-1][HookHotDeployListener:814] Hook for MuleCAREHooks-hook is available for use
But when I run Liferay and login as admin and add an organization or update its details, I don't see the System.out.println("..");
I went to the Hook Tutorial and the example clearly shows the same thing...although the tutorial isn't using the IDE.
Do I need to configure log4j in my Hook and change all my System.out.println to loggers?
How your liferay-hook.xml looks like ?
Have you properly added <service> tag in your liferay-hook.xml ?
REF : https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/override-a-portal-service-with-hook-liferay-portal-6-2-dev-guide-en
Thanks,
Tejas
Have you properly added <service> tag in your liferay-hook.xml ?
REF : https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/override-a-portal-service-with-hook-liferay-portal-6-2-dev-guide-en
<service>
<service-type>
com.liferay.portal.service.OrganizationLocalService
</service-type>
<service-impl>
{com.*.OrganizationHook} // your OrganizationHook class entry
</service-impl>
</service>Thanks,
Tejas
Yes that was it. Somehow I thought that was done before.
Thanks,
MO
Thanks,
MO