M. Hofstetter

Greenhorn
+ Follow
since Nov 12, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by M. Hofstetter

Hello,

I am using a rich:tree to display chapters and leafs. A user can click on a chapter to add a new leaf and is forwarded to another page with an input mask. After saving the leaf he is returned to the tree. My goal is to expand a path in the tree from the root to the newly added node. So I stored the id of the newly added node in the session in order to access it upon returning to the TreeView.
As of yet I did not succeed to get the nodes to expand to the newly added node.

I tried several variants. First I used this adviseNodeOpened= binding in the rich tree:



This does expand all nodes up to the depth of 2 but it does not expand a path to the newly added node (expandedNodeId). Debuging confirmed that the method does return true for the node with the expandedNodeId. I suspect the Problem is that the Parents of the Node will usually not be expanded. I could check for every Node if there is a node with the expandedNodeId deeper in the tree but that seems inefficient.

So I tried another aproach. I read that the rich:tree has some handy methods to expand like richTree.queueExpandAll(). To test the concept I placed a button on my page to expand the whole Tree. If I had been successfull I would have used the richTree.queueNodeExpand() method to expand a path to my desired Node.

I made a binding like this


Then I placed a button in the same form that rich:tree is in

and finally the code of the viewFragebogenBean#expandAll method



Unfortunatly the tree will not expand upon pressing the button. I could not figure out why. The binding of rich:tree seems to be working and the expandAll() method runs without error. However there is no reaction on the tree in the browser. If anyone has another idea to expand a path to the desired node or spots an error in my code I would greatly appreciate it.

15 years ago
JSF
Hello

I am building an application that authentificates it's users on an LDAP Server (Active Directory). I am using the LdapExtLoginModule of JBoss. This works well for the authentification of users.

However I have to get further infos from the ldap Server. For example I need the name and surname of a user. To do this I am currently using a javax.naming.context and a Filter on the Attributes I am intrested in.


Furthermore I wan't to map the rolename from the ldapname to a name we use inside our application for authorization purposes. To achieve this we used the <security-role-ref> element in the web.xml

<security-role-ref>
<role-name>Leader</role-name>
<role-link>groupleader</role-link>
</security-role-ref>
...

So a call to isUserInRole("Leader") returns true for an admin. I do this to be more independent of the underlying ldap representation of the roles.

The problem is the following:
The application has some methods where a groupleader displays data of the members of the group he is in. So in ldap he is member of the groupleader-group and member of the group that he leads.

Example:


So now I would like to get all the members of workgroup1 from the ldap server. I can do this using javax.naming (directory.DirContext etc). This does not work however with the mapped names, since ldap does not know about them.

So my question is: Can I somehow get the mapping for Group1 to the real ldap group (workgroup1) from the server, so I can use it to query ldap for every member in that group?

Also on a more general note; Is this the right way to represent groups in an ActiveDir? I think it is a bit strange because on one hand the ldap groups are used to denote the role of an user (Leader) and on the other hand the ldap groups are used to organize the workforce into workgroups.

I hope I managed to make my problem clear. Any help or comments would be greatly appreciated.

Cheers
MH

[ November 12, 2008: Message edited by: M. Hofstetter ]

[ November 12, 2008: Message edited by: M. Hofstetter ]

[ November 12, 2008: Message edited by: M. Hofstetter ]
[ November 12, 2008: Message edited by: M. Hofstetter ]