Wednesday, December 15, 2010

Display Child Organizations

If you want to display all the child organizations of a parent organization then use the following code :-

<block name='test org' trace="true">
<set name='finalChildOrgList'>
<list/>
</set>

<set name='orgsList'>
<new class='java.util.ArrayList'/>
</set>
<set name='orgObject'>
<getobj>
<s>ObjectGroup:</s>
<s>Top</s> <!-- direct pass parent Orgnization (ObjectGroup Name) name -->
</getobj>
</set>

<invoke name='getChildObjectGroups'>
<ref>orgObject</ref>
<ref>orgsList</ref>
</invoke>

<dolist name='tempOrgName'>
<ref>orgsList</ref>
<appendAll name='finalChildOrgList'>
<invoke name='getDisplayName'>
<ref>tempOrgName</ref>
</invoke>
</appendAll>
</dolist>

<cond>
<contains>
<ref>finalChildOrgList</ref>
<s>End User</s>
</contains>
<removeAll name='finalChildOrgList'>
<s>End User</s>
</removeAll>
</cond>

<ref>finalChildOrgList</ref>

</block>

No comments:

Post a Comment