List of usage examples for com.liferay.portal.kernel.util.comparator UserScreenNameComparator UserScreenNameComparator
public UserScreenNameComparator()
From source file:com.liferay.mentions.internal.util.DefaultMentionsUserFinder.java
License:Open Source License
@Override public List<User> getUsers(long companyId, long userId, String query, SocialInteractionsConfiguration socialInteractionsConfiguration) throws PortalException { if (socialInteractionsConfiguration.isSocialInteractionsAnyUserEnabled()) { LinkedHashMap<String, Object> params = new LinkedHashMap<>(); params.put("wildcardMode", WildcardMode.TRAILING); return _userLocalService.search(companyId, query, WorkflowConstants.STATUS_APPROVED, params, 0, _MAX_USERS, new UserScreenNameComparator()); }/*from w w w . ja va 2 s . c o m*/ User user = _userLocalService.getUser(userId); int[] types = { SocialRelationConstants.TYPE_BI_FRIEND }; if (socialInteractionsConfiguration.isSocialInteractionsFriendsEnabled() && socialInteractionsConfiguration.isSocialInteractionsSitesEnabled()) { return _userLocalService.searchSocial(user.getGroupIds(), userId, types, query, 0, _MAX_USERS); } if (socialInteractionsConfiguration.isSocialInteractionsSitesEnabled()) { return _userLocalService.searchSocial(companyId, user.getGroupIds(), query, 0, _MAX_USERS); } if (socialInteractionsConfiguration.isSocialInteractionsFriendsEnabled()) { return _userLocalService.searchSocial(userId, types, query, 0, _MAX_USERS); } return Collections.emptyList(); }