Fetch a Resource Attribute
hi,
I have to get resource attribute.I defined an otional attribute status in LDAP for each user.Now in my form I need to show the user's status(stored in LDAP).This attribute is also present in the resource schema map.I need to do this for a list of users.I get the list of WSuser objects.
When trying to get this attribute, I did it this way.
<invoke name='getAssignedResource'>
<ref>userObject</ref> this is WS user Object.
<s>LDAP</s>
</invoke>
I get the resource object here.How can I get the attribute status here.
I tried getAttribute on this object,with attribute =status but that returns null.
Give some ideas.
Thanks,
Pandu
[753 byte] By [
pandu345] at [2007-11-13]

Hi,
Thanks for you response.Actually What I am doing is ,I need to present the list of users and their resources,created date in a table.So What I am doing is Using the getObjects method and passing type as user.Here I am getting all the WSUser objects of all the users.If I have WS user object I can get his name,email etc,also the list of resources he has.Now I have WSUser Object or the object returned by getobjects method.I need to get his status which is an attribute in his ldap account.
Thanks for reply,
Pandu.
Do you have any idea on how to customize reports to include resource specfic attributes.
Infact we could able to do a readonly fetch to resources without doing a checkout (or a readonly checkout), but I'm not sure wether we could do that or not. As per my idea we could fetch the resource attribute values only by doing a user checkout, but in your case it will be very heavy to do that. So you can do a resource search by using the below eg.
<defvar name='results'>
<invoke name='getResourceObjects' class='com.waveset.ui.FormUtil'>
<ref>sessionDisplay</ref>
<ref>objectClass</ref>
<ref>resourceName</ref>
<block>
<defvar name='options'>
<new class='java.util.HashMap'/>
</defvar>
<invoke name='put'>
<ref>options</ref>
<s>searchContext</s>
<s>ou=abc,ou=xyz,o=abc.com</s>
</invoke>
<invoke name='put'>
<ref>options</ref>
<s>searchAttrsToGet</s>
<o>
<List>
<String>uid</String>
<String>businessunit</String>
</List>
</o>
</invoke>
<invoke name='put'>
<ref>options</ref>
<s>searchFilter</s>
<concat>
<s>(</s>
<ref>uidName</ref>
<s>=</s>
<ref>uidValue</ref>
<s>)</s>
</concat>
</invoke>
<invoke name='put'>
<ref>options</ref>
<s>searchScope</s>
<s>subTree</s>
</invoke>
<ref>options</ref>
</block>
</invoke>
</defvar>
You can make changes accordingly