6.2 IDE Hook project

Michael Oliver, modified 12 Years ago. Junior Member Posts: 66 Join Date: 4/19/12 Recent Posts
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...


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?
thumbnail
Tejas Kanani, modified 12 Years ago. Liferay Master Posts: 654 Join Date: 1/6/09 Recent Posts
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
<service>
    <service-type>
    com.liferay.portal.service.OrganizationLocalService
    </service-type>
    <service-impl>
    {com.*.OrganizationHook} // your OrganizationHook class entry
    </service-impl>
</service>


Thanks,
Tejas
Michael Oliver, modified 12 Years ago. Junior Member Posts: 66 Join Date: 4/19/12 Recent Posts
Yes that was it. Somehow I thought that was done before.

Thanks,

MO