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
How to override validateScreenName method from UserLocalServiceImpl
Hi,
I have a requirement where I need to override the validateScreenName() method from UserLocalServiceImpl.
I need to change this:
String friendlyURL = FriendlyURLNormalizerUtil.normalize(
StringPool.SLASH + screenName);
to this:
long userId = CounterLocalService.increment();
String friendlyURL = FriendlyURLNormalizerUtil.normalize(
StringPool.SLASH + userId);
I tried writing servicewrapper to copy paste the UserLocalServiceImpl but I was getting another issue where I was not able to resolve the dependency for:
EmailAddressGenerator emailAddressGenerator =
EmailAddressGeneratorFactory.getInstance();
and other singleton calls like this.
I am using liferay 7.0
Please suggest.
Apurb
Hi ,
You can try creating osgi module implementing FriendlyURLNormalizer.class and having higher service rank, you can add ur custom logic in that.
You can refer below default code and customize accordingly.
https://github.com/liferay/liferay-portal/blob/7.0.x/portal-impl/src/com/liferay/portal/util/FriendlyURLNormalizerImpl.java
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™