|
Home > Archive > WebSphere Portal Server > January 2007 > Can't get custom defined attributes using PUMA SPI
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Can't get custom defined attributes using PUMA SPI
|
|
|
| Description:
When we try to get custom attributes from objects with custom objectclasses from LDAP, method PumaProfile.getAttributes(<Principal>, <custom attributes names> ) return Map, without that attributes. But when we try to search principal by attributes (PumaLo
cator.findGroupsByAttribute(<custom attribute name>, <value> ) ), we get non empty list, with correct result.
Environment:
WebSphere AS 6.0.2.15
WebSphere Portal 5.1.0.4
SunOne DS 5.2.p4
Code:
javax.naming.Context ctx = new javax.naming.InitialContext();
PortletServiceHome psh = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");
if (psh != null) {
PumaHome service = (PumaHome) psh.getPortletService(PumaHome.class);
PumaLocator pl = service.getLocator(request);
PumaController pc = service.getController(request);
PumaController pp = service.getController(request);
List groups = pl.findGroupsByAttribute("myattribute", "value");
if (groups.size > 0) {
// If we specified correct search criteria result.size() not equals zero
Group group = (Group) groups.get(0);
List attrNames = new ArrayList();
attrNames.add("myattribute");
Map attrs = pp.getAttributes(group, attrNames);
String value = attrs.get("myattribute");
// Variable "value" allways equals null
}
}
Ldap schema:
attributeTypes: ( 1.3.6.1.4.1.9052.1.2.1.1.1 NAME 'myattribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'user
defined' )
objectClasses: ( 1.3.6.1.4.1.9052.1.2.1.2.8 NAME 'myobjectclass' SUP groupofuniquenames STRUCTURAL MUST myattribute X-ORIGIN 'user defined' )
WMM configuration:
wmmAttributes.xml:
<attribute wmmAttributeName="myattribute"
applicableMemberTypes="Group"
dataType="String"
valueLength="10"
multiValued="false"/>
wmmLDAPServerAttributes.xml:
<attributeMap wmmAttributeName="myattribute"
pluginAttributeName="myattribute"
applicableMemberTypes="Group"
dataType="String"
valueLength="10"
multiValued="false"/>
wmm.xml:
<supportedLdapEntryType name="Group"
rdnAttrTypes="cn"
objectClassesForRead="groupOfUniqueNames;myobjectclass"
objectClassesForWrite="groupOfUniqueNames;myobjectclass"
searchBases="ou=groups,dc=ru"/>
| |
|
| You should add the attribute to group.minimum.attributes in the file <WPS_ROOT>/shared/app/config/services/PumaService.properties.
Also add it to LDAPGroupMinimumAttributes in wpconfig.properties.
|
|
|
|
|