Hello,
I'm also trying to map ldap with custom attributes (phone number) but I cannot finish properly the users update/addition .
I mean, I've added an officePhone attribute, so I got:
1String[] mappedUserAttributeIds = {
2 userMappings.getProperty("screenName"),
3 userMappings.getProperty("emailAddress"),
4 [b]userMappings.getProperty("officePhone"),[/b]
5 userMappings.getProperty("baseOffice"),
6 userMappings.getProperty("fullName"),
7 userMappings.getProperty("firstName"),
8 userMappings.getProperty("middleName"),
9 userMappings.getProperty("lastName"),
10 userMappings.getProperty("jobTitle"),
11 userMappings.getProperty("group")
12 };
The conexion with ldap is working and I can read that new attribute with
1String officePhone = LDAPUtil.getAttributeValue(attrs, userMappings.getProperty("officePhone"));
The problem appears when I try to save that attribute to the database. I've created a "custom attribute" through the GUI called "office-phone", so in importLDAPUser function (PortalLDAPUtil.java) I've added:
1Map<String, Serializable> expandoBridgeAttributes=new LinkedHashMap<String, Serializable>();
2 expandoBridgeAttributes.put("office-phone", officePhone);
3 serviceContext.setExpandoBridgeAttributes(expandoBridgeAttributes);
Because, as far as I know, that is the way I have to specify values for new custom attributes..am I right?
The problem is that I got the following error when making the addition of the new "expando value":
ERROR [ExpandoBridgeImpl:255] com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
at com.liferay.portal.service.base.PrincipalBean.getPermissionChecker(PrincipalBean.java:77)
at com.liferay.portlet.expando.service.impl.ExpandoValueServiceImpl.addValue(ExpandoValueServiceImpl.java:51)
at sun.reflect.GeneratedMethodAccessor354.invoke(Unknown Source)...
Does it means anything to you?
Any help would be appreciated.
Thanks!