Hi Chinna,
I have the following configuration for overriding the addUser method of UserLocalServiceWrapper. And it is working fine for me.
JAVA Code
1
2........................................
3.......................................
4public class CustomUserLocalService extends UserLocalServiceWrapper {
5
6...............................................
7...............................................
8
9 public CustomUserLocalService (UserLocalService userLocalService) {
10 super(userLocalService);
11 }
12
13 @Override
14 public User addUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2,
15 boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId,
16 Locale locale, String firstName, String middleName, String lastName, int prefixId, int suffixId,
17 boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds,
18 long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail,
19 ServiceContext serviceContext) throws PortalException, SystemException {
20
21 System.out.println("Add User Method is overriden");
22
23 return super.addUser(creatorUserId, companyId, autoPassword, password1, password2, autoScreenName,
24 sanitisedScreenName, emailAddress, facebookId, openId, locale, firstName, middleName, lastName,
25 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
26 organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
27 }
28...............................................
29...............................................
30}
liferay-hook.xml
1
2<?xml version="1.0"?>
3<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">
4
5<hook>
6 <service>
7 <service-type>com.liferay.portal.service.UserLocalService</service-type>
8 <service-impl>com.liferay.portal.service.CustomUserLocalService</service-impl>
9 </service>
10</hook>
Hope it helps you.
Cheers
Sushil Saini
Please sign in to flag this as inappropriate.