掲示板
getUserByScreenName vs importLDAPUserByScreenName
6年前 に Neil Tran によって更新されました。
getUserByScreenName vs importLDAPUserByScreenName
New Member 投稿: 8 参加年月日: 16/02/15 最新の投稿
Hi everyone,
I can search for a long list of users i.e 100 users. using the first method without a problem.
User exuser1 = UserLocalServiceUtil.getUserByScreenName(companyId, screenName);
However, I cant use this method to search for a long list of users. i.e 100 users.
//not this method
//PortalLDAPImporterUtil.importLDAPUserByScreenName(companyId, screenName);
I have this error.
java.lang.NullPointerException
at com.liferay.portal.security.ldap.PortalLDAPUtil.getNameInNamespace(PortalLDAPUtil.java:441)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importGroups(PortalLDAPImporterImpl.java:816)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUser(PortalLDAPImporterImpl.java:243)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUserByScreenName(PortalLDAPImporterImpl.java:432)
at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importLDAPUserByScreenName(PortalLDAPImporterUtil.java:82)
Why is that and what is the difference between the two methods?
Thanks
I can search for a long list of users i.e 100 users. using the first method without a problem.
User exuser1 = UserLocalServiceUtil.getUserByScreenName(companyId, screenName);
However, I cant use this method to search for a long list of users. i.e 100 users.
//not this method
//PortalLDAPImporterUtil.importLDAPUserByScreenName(companyId, screenName);
I have this error.
java.lang.NullPointerException
at com.liferay.portal.security.ldap.PortalLDAPUtil.getNameInNamespace(PortalLDAPUtil.java:441)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importGroups(PortalLDAPImporterImpl.java:816)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUser(PortalLDAPImporterImpl.java:243)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUserByScreenName(PortalLDAPImporterImpl.java:432)
at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importLDAPUserByScreenName(PortalLDAPImporterUtil.java:82)
Why is that and what is the difference between the two methods?
Thanks
6年前 に David H Nebinger によって更新されました。
RE: getUserByScreenName vs importLDAPUserByScreenName
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
6年前 に Jenny Chen によって更新されました。
RE: getUserByScreenName vs importLDAPUserByScreenName
New Member 投稿: 8 参加年月日: 10/09/20 最新の投稿
getUserByScreenName() is a getter method that returns a user object while importLDAPUserByScreenName() will grab a user from your LDAP environment based on a screen name and then create/import the user into your Liferay environment. If your Liferay instance requires screen names to be unique, the second method should only let you import/create a user once.